mirror of
https://github.com/modelstudioai/cli.git
synced 2026-09-14 19:49:23 +08:00
feat(cma): login时初始化agent相关的baseUrl
This commit is contained in:
@@ -11,16 +11,17 @@ let bootstrapped = false;
|
||||
* that loads agents.yaml. `bl` prefix is safe: agent commands ship on `bl` only.
|
||||
*/
|
||||
export const CREDENTIALS_NOTE = [
|
||||
"Credentials come from the env vars referenced in agents.yaml (e.g. ${DASHSCOPE_API_KEY}, ${BAILIAN_WORKSPACE_ID}).",
|
||||
"For the bailian provider, bl fills these from your login as a fallback: `bl auth login` (API key) and `bl config set workspace_id <id>`.",
|
||||
"Credentials come from the env vars referenced in agents.yaml (e.g. ${DASHSCOPE_API_KEY}, ${BAILIAN_BASE_URL}).",
|
||||
"For the bailian provider, bl fills these from your login as a fallback: `bl auth login --api-key <key> --agentstudio-base-url <url>`.",
|
||||
];
|
||||
|
||||
/**
|
||||
* Bridge bl's own login state into the env vars the OpenAgentPack SDK reads for
|
||||
* the bailian provider. bl persists `api_key` / `workspace_id` in
|
||||
* `~/.bailian/config.json` (via `bl auth login` / `bl config set`); mirror them
|
||||
* onto `DASHSCOPE_API_KEY` / `BAILIAN_WORKSPACE_ID` so users don't have to
|
||||
* re-declare the same credentials for `bl agent *`.
|
||||
* the bailian provider. bl persists `api_key` / `agentstudio_base_url` in
|
||||
* `~/.bailian/config.json` (via `bl auth login`); mirror them onto
|
||||
* `DASHSCOPE_API_KEY` / `BAILIAN_BASE_URL` so users don't have to re-declare the
|
||||
* same credentials for `bl agent *`. `workspace_id` is still bridged for configs
|
||||
* that predate the base_url flow (the SDK accepts either).
|
||||
*
|
||||
* Lowest priority: only fills a var that is still unset, so anything already in
|
||||
* the environment (shell export, `.env`, or `~/.agents/config.json` — which the
|
||||
@@ -33,6 +34,9 @@ export function bridgeBailianCredentials(): void {
|
||||
if (!process.env.DASHSCOPE_API_KEY?.trim() && file.api_key) {
|
||||
process.env.DASHSCOPE_API_KEY = file.api_key;
|
||||
}
|
||||
if (!process.env.BAILIAN_BASE_URL?.trim() && file.agentstudio_base_url) {
|
||||
process.env.BAILIAN_BASE_URL = file.agentstudio_base_url;
|
||||
}
|
||||
if (!process.env.BAILIAN_WORKSPACE_ID?.trim() && file.workspace_id) {
|
||||
process.env.BAILIAN_WORKSPACE_ID = file.workspace_id;
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ agents.state.json
|
||||
const PROVIDERS = ["bailian", "claude", "qoder", "ark", "all"] as const;
|
||||
|
||||
const PROVIDER_BLOCKS: Record<string, string> = {
|
||||
bailian: ` bailian:\n # bl auth login sets DASHSCOPE_API_KEY; bl config set workspace_id <id> sets BAILIAN_WORKSPACE_ID\n api_key: \${DASHSCOPE_API_KEY}\n workspace_id: \${BAILIAN_WORKSPACE_ID}`,
|
||||
bailian: ` bailian:\n # bl auth login --api-key <key> sets DASHSCOPE_API_KEY; --agentstudio-base-url <url> sets BAILIAN_BASE_URL\n api_key: \${DASHSCOPE_API_KEY}\n base_url: \${BAILIAN_BASE_URL}`,
|
||||
claude: ` claude:\n api_key: \${ANTHROPIC_API_KEY}`,
|
||||
qoder: ` qoder:\n api_key: \${QODER_PAT}\n gateway: "https://api.qoder.com/api/v1/cloud"`,
|
||||
ark: ` ark:\n api_key: \${ARK_API_KEY}`,
|
||||
@@ -137,7 +137,7 @@ export default defineCommand({
|
||||
emitBare(`Created ${file}`);
|
||||
if (provider === "bailian" || provider === "all") {
|
||||
emitBare(
|
||||
"Credentials: run `bl auth login` and `bl config set workspace_id <id>`, or set DASHSCOPE_API_KEY / BAILIAN_WORKSPACE_ID.",
|
||||
"Credentials: run `bl auth login --api-key <key> --agentstudio-base-url <url>`, or set DASHSCOPE_API_KEY / BAILIAN_BASE_URL.",
|
||||
);
|
||||
}
|
||||
emitBare("Next: edit agents.yaml, then run `bl agent plan`.");
|
||||
|
||||
@@ -19,12 +19,22 @@ export default defineCommand({
|
||||
usageArgs:
|
||||
"--api-key <key> | --console | --open-api --access-key-id <id> --access-key-secret <secret>",
|
||||
flags: {
|
||||
apiKey: { type: "string", valueHint: "<key>", description: "DashScope API key to store" },
|
||||
apiKey: {
|
||||
type: "string",
|
||||
valueHint: "<key>",
|
||||
description: "DashScope API key to store",
|
||||
},
|
||||
baseUrl: {
|
||||
type: "string",
|
||||
valueHint: "<url>",
|
||||
description: "DashScope API base URL (used with --api-key for validation)",
|
||||
},
|
||||
agentstudioBaseUrl: {
|
||||
type: "string",
|
||||
valueHint: "<url>",
|
||||
description:
|
||||
"Bailian AgentStudio base URL for `bl agent` commands (sets BAILIAN_BASE_URL; used with --api-key)",
|
||||
},
|
||||
console: {
|
||||
type: "switch",
|
||||
description:
|
||||
@@ -65,6 +75,9 @@ export default defineCommand({
|
||||
if (!apiKeyMode && hasValue(f.baseUrl)) {
|
||||
return "Use --base-url only with --api-key";
|
||||
}
|
||||
if (!apiKeyMode && hasValue(f.agentstudioBaseUrl)) {
|
||||
return "Use --agentstudio-base-url only with --api-key";
|
||||
}
|
||||
if (!consoleMode && hasValue(f.consoleSite)) {
|
||||
return "Use --console-site only with --console";
|
||||
}
|
||||
@@ -131,6 +144,9 @@ export default defineCommand({
|
||||
if (baseUrl) {
|
||||
await store.login({ base_url: baseUrl });
|
||||
}
|
||||
if (flags.agentstudioBaseUrl) {
|
||||
await store.login({ agentstudio_base_url: flags.agentstudioBaseUrl });
|
||||
}
|
||||
await validateAndPersistApiKey(deps, key, baseUrl || store.resolveBaseUrl());
|
||||
},
|
||||
});
|
||||
|
||||
@@ -23,6 +23,7 @@ const VALID_KEYS = [
|
||||
"default_speech_model",
|
||||
"default_omni_model",
|
||||
"workspace_id",
|
||||
"agentstudio_base_url",
|
||||
];
|
||||
|
||||
// Keys whose values are secrets. Their stored value must never be echoed back in
|
||||
@@ -44,6 +45,7 @@ const KEY_ALIASES: Record<string, string> = {
|
||||
"default-speech-model": "default_speech_model",
|
||||
"default-omni-model": "default_omni_model",
|
||||
"workspace-id": "workspace_id",
|
||||
"agentstudio-base-url": "agentstudio_base_url",
|
||||
};
|
||||
|
||||
export default defineCommand({
|
||||
@@ -55,10 +57,15 @@ export default defineCommand({
|
||||
type: "string",
|
||||
valueHint: "<key>",
|
||||
description:
|
||||
"Config key (base_url, output, output_dir, timeout, api_key, access_token, access_key_id, access_key_secret, default_*_model, workspace_id)",
|
||||
"Config key (base_url, output, output_dir, timeout, api_key, access_token, access_key_id, access_key_secret, default_*_model, workspace_id, agentstudio_base_url)",
|
||||
required: true,
|
||||
},
|
||||
value: {
|
||||
type: "string",
|
||||
valueHint: "<value>",
|
||||
description: "Value to set",
|
||||
required: true,
|
||||
},
|
||||
value: { type: "string", valueHint: "<value>", description: "Value to set", required: true },
|
||||
},
|
||||
exampleArgs: [
|
||||
"--key output --value json",
|
||||
@@ -106,7 +113,9 @@ export default defineCommand({
|
||||
}
|
||||
|
||||
const coerced = resolvedKey === "timeout" ? Number(value) : value;
|
||||
await ctx.configStore.write({ [resolvedKey]: coerced } as Partial<ConfigFile>);
|
||||
await ctx.configStore.write({
|
||||
[resolvedKey]: coerced,
|
||||
} as Partial<ConfigFile>);
|
||||
|
||||
if (!settings.quiet) {
|
||||
const shown = SECRET_KEYS.has(resolvedKey) ? maskToken(String(coerced)) : coerced;
|
||||
|
||||
@@ -5,20 +5,29 @@ import { expect, test } from "vite-plus/test";
|
||||
import { bridgeBailianCredentials } from "../src/commands/agent/_engine/credentials.ts";
|
||||
|
||||
/**
|
||||
* bridgeBailianCredentials 把 ~/.bailian/config.json 的 api_key / workspace_id
|
||||
* 作为最低优先级兜底填入 DASHSCOPE_API_KEY / BAILIAN_WORKSPACE_ID。
|
||||
* 用临时 config dir + env 保存恢复隔离,验证优先级与不抛错语义。
|
||||
* bridgeBailianCredentials 把 ~/.bailian/config.json 的 api_key / agentstudio_base_url
|
||||
* / workspace_id 作为最低优先级兜底填入 DASHSCOPE_API_KEY / BAILIAN_BASE_URL /
|
||||
* BAILIAN_WORKSPACE_ID。用临时 config dir + env 保存恢复隔离,验证优先级与不抛错语义。
|
||||
*/
|
||||
async function inScenario(
|
||||
scenario: {
|
||||
config?: { api_key?: string; workspace_id?: string };
|
||||
env?: { DASHSCOPE_API_KEY?: string; BAILIAN_WORKSPACE_ID?: string };
|
||||
config?: {
|
||||
api_key?: string;
|
||||
workspace_id?: string;
|
||||
agentstudio_base_url?: string;
|
||||
};
|
||||
env?: {
|
||||
DASHSCOPE_API_KEY?: string;
|
||||
BAILIAN_WORKSPACE_ID?: string;
|
||||
BAILIAN_BASE_URL?: string;
|
||||
};
|
||||
},
|
||||
assert: () => void,
|
||||
): Promise<void> {
|
||||
const savedConfigDir = process.env.BAILIAN_CONFIG_DIR;
|
||||
const savedApiKey = process.env.DASHSCOPE_API_KEY;
|
||||
const savedWorkspace = process.env.BAILIAN_WORKSPACE_ID;
|
||||
const savedBaseUrl = process.env.BAILIAN_BASE_URL;
|
||||
|
||||
const dir = mkdtempSync(join(tmpdir(), "bl-cred-bridge-"));
|
||||
process.env.BAILIAN_CONFIG_DIR = dir;
|
||||
@@ -31,6 +40,8 @@ async function inScenario(
|
||||
else process.env.DASHSCOPE_API_KEY = scenario.env.DASHSCOPE_API_KEY;
|
||||
if (scenario.env?.BAILIAN_WORKSPACE_ID === undefined) delete process.env.BAILIAN_WORKSPACE_ID;
|
||||
else process.env.BAILIAN_WORKSPACE_ID = scenario.env.BAILIAN_WORKSPACE_ID;
|
||||
if (scenario.env?.BAILIAN_BASE_URL === undefined) delete process.env.BAILIAN_BASE_URL;
|
||||
else process.env.BAILIAN_BASE_URL = scenario.env.BAILIAN_BASE_URL;
|
||||
|
||||
try {
|
||||
assert();
|
||||
@@ -38,6 +49,7 @@ async function inScenario(
|
||||
restore("BAILIAN_CONFIG_DIR", savedConfigDir);
|
||||
restore("DASHSCOPE_API_KEY", savedApiKey);
|
||||
restore("BAILIAN_WORKSPACE_ID", savedWorkspace);
|
||||
restore("BAILIAN_BASE_URL", savedBaseUrl);
|
||||
rmSync(dir, { recursive: true, force: true });
|
||||
}
|
||||
}
|
||||
@@ -51,7 +63,10 @@ test("bridge:env 已有值时不被 bl config 覆盖(最低优先级)", async ()
|
||||
await inScenario(
|
||||
{
|
||||
config: { api_key: "sk-from-config", workspace_id: "ws-from-config" },
|
||||
env: { DASHSCOPE_API_KEY: "sk-from-env", BAILIAN_WORKSPACE_ID: "ws-from-env" },
|
||||
env: {
|
||||
DASHSCOPE_API_KEY: "sk-from-env",
|
||||
BAILIAN_WORKSPACE_ID: "ws-from-env",
|
||||
},
|
||||
},
|
||||
() => {
|
||||
bridgeBailianCredentials();
|
||||
@@ -63,7 +78,10 @@ test("bridge:env 已有值时不被 bl config 覆盖(最低优先级)", async ()
|
||||
|
||||
test("bridge:env 缺失且 bl config 有值时填充", async () => {
|
||||
await inScenario(
|
||||
{ config: { api_key: "sk-from-config", workspace_id: "ws-from-config" }, env: {} },
|
||||
{
|
||||
config: { api_key: "sk-from-config", workspace_id: "ws-from-config" },
|
||||
env: {},
|
||||
},
|
||||
() => {
|
||||
bridgeBailianCredentials();
|
||||
expect(process.env.DASHSCOPE_API_KEY).toBe("sk-from-config");
|
||||
@@ -93,3 +111,39 @@ test("bridge:env 与 bl config 皆缺失时不抛错且不写入", async () => {
|
||||
expect(process.env.BAILIAN_WORKSPACE_ID).toBeUndefined();
|
||||
});
|
||||
});
|
||||
|
||||
test("bridge:agentstudio_base_url 兜底填入 BAILIAN_BASE_URL", async () => {
|
||||
await inScenario(
|
||||
{
|
||||
config: {
|
||||
api_key: "sk-from-config",
|
||||
agentstudio_base_url: "https://ws-x.cn-beijing.maas.aliyuncs.com/api/v1/agentstudio",
|
||||
},
|
||||
env: {},
|
||||
},
|
||||
() => {
|
||||
bridgeBailianCredentials();
|
||||
expect(process.env.BAILIAN_BASE_URL).toBe(
|
||||
"https://ws-x.cn-beijing.maas.aliyuncs.com/api/v1/agentstudio",
|
||||
);
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
test("bridge:env 已有 BAILIAN_BASE_URL 时不被 bl config 覆盖", async () => {
|
||||
await inScenario(
|
||||
{
|
||||
config: {
|
||||
api_key: "sk-from-config",
|
||||
agentstudio_base_url: "https://from-config.aliyuncs.com/api/v1/agentstudio",
|
||||
},
|
||||
env: {
|
||||
BAILIAN_BASE_URL: "https://from-env.aliyuncs.com/api/v1/agentstudio",
|
||||
},
|
||||
},
|
||||
() => {
|
||||
bridgeBailianCredentials();
|
||||
expect(process.env.BAILIAN_BASE_URL).toBe("https://from-env.aliyuncs.com/api/v1/agentstudio");
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
@@ -18,6 +18,7 @@ export type AuthPersistPatch = Pick<
|
||||
| "access_key_id"
|
||||
| "access_key_secret"
|
||||
| "base_url"
|
||||
| "agentstudio_base_url"
|
||||
| "console_site"
|
||||
| "console_region"
|
||||
| "console_switch_agent"
|
||||
|
||||
@@ -23,6 +23,13 @@ export interface ConfigFile {
|
||||
/** Alibaba Cloud OpenAPI AccessKey secret from `bl auth login --open-api`. */
|
||||
access_key_secret?: string;
|
||||
base_url?: string;
|
||||
/**
|
||||
* Bailian AgentStudio API base URL for `bl agent` commands, e.g.
|
||||
* `https://<workspace>.cn-beijing.maas.aliyuncs.com/api/v1/agentstudio`.
|
||||
* Distinct from `base_url` (the DashScope model API): the agent path bridges
|
||||
* this to the SDK's `BAILIAN_BASE_URL`, so a workspace_id is not required.
|
||||
*/
|
||||
agentstudio_base_url?: string;
|
||||
output?: "text" | "json";
|
||||
output_dir?: string;
|
||||
timeout?: number;
|
||||
@@ -78,6 +85,8 @@ export function parseConfigFile(raw: unknown): ConfigFile {
|
||||
)
|
||||
out.access_key_secret = obj.openapi_access_key_secret;
|
||||
if (typeof obj.base_url === "string" && isHttpUrl(obj.base_url)) out.base_url = obj.base_url;
|
||||
if (typeof obj.agentstudio_base_url === "string" && isHttpUrl(obj.agentstudio_base_url))
|
||||
out.agentstudio_base_url = obj.agentstudio_base_url;
|
||||
if (typeof obj.output === "string" && VALID_OUTPUTS.has(obj.output))
|
||||
out.output = obj.output as ConfigFile["output"];
|
||||
if (typeof obj.output_dir === "string" && obj.output_dir.length > 0)
|
||||
|
||||
@@ -48,8 +48,8 @@ Index: [index.md](index.md)
|
||||
|
||||
#### Notes
|
||||
|
||||
- Credentials come from the env vars referenced in agents.yaml (e.g. ${DASHSCOPE_API_KEY}, ${BAILIAN_WORKSPACE_ID}).
|
||||
- For the bailian provider, bl fills these from your login as a fallback: `bl auth login` (API key) and `bl config set workspace_id <id>`.
|
||||
- Credentials come from the env vars referenced in agents.yaml (e.g. ${DASHSCOPE_API_KEY}, ${BAILIAN_BASE_URL}).
|
||||
- For the bailian provider, bl fills these from your login as a fallback: `bl auth login --api-key <key> --agentstudio-base-url <url>`.
|
||||
|
||||
#### Examples
|
||||
|
||||
@@ -79,8 +79,8 @@ bl agent apply --provider bailian --yes
|
||||
|
||||
#### Notes
|
||||
|
||||
- Credentials come from the env vars referenced in agents.yaml (e.g. ${DASHSCOPE_API_KEY}, ${BAILIAN_WORKSPACE_ID}).
|
||||
- For the bailian provider, bl fills these from your login as a fallback: `bl auth login` (API key) and `bl config set workspace_id <id>`.
|
||||
- Credentials come from the env vars referenced in agents.yaml (e.g. ${DASHSCOPE_API_KEY}, ${BAILIAN_BASE_URL}).
|
||||
- For the bailian provider, bl fills these from your login as a fallback: `bl auth login --api-key <key> --agentstudio-base-url <url>`.
|
||||
|
||||
#### Examples
|
||||
|
||||
@@ -142,8 +142,8 @@ bl agent init --provider all
|
||||
|
||||
#### Notes
|
||||
|
||||
- Credentials come from the env vars referenced in agents.yaml (e.g. ${DASHSCOPE_API_KEY}, ${BAILIAN_WORKSPACE_ID}).
|
||||
- For the bailian provider, bl fills these from your login as a fallback: `bl auth login` (API key) and `bl config set workspace_id <id>`.
|
||||
- Credentials come from the env vars referenced in agents.yaml (e.g. ${DASHSCOPE_API_KEY}, ${BAILIAN_BASE_URL}).
|
||||
- For the bailian provider, bl fills these from your login as a fallback: `bl auth login --api-key <key> --agentstudio-base-url <url>`.
|
||||
|
||||
#### Examples
|
||||
|
||||
@@ -181,8 +181,8 @@ bl agent plan --no-refresh
|
||||
|
||||
#### Notes
|
||||
|
||||
- Credentials come from the env vars referenced in agents.yaml (e.g. ${DASHSCOPE_API_KEY}, ${BAILIAN_WORKSPACE_ID}).
|
||||
- For the bailian provider, bl fills these from your login as a fallback: `bl auth login` (API key) and `bl config set workspace_id <id>`.
|
||||
- Credentials come from the env vars referenced in agents.yaml (e.g. ${DASHSCOPE_API_KEY}, ${BAILIAN_BASE_URL}).
|
||||
- For the bailian provider, bl fills these from your login as a fallback: `bl auth login --api-key <key> --agentstudio-base-url <url>`.
|
||||
|
||||
#### Examples
|
||||
|
||||
@@ -216,8 +216,8 @@ bl agent session create --agent assistant --title 'debug run'
|
||||
|
||||
#### Notes
|
||||
|
||||
- Credentials come from the env vars referenced in agents.yaml (e.g. ${DASHSCOPE_API_KEY}, ${BAILIAN_WORKSPACE_ID}).
|
||||
- For the bailian provider, bl fills these from your login as a fallback: `bl auth login` (API key) and `bl config set workspace_id <id>`.
|
||||
- Credentials come from the env vars referenced in agents.yaml (e.g. ${DASHSCOPE_API_KEY}, ${BAILIAN_BASE_URL}).
|
||||
- For the bailian provider, bl fills these from your login as a fallback: `bl auth login --api-key <key> --agentstudio-base-url <url>`.
|
||||
|
||||
#### Examples
|
||||
|
||||
@@ -245,8 +245,8 @@ bl agent session delete --session-id sess_abc123
|
||||
|
||||
#### Notes
|
||||
|
||||
- Credentials come from the env vars referenced in agents.yaml (e.g. ${DASHSCOPE_API_KEY}, ${BAILIAN_WORKSPACE_ID}).
|
||||
- For the bailian provider, bl fills these from your login as a fallback: `bl auth login` (API key) and `bl config set workspace_id <id>`.
|
||||
- Credentials come from the env vars referenced in agents.yaml (e.g. ${DASHSCOPE_API_KEY}, ${BAILIAN_BASE_URL}).
|
||||
- For the bailian provider, bl fills these from your login as a fallback: `bl auth login --api-key <key> --agentstudio-base-url <url>`.
|
||||
|
||||
#### Examples
|
||||
|
||||
@@ -276,8 +276,8 @@ bl agent session events --session-id sess_abc123 --all
|
||||
|
||||
#### Notes
|
||||
|
||||
- Credentials come from the env vars referenced in agents.yaml (e.g. ${DASHSCOPE_API_KEY}, ${BAILIAN_WORKSPACE_ID}).
|
||||
- For the bailian provider, bl fills these from your login as a fallback: `bl auth login` (API key) and `bl config set workspace_id <id>`.
|
||||
- Credentials come from the env vars referenced in agents.yaml (e.g. ${DASHSCOPE_API_KEY}, ${BAILIAN_BASE_URL}).
|
||||
- For the bailian provider, bl fills these from your login as a fallback: `bl auth login --api-key <key> --agentstudio-base-url <url>`.
|
||||
|
||||
#### Examples
|
||||
|
||||
@@ -304,8 +304,8 @@ bl agent session get --session-id sess_abc123
|
||||
|
||||
#### Notes
|
||||
|
||||
- Credentials come from the env vars referenced in agents.yaml (e.g. ${DASHSCOPE_API_KEY}, ${BAILIAN_WORKSPACE_ID}).
|
||||
- For the bailian provider, bl fills these from your login as a fallback: `bl auth login` (API key) and `bl config set workspace_id <id>`.
|
||||
- Credentials come from the env vars referenced in agents.yaml (e.g. ${DASHSCOPE_API_KEY}, ${BAILIAN_BASE_URL}).
|
||||
- For the bailian provider, bl fills these from your login as a fallback: `bl auth login --api-key <key> --agentstudio-base-url <url>`.
|
||||
|
||||
#### Examples
|
||||
|
||||
@@ -345,8 +345,8 @@ bl agent session list --all
|
||||
|
||||
#### Notes
|
||||
|
||||
- Credentials come from the env vars referenced in agents.yaml (e.g. ${DASHSCOPE_API_KEY}, ${BAILIAN_WORKSPACE_ID}).
|
||||
- For the bailian provider, bl fills these from your login as a fallback: `bl auth login` (API key) and `bl config set workspace_id <id>`.
|
||||
- Credentials come from the env vars referenced in agents.yaml (e.g. ${DASHSCOPE_API_KEY}, ${BAILIAN_BASE_URL}).
|
||||
- For the bailian provider, bl fills these from your login as a fallback: `bl auth login --api-key <key> --agentstudio-base-url <url>`.
|
||||
|
||||
#### Examples
|
||||
|
||||
@@ -378,8 +378,8 @@ bl agent session run --agent assistant --prompt "summarize this repo"
|
||||
|
||||
#### Notes
|
||||
|
||||
- Credentials come from the env vars referenced in agents.yaml (e.g. ${DASHSCOPE_API_KEY}, ${BAILIAN_WORKSPACE_ID}).
|
||||
- For the bailian provider, bl fills these from your login as a fallback: `bl auth login` (API key) and `bl config set workspace_id <id>`.
|
||||
- Credentials come from the env vars referenced in agents.yaml (e.g. ${DASHSCOPE_API_KEY}, ${BAILIAN_BASE_URL}).
|
||||
- For the bailian provider, bl fills these from your login as a fallback: `bl auth login --api-key <key> --agentstudio-base-url <url>`.
|
||||
|
||||
#### Examples
|
||||
|
||||
@@ -406,8 +406,8 @@ bl agent session send --session-id sess_abc123 --message "continue"
|
||||
|
||||
#### Notes
|
||||
|
||||
- Credentials come from the env vars referenced in agents.yaml (e.g. ${DASHSCOPE_API_KEY}, ${BAILIAN_WORKSPACE_ID}).
|
||||
- For the bailian provider, bl fills these from your login as a fallback: `bl auth login` (API key) and `bl config set workspace_id <id>`.
|
||||
- Credentials come from the env vars referenced in agents.yaml (e.g. ${DASHSCOPE_API_KEY}, ${BAILIAN_BASE_URL}).
|
||||
- For the bailian provider, bl fills these from your login as a fallback: `bl auth login --api-key <key> --agentstudio-base-url <url>`.
|
||||
|
||||
#### Examples
|
||||
|
||||
@@ -431,8 +431,8 @@ bl agent state import --address bailian.agent.assistant --remote-id agent-abc123
|
||||
|
||||
#### Notes
|
||||
|
||||
- Credentials come from the env vars referenced in agents.yaml (e.g. ${DASHSCOPE_API_KEY}, ${BAILIAN_WORKSPACE_ID}).
|
||||
- For the bailian provider, bl fills these from your login as a fallback: `bl auth login` (API key) and `bl config set workspace_id <id>`.
|
||||
- Credentials come from the env vars referenced in agents.yaml (e.g. ${DASHSCOPE_API_KEY}, ${BAILIAN_BASE_URL}).
|
||||
- For the bailian provider, bl fills these from your login as a fallback: `bl auth login --api-key <key> --agentstudio-base-url <url>`.
|
||||
|
||||
#### Examples
|
||||
|
||||
@@ -461,8 +461,8 @@ bl agent state list --file agents.yaml
|
||||
|
||||
#### Notes
|
||||
|
||||
- Credentials come from the env vars referenced in agents.yaml (e.g. ${DASHSCOPE_API_KEY}, ${BAILIAN_WORKSPACE_ID}).
|
||||
- For the bailian provider, bl fills these from your login as a fallback: `bl auth login` (API key) and `bl config set workspace_id <id>`.
|
||||
- Credentials come from the env vars referenced in agents.yaml (e.g. ${DASHSCOPE_API_KEY}, ${BAILIAN_BASE_URL}).
|
||||
- For the bailian provider, bl fills these from your login as a fallback: `bl auth login --api-key <key> --agentstudio-base-url <url>`.
|
||||
|
||||
#### Examples
|
||||
|
||||
@@ -487,8 +487,8 @@ bl agent state rm --address bailian.agent.assistant
|
||||
|
||||
#### Notes
|
||||
|
||||
- Credentials come from the env vars referenced in agents.yaml (e.g. ${DASHSCOPE_API_KEY}, ${BAILIAN_WORKSPACE_ID}).
|
||||
- For the bailian provider, bl fills these from your login as a fallback: `bl auth login` (API key) and `bl config set workspace_id <id>`.
|
||||
- Credentials come from the env vars referenced in agents.yaml (e.g. ${DASHSCOPE_API_KEY}, ${BAILIAN_BASE_URL}).
|
||||
- For the bailian provider, bl fills these from your login as a fallback: `bl auth login --api-key <key> --agentstudio-base-url <url>`.
|
||||
|
||||
#### Examples
|
||||
|
||||
@@ -512,8 +512,8 @@ bl agent state show --address bailian.agent.assistant
|
||||
|
||||
#### Notes
|
||||
|
||||
- Credentials come from the env vars referenced in agents.yaml (e.g. ${DASHSCOPE_API_KEY}, ${BAILIAN_WORKSPACE_ID}).
|
||||
- For the bailian provider, bl fills these from your login as a fallback: `bl auth login` (API key) and `bl config set workspace_id <id>`.
|
||||
- Credentials come from the env vars referenced in agents.yaml (e.g. ${DASHSCOPE_API_KEY}, ${BAILIAN_BASE_URL}).
|
||||
- For the bailian provider, bl fills these from your login as a fallback: `bl auth login --api-key <key> --agentstudio-base-url <url>`.
|
||||
|
||||
#### Examples
|
||||
|
||||
|
||||
@@ -25,15 +25,16 @@ Index: [index.md](index.md)
|
||||
|
||||
#### Flags
|
||||
|
||||
| Flag | Type | Required | Description |
|
||||
| ------------------------------ | ------ | -------- | ------------------------------------------------------------------------------------- |
|
||||
| `--api-key <key>` | string | no | DashScope API key to store |
|
||||
| `--base-url <url>` | string | no | DashScope API base URL (used with --api-key for validation) |
|
||||
| `--console` | switch | no | Sign in via browser; use --console-site to choose domestic (default) or international |
|
||||
| `--console-site <site>` | string | no | Console site: domestic, international |
|
||||
| `--open-api` | switch | no | Store Alibaba Cloud OpenAPI AK/SK credentials |
|
||||
| `--access-key-id <id>` | string | no | Alibaba Cloud Access Key ID to store |
|
||||
| `--access-key-secret <secret>` | string | no | Alibaba Cloud Access Key Secret to store |
|
||||
| Flag | Type | Required | Description |
|
||||
| ------------------------------ | ------ | -------- | ------------------------------------------------------------------------------------------------- |
|
||||
| `--api-key <key>` | string | no | DashScope API key to store |
|
||||
| `--base-url <url>` | string | no | DashScope API base URL (used with --api-key for validation) |
|
||||
| `--agentstudio-base-url <url>` | string | no | Bailian AgentStudio base URL for `bl agent` commands (sets BAILIAN_BASE_URL; used with --api-key) |
|
||||
| `--console` | switch | no | Sign in via browser; use --console-site to choose domestic (default) or international |
|
||||
| `--console-site <site>` | string | no | Console site: domestic, international |
|
||||
| `--open-api` | switch | no | Store Alibaba Cloud OpenAPI AK/SK credentials |
|
||||
| `--access-key-id <id>` | string | no | Alibaba Cloud Access Key ID to store |
|
||||
| `--access-key-secret <secret>` | string | no | Alibaba Cloud Access Key Secret to store |
|
||||
|
||||
#### Examples
|
||||
|
||||
|
||||
@@ -24,10 +24,10 @@ Index: [index.md](index.md)
|
||||
|
||||
#### Flags
|
||||
|
||||
| Flag | Type | Required | Description |
|
||||
| ----------------- | ------ | -------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `--key <key>` | string | yes | Config key (base*url, output, output_dir, timeout, api_key, access_token, access_key_id, access_key_secret, default*\*\_model, workspace_id) |
|
||||
| `--value <value>` | string | yes | Value to set |
|
||||
| Flag | Type | Required | Description |
|
||||
| ----------------- | ------ | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| `--key <key>` | string | yes | Config key (base*url, output, output_dir, timeout, api_key, access_token, access_key_id, access_key_secret, default*\*\_model, workspace_id, agentstudio_base_url) |
|
||||
| `--value <value>` | string | yes | Value to set |
|
||||
|
||||
#### Examples
|
||||
|
||||
|
||||
Reference in New Issue
Block a user