From 1c9dac24e975a3a6e9606c80036514eb61986194 Mon Sep 17 00:00:00 2001 From: chenanran555 Date: Wed, 22 Jul 2026 14:20:24 +0800 Subject: [PATCH] =?UTF-8?q?feat(cma):=20login=E6=97=B6=E5=88=9D=E5=A7=8B?= =?UTF-8?q?=E5=8C=96agent=E7=9B=B8=E5=85=B3=E7=9A=84baseUrl?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/commands/agent/_engine/credentials.ts | 16 +++-- packages/commands/src/commands/agent/init.ts | 4 +- packages/commands/src/commands/auth/login.ts | 18 ++++- packages/commands/src/commands/config/set.ts | 15 +++- .../commands/tests/credentials-bridge.test.ts | 68 +++++++++++++++++-- packages/core/src/auth/store.ts | 1 + packages/core/src/config/schema.ts | 9 +++ skills/bailian-cli/reference/agent.md | 60 ++++++++-------- skills/bailian-cli/reference/auth.md | 19 +++--- skills/bailian-cli/reference/config.md | 8 +-- 10 files changed, 156 insertions(+), 62 deletions(-) diff --git a/packages/commands/src/commands/agent/_engine/credentials.ts b/packages/commands/src/commands/agent/_engine/credentials.ts index 1c1cc63..92fb203 100644 --- a/packages/commands/src/commands/agent/_engine/credentials.ts +++ b/packages/commands/src/commands/agent/_engine/credentials.ts @@ -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 `.", + "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 --agentstudio-base-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; } diff --git a/packages/commands/src/commands/agent/init.ts b/packages/commands/src/commands/agent/init.ts index 467caee..78ee8d4 100644 --- a/packages/commands/src/commands/agent/init.ts +++ b/packages/commands/src/commands/agent/init.ts @@ -18,7 +18,7 @@ agents.state.json const PROVIDERS = ["bailian", "claude", "qoder", "ark", "all"] as const; const PROVIDER_BLOCKS: Record = { - bailian: ` bailian:\n # bl auth login sets DASHSCOPE_API_KEY; bl config set workspace_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 sets DASHSCOPE_API_KEY; --agentstudio-base-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 `, or set DASHSCOPE_API_KEY / BAILIAN_WORKSPACE_ID.", + "Credentials: run `bl auth login --api-key --agentstudio-base-url `, or set DASHSCOPE_API_KEY / BAILIAN_BASE_URL.", ); } emitBare("Next: edit agents.yaml, then run `bl agent plan`."); diff --git a/packages/commands/src/commands/auth/login.ts b/packages/commands/src/commands/auth/login.ts index ebf9ac9..3e6e1cd 100644 --- a/packages/commands/src/commands/auth/login.ts +++ b/packages/commands/src/commands/auth/login.ts @@ -19,12 +19,22 @@ export default defineCommand({ usageArgs: "--api-key | --console | --open-api --access-key-id --access-key-secret ", flags: { - apiKey: { type: "string", valueHint: "", description: "DashScope API key to store" }, + apiKey: { + type: "string", + valueHint: "", + description: "DashScope API key to store", + }, baseUrl: { type: "string", valueHint: "", description: "DashScope API base URL (used with --api-key for validation)", }, + agentstudioBaseUrl: { + type: "string", + valueHint: "", + 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()); }, }); diff --git a/packages/commands/src/commands/config/set.ts b/packages/commands/src/commands/config/set.ts index 99b3e83..7a3cd81 100644 --- a/packages/commands/src/commands/config/set.ts +++ b/packages/commands/src/commands/config/set.ts @@ -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 = { "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: "", 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: "", + description: "Value to set", required: true, }, - value: { type: "string", valueHint: "", 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); + await ctx.configStore.write({ + [resolvedKey]: coerced, + } as Partial); if (!settings.quiet) { const shown = SECRET_KEYS.has(resolvedKey) ? maskToken(String(coerced)) : coerced; diff --git a/packages/commands/tests/credentials-bridge.test.ts b/packages/commands/tests/credentials-bridge.test.ts index 9e18f14..46f35ca 100644 --- a/packages/commands/tests/credentials-bridge.test.ts +++ b/packages/commands/tests/credentials-bridge.test.ts @@ -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 { 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"); + }, + ); +}); diff --git a/packages/core/src/auth/store.ts b/packages/core/src/auth/store.ts index 45600e4..9497061 100644 --- a/packages/core/src/auth/store.ts +++ b/packages/core/src/auth/store.ts @@ -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" diff --git a/packages/core/src/config/schema.ts b/packages/core/src/config/schema.ts index b76b931..3c30e41 100644 --- a/packages/core/src/config/schema.ts +++ b/packages/core/src/config/schema.ts @@ -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://.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) diff --git a/skills/bailian-cli/reference/agent.md b/skills/bailian-cli/reference/agent.md index 01df0f7..bd73e5d 100644 --- a/skills/bailian-cli/reference/agent.md +++ b/skills/bailian-cli/reference/agent.md @@ -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 `. +- 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 --agentstudio-base-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 `. +- 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 --agentstudio-base-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 `. +- 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 --agentstudio-base-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 `. +- 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 --agentstudio-base-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 `. +- 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 --agentstudio-base-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 `. +- 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 --agentstudio-base-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 `. +- 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 --agentstudio-base-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 `. +- 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 --agentstudio-base-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 `. +- 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 --agentstudio-base-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 `. +- 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 --agentstudio-base-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 `. +- 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 --agentstudio-base-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 `. +- 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 --agentstudio-base-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 `. +- 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 --agentstudio-base-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 `. +- 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 --agentstudio-base-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 `. +- 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 --agentstudio-base-url `. #### Examples diff --git a/skills/bailian-cli/reference/auth.md b/skills/bailian-cli/reference/auth.md index eda1496..2da50b9 100644 --- a/skills/bailian-cli/reference/auth.md +++ b/skills/bailian-cli/reference/auth.md @@ -25,15 +25,16 @@ Index: [index.md](index.md) #### Flags -| Flag | Type | Required | Description | -| ------------------------------ | ------ | -------- | ------------------------------------------------------------------------------------- | -| `--api-key ` | string | no | DashScope API key to store | -| `--base-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 ` | string | no | Console site: domestic, international | -| `--open-api` | switch | no | Store Alibaba Cloud OpenAPI AK/SK credentials | -| `--access-key-id ` | string | no | Alibaba Cloud Access Key ID to store | -| `--access-key-secret ` | string | no | Alibaba Cloud Access Key Secret to store | +| Flag | Type | Required | Description | +| ------------------------------ | ------ | -------- | ------------------------------------------------------------------------------------------------- | +| `--api-key ` | string | no | DashScope API key to store | +| `--base-url ` | string | no | DashScope API base URL (used with --api-key for validation) | +| `--agentstudio-base-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 ` | string | no | Console site: domestic, international | +| `--open-api` | switch | no | Store Alibaba Cloud OpenAPI AK/SK credentials | +| `--access-key-id ` | string | no | Alibaba Cloud Access Key ID to store | +| `--access-key-secret ` | string | no | Alibaba Cloud Access Key Secret to store | #### Examples diff --git a/skills/bailian-cli/reference/config.md b/skills/bailian-cli/reference/config.md index eb03de2..a08f0d2 100644 --- a/skills/bailian-cli/reference/config.md +++ b/skills/bailian-cli/reference/config.md @@ -24,10 +24,10 @@ Index: [index.md](index.md) #### Flags -| Flag | Type | Required | Description | -| ----------------- | ------ | -------- | -------------------------------------------------------------------------------------------------------------------------------------------- | -| `--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 ` | string | yes | Value to set | +| Flag | Type | Required | Description | +| ----------------- | ------ | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `--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 ` | string | yes | Value to set | #### Examples