mirror of
https://github.com/modelstudioai/cli.git
synced 2026-09-14 19:49:23 +08:00
docs: add console gateway flags convention to AGENTS.md and command help
Add console global flags (--console-region, --console-site, --console-switch-agent) to the options of all 12 commands that depend on callConsoleGateway, so they appear in --help output. Document this as convention #4 in AGENTS.md for future commands. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -93,6 +93,18 @@ CLI 只为「自己能权威解释的错误」发出语义化信号,服务端的
|
||||
|
||||
不要扮演服务端错误的翻译官——我们没有最新的错误码体系认知,二次包装只会撒谎(详见 `docs/agents/error-hint-change.md` 中的反面 case)。
|
||||
|
||||
### 4. Console Gateway 命令必须声明 console 全局 flags
|
||||
|
||||
如果新命令使用了 `callConsoleGateway`,必须在 `options` 中添加以下三个全局 flag 的说明,以便 `--help` 中展示:
|
||||
|
||||
```ts
|
||||
{ flag: "--console-region <region>", description: "Console region (global flag)" },
|
||||
{ flag: "--console-site <site>", description: "Console site: domestic, international (global flag)" },
|
||||
{ flag: "--console-switch-agent <uid>", description: "Switch agent UID (global flag)", type: "number" },
|
||||
```
|
||||
|
||||
这些 flag 已在 `GLOBAL_OPTIONS`(`packages/core/src/types/command.ts`)中注册,由 `loadConfig` 写入 `config.consoleRegion` / `config.consoleSite` / `config.consoleSwitchAgent`,`callConsoleGateway` 自动读取——命令无需手动提取或传递。
|
||||
|
||||
## 完成改动后的快速验证
|
||||
|
||||
```sh
|
||||
|
||||
@@ -29,6 +29,16 @@ export default defineCommand({
|
||||
description: "Results per page (default: 30)",
|
||||
type: "number",
|
||||
},
|
||||
{ flag: "--console-region <region>", description: "Console region (global flag)" },
|
||||
{
|
||||
flag: "--console-site <site>",
|
||||
description: "Console site: domestic, international (global flag)",
|
||||
},
|
||||
{
|
||||
flag: "--console-switch-agent <uid>",
|
||||
description: "Switch agent UID (global flag)",
|
||||
type: "number",
|
||||
},
|
||||
],
|
||||
examples: [
|
||||
"bl app list",
|
||||
|
||||
@@ -142,6 +142,18 @@ export default defineCommand({
|
||||
name: "auth status",
|
||||
description: "Show current authentication state",
|
||||
usage: "bl auth status",
|
||||
options: [
|
||||
{ flag: "--console-region <region>", description: "Console region (global flag)" },
|
||||
{
|
||||
flag: "--console-site <site>",
|
||||
description: "Console site: domestic, international (global flag)",
|
||||
},
|
||||
{
|
||||
flag: "--console-switch-agent <uid>",
|
||||
description: "Switch agent UID (global flag)",
|
||||
type: "number",
|
||||
},
|
||||
],
|
||||
examples: ["bl auth status", "bl auth status --output json"],
|
||||
async run(config: Config, _flags: GlobalFlags) {
|
||||
const format = detectOutputFormat(config.output);
|
||||
|
||||
@@ -27,6 +27,16 @@ export default defineCommand({
|
||||
description: "Request data as JSON string",
|
||||
required: true,
|
||||
},
|
||||
{ flag: "--console-region <region>", description: "Console region (global flag)" },
|
||||
{
|
||||
flag: "--console-site <site>",
|
||||
description: "Console site: domestic, international (global flag)",
|
||||
},
|
||||
{
|
||||
flag: "--console-switch-agent <uid>",
|
||||
description: "Switch agent UID (global flag)",
|
||||
type: "number",
|
||||
},
|
||||
],
|
||||
examples: [
|
||||
`bl console call --api zeldaEasy.broadscope-bailian.freeTrial.queryFreeTierQuota --data '{"queryFreeTierQuotaRequest":{"models":["qwen3-max"]}}'`,
|
||||
|
||||
@@ -36,6 +36,16 @@ export default defineCommand({
|
||||
},
|
||||
{ flag: "--page <n>", description: "Page number (default: 1)", type: "number" },
|
||||
{ flag: "--page-size <n>", description: "Results per page (default: 30)", type: "number" },
|
||||
{ flag: "--console-region <region>", description: "Console region (global flag)" },
|
||||
{
|
||||
flag: "--console-site <site>",
|
||||
description: "Console site: domestic, international (global flag)",
|
||||
},
|
||||
{
|
||||
flag: "--console-switch-agent <uid>",
|
||||
description: "Switch agent UID (global flag)",
|
||||
type: "number",
|
||||
},
|
||||
],
|
||||
examples: ["bl mcp list", "bl mcp list --name 金融", "bl mcp list --output json"],
|
||||
async run(config: Config, flags: GlobalFlags) {
|
||||
|
||||
@@ -254,6 +254,16 @@ export default defineCommand({
|
||||
flag: "--period <minutes>",
|
||||
description: "Query usage for the last N minutes (default: 2)",
|
||||
},
|
||||
{ flag: "--console-region <region>", description: "Console region (global flag)" },
|
||||
{
|
||||
flag: "--console-site <site>",
|
||||
description: "Console site: domestic, international (global flag)",
|
||||
},
|
||||
{
|
||||
flag: "--console-switch-agent <uid>",
|
||||
description: "Switch agent UID (global flag)",
|
||||
type: "number",
|
||||
},
|
||||
],
|
||||
examples: [
|
||||
"bl quota check",
|
||||
|
||||
@@ -114,6 +114,16 @@ export default defineCommand({
|
||||
flag: "--model <model>",
|
||||
description: "Filter by model name",
|
||||
},
|
||||
{ flag: "--console-region <region>", description: "Console region (global flag)" },
|
||||
{
|
||||
flag: "--console-site <site>",
|
||||
description: "Console site: domestic, international (global flag)",
|
||||
},
|
||||
{
|
||||
flag: "--console-switch-agent <uid>",
|
||||
description: "Switch agent UID (global flag)",
|
||||
type: "number",
|
||||
},
|
||||
],
|
||||
examples: [
|
||||
"bl quota history",
|
||||
|
||||
@@ -169,6 +169,16 @@ export default defineCommand({
|
||||
flag: "--all",
|
||||
description: "Show all models, not just self-service ones",
|
||||
},
|
||||
{ flag: "--console-region <region>", description: "Console region (global flag)" },
|
||||
{
|
||||
flag: "--console-site <site>",
|
||||
description: "Console site: domestic, international (global flag)",
|
||||
},
|
||||
{
|
||||
flag: "--console-switch-agent <uid>",
|
||||
description: "Switch agent UID (global flag)",
|
||||
type: "number",
|
||||
},
|
||||
],
|
||||
examples: [
|
||||
"bl quota list",
|
||||
|
||||
@@ -96,6 +96,16 @@ export default defineCommand({
|
||||
flag: "--yes",
|
||||
description: "Skip downgrade confirmation",
|
||||
},
|
||||
{ flag: "--console-region <region>", description: "Console region (global flag)" },
|
||||
{
|
||||
flag: "--console-site <site>",
|
||||
description: "Console site: domestic, international (global flag)",
|
||||
},
|
||||
{
|
||||
flag: "--console-switch-agent <uid>",
|
||||
description: "Switch agent UID (global flag)",
|
||||
type: "number",
|
||||
},
|
||||
],
|
||||
examples: [
|
||||
"bl quota request --model qwen-turbo --tpm 100000",
|
||||
|
||||
@@ -207,6 +207,16 @@ export default defineCommand({
|
||||
flag: "--sort <field>",
|
||||
description: "Sort by: remaining (ascending), expires (ascending)",
|
||||
},
|
||||
{ flag: "--console-region <region>", description: "Console region (global flag)" },
|
||||
{
|
||||
flag: "--console-site <site>",
|
||||
description: "Console site: domestic, international (global flag)",
|
||||
},
|
||||
{
|
||||
flag: "--console-switch-agent <uid>",
|
||||
description: "Switch agent UID (global flag)",
|
||||
type: "number",
|
||||
},
|
||||
],
|
||||
examples: [
|
||||
"bl usage free",
|
||||
|
||||
@@ -121,6 +121,16 @@ export default defineCommand({
|
||||
flag: "--off",
|
||||
description: "Disable auto-stop",
|
||||
},
|
||||
{ flag: "--console-region <region>", description: "Console region (global flag)" },
|
||||
{
|
||||
flag: "--console-site <site>",
|
||||
description: "Console site: domestic, international (global flag)",
|
||||
},
|
||||
{
|
||||
flag: "--console-switch-agent <uid>",
|
||||
description: "Switch agent UID (global flag)",
|
||||
type: "number",
|
||||
},
|
||||
],
|
||||
examples: [
|
||||
"bl usage freetier --model qwen3-max",
|
||||
|
||||
@@ -323,6 +323,16 @@ export default defineCommand({
|
||||
flag: "--workspace-id <id>",
|
||||
description: "Workspace ID (env: BAILIAN_WORKSPACE_ID)",
|
||||
},
|
||||
{ flag: "--console-region <region>", description: "Console region (global flag)" },
|
||||
{
|
||||
flag: "--console-site <site>",
|
||||
description: "Console site: domestic, international (global flag)",
|
||||
},
|
||||
{
|
||||
flag: "--console-switch-agent <uid>",
|
||||
description: "Switch agent UID (global flag)",
|
||||
type: "number",
|
||||
},
|
||||
],
|
||||
examples: [
|
||||
"bl usage stats",
|
||||
|
||||
@@ -93,6 +93,16 @@ export default defineCommand({
|
||||
flag: "--list <n>",
|
||||
description: "Limit number of results",
|
||||
},
|
||||
{ flag: "--console-region <region>", description: "Console region (global flag)" },
|
||||
{
|
||||
flag: "--console-site <site>",
|
||||
description: "Console site: domestic, international (global flag)",
|
||||
},
|
||||
{
|
||||
flag: "--console-switch-agent <uid>",
|
||||
description: "Switch agent UID (global flag)",
|
||||
type: "number",
|
||||
},
|
||||
],
|
||||
examples: ["bl workspace list", "bl workspace list --list 5", "bl workspace list --output json"],
|
||||
async run(config: Config, flags: GlobalFlags) {
|
||||
|
||||
@@ -73,11 +73,14 @@ bl app call --app-id abc123 --prompt "开始" --biz-params '{"key":"value"}'
|
||||
|
||||
#### Options
|
||||
|
||||
| Flag | Type | Required | Description |
|
||||
| ----------------- | ------ | -------- | ----------------------------------- |
|
||||
| `--name <name>` | string | no | Filter by app name (keyword search) |
|
||||
| `--page <n>` | number | no | Page number (default: 1) |
|
||||
| `--page-size <n>` | number | no | Results per page (default: 30) |
|
||||
| Flag | Type | Required | Description |
|
||||
| ------------------------------ | ------ | -------- | --------------------------------------------------- |
|
||||
| `--name <name>` | string | no | Filter by app name (keyword search) |
|
||||
| `--page <n>` | number | no | Page number (default: 1) |
|
||||
| `--page-size <n>` | number | no | Results per page (default: 30) |
|
||||
| `--console-region <region>` | string | no | Console region (global flag) |
|
||||
| `--console-site <site>` | string | no | Console site: domestic, international (global flag) |
|
||||
| `--console-switch-agent <uid>` | number | no | Switch agent UID (global flag) |
|
||||
|
||||
#### Examples
|
||||
|
||||
|
||||
@@ -84,7 +84,11 @@ bl auth logout --yes
|
||||
|
||||
#### Options
|
||||
|
||||
_No command-specific options._
|
||||
| Flag | Type | Required | Description |
|
||||
| ------------------------------ | ------ | -------- | --------------------------------------------------- |
|
||||
| `--console-region <region>` | string | no | Console region (global flag) |
|
||||
| `--console-site <site>` | string | no | Console site: domestic, international (global flag) |
|
||||
| `--console-switch-agent <uid>` | number | no | Switch agent UID (global flag) |
|
||||
|
||||
#### Examples
|
||||
|
||||
|
||||
@@ -23,10 +23,13 @@ Index: [index.md](index.md)
|
||||
|
||||
#### Options
|
||||
|
||||
| Flag | Type | Required | Description |
|
||||
| --------------- | ------ | -------- | ------------------------------------------------------------------------ |
|
||||
| `--api <api>` | string | yes | API name (e.g. zeldaEasy.broadscope-bailian.memory-library.getLibraries) |
|
||||
| `--data <json>` | string | yes | Request data as JSON string |
|
||||
| Flag | Type | Required | Description |
|
||||
| ------------------------------ | ------ | -------- | ------------------------------------------------------------------------ |
|
||||
| `--api <api>` | string | yes | API name (e.g. zeldaEasy.broadscope-bailian.memory-library.getLibraries) |
|
||||
| `--data <json>` | string | yes | Request data as JSON string |
|
||||
| `--console-region <region>` | string | no | Console region (global flag) |
|
||||
| `--console-site <site>` | string | no | Console site: domestic, international (global flag) |
|
||||
| `--console-switch-agent <uid>` | number | no | Switch agent UID (global flag) |
|
||||
|
||||
#### Examples
|
||||
|
||||
|
||||
@@ -57,12 +57,15 @@ bl mcp call market-cmapi00073529.SmartFundSelection --arg riskLevel=R3 --arg min
|
||||
|
||||
#### Options
|
||||
|
||||
| Flag | Type | Required | Description |
|
||||
| ----------------- | ------ | -------- | ---------------------------------------------------- |
|
||||
| `--name <text>` | string | no | Filter by server name (substring match) |
|
||||
| `--type <type>` | string | no | Server type: OFFICIAL \| PRIVATE (default: OFFICIAL) |
|
||||
| `--page <n>` | number | no | Page number (default: 1) |
|
||||
| `--page-size <n>` | number | no | Results per page (default: 30) |
|
||||
| Flag | Type | Required | Description |
|
||||
| ------------------------------ | ------ | -------- | ---------------------------------------------------- |
|
||||
| `--name <text>` | string | no | Filter by server name (substring match) |
|
||||
| `--type <type>` | string | no | Server type: OFFICIAL \| PRIVATE (default: OFFICIAL) |
|
||||
| `--page <n>` | number | no | Page number (default: 1) |
|
||||
| `--page-size <n>` | number | no | Results per page (default: 30) |
|
||||
| `--console-region <region>` | string | no | Console region (global flag) |
|
||||
| `--console-site <site>` | string | no | Console site: domestic, international (global flag) |
|
||||
| `--console-switch-agent <uid>` | number | no | Switch agent UID (global flag) |
|
||||
|
||||
#### Examples
|
||||
|
||||
|
||||
@@ -26,10 +26,13 @@ Index: [index.md](index.md)
|
||||
|
||||
#### Options
|
||||
|
||||
| Flag | Type | Required | Description |
|
||||
| -------------------- | ------ | -------- | ----------------------------------------------- |
|
||||
| `--model <model>` | string | no | Model name(s), comma-separated |
|
||||
| `--period <minutes>` | string | no | Query usage for the last N minutes (default: 2) |
|
||||
| Flag | Type | Required | Description |
|
||||
| ------------------------------ | ------ | -------- | --------------------------------------------------- |
|
||||
| `--model <model>` | string | no | Model name(s), comma-separated |
|
||||
| `--period <minutes>` | string | no | Query usage for the last N minutes (default: 2) |
|
||||
| `--console-region <region>` | string | no | Console region (global flag) |
|
||||
| `--console-site <site>` | string | no | Console site: domestic, international (global flag) |
|
||||
| `--console-switch-agent <uid>` | number | no | Switch agent UID (global flag) |
|
||||
|
||||
#### Examples
|
||||
|
||||
@@ -63,11 +66,14 @@ bl quota check --output json
|
||||
|
||||
#### Options
|
||||
|
||||
| Flag | Type | Required | Description |
|
||||
| ----------------- | ------ | -------- | ------------------------ |
|
||||
| `--page <n>` | string | no | Page number (default: 1) |
|
||||
| `--page-size <n>` | string | no | Page size (default: 10) |
|
||||
| `--model <model>` | string | no | Filter by model name |
|
||||
| Flag | Type | Required | Description |
|
||||
| ------------------------------ | ------ | -------- | --------------------------------------------------- |
|
||||
| `--page <n>` | string | no | Page number (default: 1) |
|
||||
| `--page-size <n>` | string | no | Page size (default: 10) |
|
||||
| `--model <model>` | string | no | Filter by model name |
|
||||
| `--console-region <region>` | string | no | Console region (global flag) |
|
||||
| `--console-site <site>` | string | no | Console site: domestic, international (global flag) |
|
||||
| `--console-switch-agent <uid>` | number | no | Switch agent UID (global flag) |
|
||||
|
||||
#### Examples
|
||||
|
||||
@@ -101,10 +107,13 @@ bl quota history --output json
|
||||
|
||||
#### Options
|
||||
|
||||
| Flag | Type | Required | Description |
|
||||
| ----------------- | ------- | -------- | ------------------------------------------- |
|
||||
| `--model <model>` | string | no | Model name(s), comma-separated |
|
||||
| `--all` | boolean | no | Show all models, not just self-service ones |
|
||||
| Flag | Type | Required | Description |
|
||||
| ------------------------------ | ------- | -------- | --------------------------------------------------- |
|
||||
| `--model <model>` | string | no | Model name(s), comma-separated |
|
||||
| `--all` | boolean | no | Show all models, not just self-service ones |
|
||||
| `--console-region <region>` | string | no | Console region (global flag) |
|
||||
| `--console-site <site>` | string | no | Console site: domestic, international (global flag) |
|
||||
| `--console-switch-agent <uid>` | number | no | Switch agent UID (global flag) |
|
||||
|
||||
#### Examples
|
||||
|
||||
@@ -138,11 +147,14 @@ bl quota list --output json
|
||||
|
||||
#### Options
|
||||
|
||||
| Flag | Type | Required | Description |
|
||||
| ----------------- | ------- | -------- | --------------------------- |
|
||||
| `--model <model>` | string | yes | Model name (required) |
|
||||
| `--tpm <value>` | string | yes | Target TPM value (required) |
|
||||
| `--yes` | boolean | no | Skip downgrade confirmation |
|
||||
| Flag | Type | Required | Description |
|
||||
| ------------------------------ | ------- | -------- | --------------------------------------------------- |
|
||||
| `--model <model>` | string | yes | Model name (required) |
|
||||
| `--tpm <value>` | string | yes | Target TPM value (required) |
|
||||
| `--yes` | boolean | no | Skip downgrade confirmation |
|
||||
| `--console-region <region>` | string | no | Console region (global flag) |
|
||||
| `--console-site <site>` | string | no | Console site: domestic, international (global flag) |
|
||||
| `--console-switch-agent <uid>` | number | no | Switch agent UID (global flag) |
|
||||
|
||||
#### Examples
|
||||
|
||||
|
||||
@@ -25,11 +25,14 @@ Index: [index.md](index.md)
|
||||
|
||||
#### Options
|
||||
|
||||
| Flag | Type | Required | Description |
|
||||
| ------------------- | ------ | -------- | ------------------------------------------------------------------------- |
|
||||
| `--model <model>` | string | no | Model name(s) to query, comma-separated for multiple; omit for all models |
|
||||
| `--expiring <days>` | string | no | Only show quotas expiring within N days |
|
||||
| `--sort <field>` | string | no | Sort by: remaining (ascending), expires (ascending) |
|
||||
| Flag | Type | Required | Description |
|
||||
| ------------------------------ | ------ | -------- | ------------------------------------------------------------------------- |
|
||||
| `--model <model>` | string | no | Model name(s) to query, comma-separated for multiple; omit for all models |
|
||||
| `--expiring <days>` | string | no | Only show quotas expiring within N days |
|
||||
| `--sort <field>` | string | no | Sort by: remaining (ascending), expires (ascending) |
|
||||
| `--console-region <region>` | string | no | Console region (global flag) |
|
||||
| `--console-site <site>` | string | no | Console site: domestic, international (global flag) |
|
||||
| `--console-switch-agent <uid>` | number | no | Switch agent UID (global flag) |
|
||||
|
||||
#### Examples
|
||||
|
||||
@@ -71,12 +74,15 @@ bl usage free --model qwen3-max --console-region cn-beijing
|
||||
|
||||
#### Options
|
||||
|
||||
| Flag | Type | Required | Description |
|
||||
| ----------------- | ------- | -------- | ------------------------------------------- |
|
||||
| `--model <model>` | string | no | Model name(s), comma-separated for multiple |
|
||||
| `--all` | boolean | no | Apply to all free-tier models |
|
||||
| `--on` | boolean | no | Enable auto-stop (default behavior) |
|
||||
| `--off` | boolean | no | Disable auto-stop |
|
||||
| Flag | Type | Required | Description |
|
||||
| ------------------------------ | ------- | -------- | --------------------------------------------------- |
|
||||
| `--model <model>` | string | no | Model name(s), comma-separated for multiple |
|
||||
| `--all` | boolean | no | Apply to all free-tier models |
|
||||
| `--on` | boolean | no | Enable auto-stop (default behavior) |
|
||||
| `--off` | boolean | no | Disable auto-stop |
|
||||
| `--console-region <region>` | string | no | Console region (global flag) |
|
||||
| `--console-site <site>` | string | no | Console site: domestic, international (global flag) |
|
||||
| `--console-switch-agent <uid>` | number | no | Switch agent UID (global flag) |
|
||||
|
||||
#### Examples
|
||||
|
||||
@@ -114,12 +120,15 @@ bl usage freetier --off --all
|
||||
|
||||
#### Options
|
||||
|
||||
| Flag | Type | Required | Description |
|
||||
| --------------------- | ------ | -------- | ------------------------------------------------------ |
|
||||
| `--model <model>` | string | no | Model name(s), comma-separated; omit for overview |
|
||||
| `--days <days>` | string | no | Number of days (default: 7) |
|
||||
| `--type <type>` | string | no | Model type: Text, Vision, Multimodal, Audio, Embedding |
|
||||
| `--workspace-id <id>` | string | no | Workspace ID (env: BAILIAN_WORKSPACE_ID) |
|
||||
| Flag | Type | Required | Description |
|
||||
| ------------------------------ | ------ | -------- | ------------------------------------------------------ |
|
||||
| `--model <model>` | string | no | Model name(s), comma-separated; omit for overview |
|
||||
| `--days <days>` | string | no | Number of days (default: 7) |
|
||||
| `--type <type>` | string | no | Model type: Text, Vision, Multimodal, Audio, Embedding |
|
||||
| `--workspace-id <id>` | string | no | Workspace ID (env: BAILIAN_WORKSPACE_ID) |
|
||||
| `--console-region <region>` | string | no | Console region (global flag) |
|
||||
| `--console-site <site>` | string | no | Console site: domestic, international (global flag) |
|
||||
| `--console-switch-agent <uid>` | number | no | Switch agent UID (global flag) |
|
||||
|
||||
#### Examples
|
||||
|
||||
|
||||
@@ -23,9 +23,12 @@ Index: [index.md](index.md)
|
||||
|
||||
#### Options
|
||||
|
||||
| Flag | Type | Required | Description |
|
||||
| ------------ | ------ | -------- | ----------------------- |
|
||||
| `--list <n>` | string | no | Limit number of results |
|
||||
| Flag | Type | Required | Description |
|
||||
| ------------------------------ | ------ | -------- | --------------------------------------------------- |
|
||||
| `--list <n>` | string | no | Limit number of results |
|
||||
| `--console-region <region>` | string | no | Console region (global flag) |
|
||||
| `--console-site <site>` | string | no | Console site: domestic, international (global flag) |
|
||||
| `--console-switch-agent <uid>` | number | no | Switch agent UID (global flag) |
|
||||
|
||||
#### Examples
|
||||
|
||||
|
||||
Reference in New Issue
Block a user