From 468b4d710ef59f6d7d33da3f9fbaa9928980e4cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=A5=E9=BA=92?= Date: Mon, 6 Jul 2026 20:43:29 +0800 Subject: [PATCH] refactor(flags): scope yes/async/concurrent to command-owned flags - remove nonInteractive plus yes/async/concurrent from GLOBAL_FLAGS and Settings; command dispatch no longer resolves command-only switches into global settings - add shared ASYNC_FLAG / CONCURRENT_FLAG definitions for commands that actually support task-only return or parallel requests - keep quota downgrade protection by moving --yes onto quota request and reading flags.yes for confirmed downgrade submission - update existing async/concurrent consumers to read own flags; no new capability matrix entries are added - refresh generated command reference and remove stale --non-interactive usage from e2e/stress invocations --- docs/agents/cli-e2e-tests.md | 5 +-- docs/agents/error-hint-change.md | 4 +- docs/agents/stress-batch-tests.md | 1 - docs/agents/url-change.md | 2 +- .../tests/e2e/advisor-recommend.e2e.test.ts | 12 +---- packages/cli/tests/e2e/auth.e2e.test.ts | 44 +++---------------- packages/cli/tests/e2e/config.e2e.test.ts | 16 +------ .../cli/tests/e2e/console-flags.e2e.test.ts | 5 --- .../cli/tests/e2e/file-upload.e2e.test.ts | 17 +------ packages/cli/tests/e2e/image-edit.e2e.test.ts | 18 +------- .../cli/tests/e2e/image-generate.e2e.test.ts | 9 +--- packages/cli/tests/e2e/knowledge.e2e.test.ts | 32 ++------------ packages/cli/tests/e2e/mcp.e2e.test.ts | 14 +----- packages/cli/tests/e2e/memory.e2e.test.ts | 8 ---- packages/cli/tests/e2e/omni.e2e.test.ts | 11 +---- packages/cli/tests/e2e/pipeline.e2e.test.ts | 17 +------ packages/cli/tests/e2e/quota.e2e.test.ts | 1 - packages/cli/tests/e2e/search-web.e2e.test.ts | 6 +-- .../tests/e2e/speech-list-voices.e2e.test.ts | 3 +- .../tests/e2e/speech-recognize.e2e.test.ts | 4 +- .../tests/e2e/speech-synthesize.e2e.test.ts | 3 -- packages/cli/tests/e2e/text-chat.e2e.test.ts | 10 +---- .../cli/tests/e2e/video-download.e2e.test.ts | 5 --- packages/cli/tests/e2e/video-edit.e2e.test.ts | 3 -- .../tests/e2e/video-generate-i2v.e2e.test.ts | 4 -- .../tests/e2e/video-generate-t2v.e2e.test.ts | 3 -- .../cli/tests/e2e/video-ref-r2v.e2e.test.ts | 4 -- .../cli/tests/e2e/video-task-get.e2e.test.ts | 11 +---- packages/cli/tests/stress/lib/fixtures.mjs | 3 -- .../cli/tests/stress/lib/suite-fixtures.mjs | 3 -- .../cli/tests/stress/targets/image-edit.mjs | 1 - .../tests/stress/targets/image-generate.mjs | 1 - .../tests/stress/targets/speech-recognize.mjs | 1 - .../stress/targets/speech-synthesize.mjs | 1 - .../cli/tests/stress/targets/text-chat.mjs | 1 - .../cli/tests/stress/targets/video-edit.mjs | 1 - .../cli/tests/stress/targets/video-i2v.mjs | 1 - .../cli/tests/stress/targets/video-ref.mjs | 1 - .../cli/tests/stress/targets/video-t2v.mjs | 1 - packages/commands/src/commands/image/edit.ts | 4 +- .../commands/src/commands/image/generate.ts | 8 +++- .../commands/src/commands/quota/request.ts | 3 +- .../commands/src/commands/speech/recognize.ts | 4 +- .../src/commands/speech/synthesize.ts | 4 +- packages/commands/src/commands/video/edit.ts | 4 +- .../commands/src/commands/video/generate.ts | 8 +++- packages/commands/src/commands/video/ref.ts | 4 +- packages/core/src/config/loader.ts | 4 -- packages/core/src/config/schema.ts | 5 --- packages/core/src/telemetry/tracker.ts | 3 -- packages/core/src/types/command.ts | 22 ++++++---- packages/core/src/types/index.ts | 2 + packages/core/tests/config-priority.test.ts | 15 +------ packages/core/tests/index.test.ts | 3 -- packages/runtime/src/pipeline/bl-config.ts | 3 +- packages/runtime/src/utils/concurrent.ts | 8 ++-- skills/bailian-cli/SKILL.md | 2 +- skills/bailian-cli/assets/issue-reporting.md | 2 +- skills/bailian-cli/reference/image.md | 3 ++ skills/bailian-cli/reference/index.md | 24 +++++----- skills/bailian-cli/reference/quota.md | 1 + skills/bailian-cli/reference/speech.md | 2 + skills/bailian-cli/reference/video.md | 4 ++ 63 files changed, 106 insertions(+), 323 deletions(-) diff --git a/docs/agents/cli-e2e-tests.md b/docs/agents/cli-e2e-tests.md index 69246aa..2fcf25d 100644 --- a/docs/agents/cli-e2e-tests.md +++ b/docs/agents/cli-e2e-tests.md @@ -46,7 +46,7 @@ describe.skipIf()("e2e: (DashScope …)", () => { 1. **分组 help**:`runCli(["image"])` → `exitCode === 0`,stdout+stderr 含子命令名 2. **--help**:`runCli([..., "--help"])` → stderr 含主要 flags -3. **缺参**:`--non-interactive` 且不传 required flag → `exitCode === 2`,stderr 匹配 `--flag|Missing required argument` +3. **缺参**:带一个无害全局 flag(如 `--quiet`)且不传 required flag → `exitCode === 2`,stderr 匹配 `--flag|Missing required argument` 4. **--dry-run**:仅当实现在联网/上传/写盘**之前**返回;断言 stdout JSON/文本,不入网 5. **真实集成**:保留既有用例名称与断言;放在 skip 块**末尾** @@ -70,7 +70,7 @@ describe.skipIf()("e2e: (DashScope …)", () => { ```ts test("foo bar 缺少 --prompt 时退出为用法错误 (2)", async () => { - const { stderr, exitCode } = await runCli(["foo", "bar", "--non-interactive"]); + const { stderr, exitCode } = await runCli(["foo", "bar", "--quiet"]); expect(exitCode).toBe(2); expect(stderr).toMatch(/--prompt|Missing required argument/i); }); @@ -82,7 +82,6 @@ test("foo bar --dry-run 仅输出计划", async () => { "--dry-run", "--prompt", "x", - "--non-interactive", "--output", "json", ]); diff --git a/docs/agents/error-hint-change.md b/docs/agents/error-hint-change.md index 86153a7..49c2923 100644 --- a/docs/agents/error-hint-change.md +++ b/docs/agents/error-hint-change.md @@ -104,10 +104,10 @@ process.exit(err.exitCode) ```sh # 触发对应错误,看 text 输出 -HOME=/tmp/empty node packages/cli/src/main.ts text chat --message "x" --non-interactive +HOME=/tmp/empty node packages/cli/src/main.ts text chat --message "x" # 看 JSON 输出(应包含 cause 字段当 cause 存在时) -HOME=/tmp/empty node packages/cli/src/main.ts text chat --message "x" --non-interactive --output json +HOME=/tmp/empty node packages/cli/src/main.ts text chat --message "x" --output json # 模拟网络层错误,验证 errno 透传 DASHSCOPE_BASE_URL=https://nonexistent-host.invalid \ diff --git a/docs/agents/stress-batch-tests.md b/docs/agents/stress-batch-tests.md index 69b2707..bf3a2ac 100644 --- a/docs/agents/stress-batch-tests.md +++ b/docs/agents/stress-batch-tests.md @@ -121,7 +121,6 @@ pnpm run test:stress -- video-edit --reuse-fixtures -- --count 3 ### 必须带的 CLI 参数(通用) -- `--non-interactive` - 除 `speech recognize` 外,压测子进程宜带 `--output json`(语音识别以 `--out` 文件为准 stdout 可能为纯文本) - 异步类命令带 `--timeout`、对应 `--poll-interval` diff --git a/docs/agents/url-change.md b/docs/agents/url-change.md index 872db28..5c99965 100644 --- a/docs/agents/url-change.md +++ b/docs/agents/url-change.md @@ -59,7 +59,7 @@ grep -rnE "https://dashscope[a-z-]*\.aliyuncs\.com" packages/ --include="*.ts" \ ```sh # 验证错误 hint 不再泄漏旧 URL -HOME=/tmp/empty node packages/cli/src/main.ts text chat --message x --non-interactive +HOME=/tmp/empty node packages/cli/src/main.ts text chat --message x # 看输出的 Get API Key URL 是否走新值 # 验证 banner / help diff --git a/packages/cli/tests/e2e/advisor-recommend.e2e.test.ts b/packages/cli/tests/e2e/advisor-recommend.e2e.test.ts index 7498dbc..81f4371 100644 --- a/packages/cli/tests/e2e/advisor-recommend.e2e.test.ts +++ b/packages/cli/tests/e2e/advisor-recommend.e2e.test.ts @@ -17,11 +17,7 @@ describe("e2e: advisor recommend", () => { describe.skipIf(!isDashScopeE2EReady())("e2e: advisor recommend (DashScope)", () => { test("advisor recommend without --message errors as usage error (2)", async () => { - const { stdout, stderr, exitCode } = await runCli([ - "advisor", - "recommend", - "--non-interactive", - ]); + const { stdout, stderr, exitCode } = await runCli(["advisor", "recommend", "--quiet"]); expect(exitCode).toBe(2); expect(`${stdout}\n${stderr}`).toMatch(/--message|Usage:/i); }); @@ -33,7 +29,6 @@ describe.skipIf(!isDashScopeE2EReady())("e2e: advisor recommend (DashScope)", () "--dry-run", "--message", "I want to build a customer service bot that understands images", - "--non-interactive", "--output", "json", ]); @@ -58,7 +53,6 @@ describe.skipIf(!isDashScopeE2EReady())("e2e: advisor recommend (DashScope)", () "recommend", "--message", "low-cost high-concurrency online customer service", - "--non-interactive", "--output", "json", ]); @@ -90,7 +84,6 @@ describe.skipIf(!isDashScopeE2EReady())("e2e: advisor recommend (DashScope)", () "--dry-run", "--message", "Which model in the deepseek family is best for fast reasoning?", - "--non-interactive", "--output", "json", ]); @@ -114,7 +107,6 @@ describe.skipIf(!isDashScopeE2EReady())("e2e: advisor recommend (DashScope)", () "--dry-run", "--message", "Which is better for code generation, qwen-max or deepseek-v3?", - "--non-interactive", "--output", "json", ]); @@ -133,7 +125,6 @@ describe.skipIf(!isDashScopeE2EReady())("e2e: advisor recommend (DashScope)", () "--dry-run", "--message", "Not qwen, recommend a model suitable for text generation", - "--non-interactive", "--output", "json", ]); @@ -160,7 +151,6 @@ describe.skipIf(!isDashScopeE2EReady())("e2e: advisor recommend (DashScope)", () "--dry-run", "--message", "I want to build a customer service bot that understands images", - "--non-interactive", "--output", "json", ]); diff --git a/packages/cli/tests/e2e/auth.e2e.test.ts b/packages/cli/tests/e2e/auth.e2e.test.ts index 61951ad..cf10000 100644 --- a/packages/cli/tests/e2e/auth.e2e.test.ts +++ b/packages/cli/tests/e2e/auth.e2e.test.ts @@ -33,7 +33,7 @@ describe("e2e: auth", () => { }); test("auth login 缺少 --api-key 时报用法错误并退出 (2)", async () => { - const { stderr, exitCode } = await runCli(["auth", "login", "--non-interactive"]); + const { stderr, exitCode } = await runCli(["auth", "login", "--quiet"]); expect(exitCode, stderr).toBe(2); expect(stderr).toMatch(/--api-key|Usage:/i); }); @@ -45,7 +45,6 @@ describe("e2e: auth", () => { "--dry-run", "--api-key", "sk-e2e-dry-run-placeholder", - "--non-interactive", ]); expect(exitCode, stderr).toBe(0); expect(stdout).toContain("Would validate and save API key."); @@ -58,7 +57,6 @@ describe("e2e: auth", () => { "--dry-run", "--api-key", "sk-e2e-dry-run-placeholder", - "--non-interactive", "--output", "json", "--timeout", @@ -70,13 +68,7 @@ describe("e2e: auth", () => { }); test("auth login 缺少密钥且 --output json 时报用法错误并退出 (2)", async () => { - const { stderr, exitCode } = await runCli([ - "auth", - "login", - "--non-interactive", - "--output", - "json", - ]); + const { stderr, exitCode } = await runCli(["auth", "login", "--output", "json"]); expect(exitCode).toBe(2); const err = JSON.parse(stderr.trim()) as { error?: { code?: number; message?: string } }; expect(err.error?.code).toBe(2); @@ -90,19 +82,6 @@ describe("e2e: auth", () => { expect(stderr).not.toContain("Cleared api_key"); }); - test("auth logout --dry-run --yes --non-interactive", async () => { - const { stdout, stderr, exitCode } = await runCli([ - "auth", - "logout", - "--dry-run", - "--yes", - "--non-interactive", - ]); - expect(exitCode, stderr).toBe(0); - expect(stdout).toContain("No changes made."); - expect(stderr).not.toContain("Cleared api_key"); - }); - test("auth logout --dry-run --quiet --no-color", async () => { const { stdout, stderr, exitCode } = await runCli([ "auth", @@ -122,7 +101,6 @@ describe("e2e: auth", () => { "--dry-run", "--output", "json", - "--non-interactive", ]); expect(exitCode, stderr).toBe(0); expect(stdout).toContain("No changes made."); @@ -130,13 +108,7 @@ describe("e2e: auth", () => { }); test.skipIf(!isDashScopeE2EReady())("auth status 文本输出", async () => { - const { stdout, stderr, exitCode } = await runCli([ - "auth", - "status", - "--non-interactive", - "--output", - "text", - ]); + const { stdout, stderr, exitCode } = await runCli(["auth", "status", "--output", "text"]); expect(exitCode, stderr).toBe(0); expect(stdout).toMatch( /Authentication Status|API key:|Console token:|DashScope API:|Console gateway:/, @@ -144,13 +116,7 @@ describe("e2e: auth", () => { }); test.skipIf(!isDashScopeE2EReady())("auth status --output json", async () => { - const { stdout, stderr, exitCode } = await runCli([ - "auth", - "status", - "--non-interactive", - "--output", - "json", - ]); + const { stdout, stderr, exitCode } = await runCli(["auth", "status", "--output", "json"]); expect(exitCode, stderr).toBe(0); const data = parseStdoutJson<{ authenticated?: boolean; @@ -164,7 +130,7 @@ describe("e2e: auth", () => { "auth status --output json --quiet(base_url 经 env 指定;凭证域 flag 对 status 不可见)", async () => { const { stdout, stderr, exitCode } = await runCli( - ["auth", "status", "--non-interactive", "--output", "json", "--quiet"], + ["auth", "status", "--output", "json", "--quiet"], { DASHSCOPE_BASE_URL: "https://dashscope.aliyuncs.com" }, ); expect(exitCode, stderr).toBe(0); diff --git a/packages/cli/tests/e2e/config.e2e.test.ts b/packages/cli/tests/e2e/config.e2e.test.ts index a7a02f0..ddb6860 100644 --- a/packages/cli/tests/e2e/config.e2e.test.ts +++ b/packages/cli/tests/e2e/config.e2e.test.ts @@ -26,13 +26,7 @@ describe("e2e: config", () => { }); test("config show --output json", async () => { - const { stdout, stderr, exitCode } = await runCli([ - "config", - "show", - "--non-interactive", - "--output", - "json", - ]); + const { stdout, stderr, exitCode } = await runCli(["config", "show", "--output", "json"]); expect(exitCode, stderr).toBe(0); const data = parseStdoutJson<{ config_file?: string; @@ -48,7 +42,6 @@ describe("e2e: config", () => { const { stdout, stderr, exitCode } = await runCli([ "config", "show", - "--non-interactive", "--output", "text", "--no-color", @@ -58,7 +51,7 @@ describe("e2e: config", () => { }); test("config set 缺少 --key / --value 时报用法错误并退出 (2)", async () => { - const { stderr, exitCode } = await runCli(["config", "set", "--non-interactive"]); + const { stderr, exitCode } = await runCli(["config", "set", "--quiet"]); expect(exitCode, stderr).toBe(2); expect(stderr).toMatch(/--key|--value|Usage:/i); }); @@ -67,7 +60,6 @@ describe("e2e: config", () => { const { stderr, exitCode } = await runCli([ "config", "set", - "--non-interactive", "--key", "not-a-real-key", "--value", @@ -81,7 +73,6 @@ describe("e2e: config", () => { const { stderr, exitCode } = await runCli([ "config", "set", - "--non-interactive", "--key", "output", "--value", @@ -95,7 +86,6 @@ describe("e2e: config", () => { const { stderr, exitCode } = await runCli([ "config", "set", - "--non-interactive", "--key", "timeout", "--value", @@ -110,7 +100,6 @@ describe("e2e: config", () => { "config", "set", "--dry-run", - "--non-interactive", "--key", "output", "--value", @@ -128,7 +117,6 @@ describe("e2e: config", () => { "config", "set", "--dry-run", - "--non-interactive", "--key", "default-text-model", "--value", diff --git a/packages/cli/tests/e2e/console-flags.e2e.test.ts b/packages/cli/tests/e2e/console-flags.e2e.test.ts index 3fa8b7c..f5b8a6e 100644 --- a/packages/cli/tests/e2e/console-flags.e2e.test.ts +++ b/packages/cli/tests/e2e/console-flags.e2e.test.ts @@ -83,7 +83,6 @@ describe("e2e: console global flags", () => { "--data", "{}", "--dry-run", - "--non-interactive", "--output", "json", ]); @@ -102,7 +101,6 @@ describe("e2e: console global flags", () => { "--data", "{}", "--dry-run", - "--non-interactive", "--output", "json", "--console-region", @@ -128,7 +126,6 @@ describe("e2e: console global flags", () => { "--data", "{}", "--dry-run", - "--non-interactive", "--region", "cn", ]); @@ -141,7 +138,6 @@ describe("e2e: console global flags", () => { "mcp", "list", "--dry-run", - "--non-interactive", "--output", "json", "--console-region", @@ -157,7 +153,6 @@ describe("e2e: console global flags", () => { "quota", "check", "--dry-run", - "--non-interactive", "--output", "json", "--console-region", diff --git a/packages/cli/tests/e2e/file-upload.e2e.test.ts b/packages/cli/tests/e2e/file-upload.e2e.test.ts index e3f574d..241910f 100644 --- a/packages/cli/tests/e2e/file-upload.e2e.test.ts +++ b/packages/cli/tests/e2e/file-upload.e2e.test.ts @@ -26,26 +26,14 @@ describe("e2e: file upload", () => { describe.skipIf(!isDashScopeE2EReady())("e2e: file upload(DashScope)", () => { test("file upload 缺少 --file 时报用法错误并退出 (2)", async () => { - const { stderr, exitCode } = await runCli([ - "file", - "upload", - "--model", - "qwen3-vl-plus", - "--non-interactive", - ]); + const { stderr, exitCode } = await runCli(["file", "upload", "--model", "qwen3-vl-plus"]); expect(exitCode).toBe(2); expect(stderr).toMatch(/--file|Usage:/i); }); test("file upload 缺少 --model 时报用法错误并退出 (2)", async () => { const testFile = join(__dirname, ".smoke-32.png"); - const { stderr, exitCode } = await runCli([ - "file", - "upload", - "--file", - testFile, - "--non-interactive", - ]); + const { stderr, exitCode } = await runCli(["file", "upload", "--file", testFile]); expect(exitCode).toBe(2); expect(stderr).toMatch(/--model|Usage:/i); }); @@ -59,7 +47,6 @@ describe.skipIf(!isDashScopeE2EReady())("e2e: file upload(DashScope)", () => testFile, "--model", "qwen3-vl-plus", - "--non-interactive", "--output", "json", ]); diff --git a/packages/cli/tests/e2e/image-edit.e2e.test.ts b/packages/cli/tests/e2e/image-edit.e2e.test.ts index 8b18e34..ad582ab 100644 --- a/packages/cli/tests/e2e/image-edit.e2e.test.ts +++ b/packages/cli/tests/e2e/image-edit.e2e.test.ts @@ -33,26 +33,14 @@ describe("e2e: image edit", () => { describe.skipIf(!isBailianE2EMediaEnabled() || !isDashScopeE2EReady())("e2e: image edit", () => { test("image edit 缺少 --image 时报用法错误并退出 (2)", async () => { - const { stderr, exitCode } = await runCli([ - "image", - "edit", - "--prompt", - "仅提示词", - "--non-interactive", - ]); + const { stderr, exitCode } = await runCli(["image", "edit", "--prompt", "仅提示词"]); expect(exitCode).toBe(2); expect(stderr).toMatch(/--image|Usage:/i); }); test("image edit 缺少 --prompt 时报用法错误并退出 (2)", async () => { const testPng = join(__dirname, ".smoke-32.png"); - const { stderr, exitCode } = await runCli([ - "image", - "edit", - "--image", - testPng, - "--non-interactive", - ]); + const { stderr, exitCode } = await runCli(["image", "edit", "--image", testPng]); expect(exitCode).toBe(2); expect(stderr).toMatch(/--prompt|Usage:/i); }); @@ -70,7 +58,6 @@ describe.skipIf(!isBailianE2EMediaEnabled() || !isDashScopeE2EReady())("e2e: ima outDir, "--out-prefix", "e2e-gen", - "--non-interactive", "--output", "json", ]); @@ -93,7 +80,6 @@ describe.skipIf(!isBailianE2EMediaEnabled() || !isDashScopeE2EReady())("e2e: ima outDir, "--out-prefix", "e2e-edit", - "--non-interactive", "--output", "json", ]); diff --git a/packages/cli/tests/e2e/image-generate.e2e.test.ts b/packages/cli/tests/e2e/image-generate.e2e.test.ts index ee56f08..445fb5a 100644 --- a/packages/cli/tests/e2e/image-generate.e2e.test.ts +++ b/packages/cli/tests/e2e/image-generate.e2e.test.ts @@ -33,13 +33,7 @@ describe.skipIf(!isBailianE2EMediaEnabled() || !isDashScopeE2EReady())( "e2e: image generate", () => { test("image generate 缺少 --prompt 时报用法错误并退出 (2)", async () => { - const { stderr, exitCode } = await runCli([ - "image", - "generate", - "--model", - "qwen-image-2.0", - "--non-interactive", - ]); + const { stderr, exitCode } = await runCli(["image", "generate", "--model", "qwen-image-2.0"]); expect(exitCode).toBe(2); expect(stderr).toMatch(/--prompt|Usage:/i); }); @@ -57,7 +51,6 @@ describe.skipIf(!isBailianE2EMediaEnabled() || !isDashScopeE2EReady())( outDir, "--out-prefix", "e2e-gen", - "--non-interactive", "--output", "json", ]); diff --git a/packages/cli/tests/e2e/knowledge.e2e.test.ts b/packages/cli/tests/e2e/knowledge.e2e.test.ts index e3540b3..f67dafd 100644 --- a/packages/cli/tests/e2e/knowledge.e2e.test.ts +++ b/packages/cli/tests/e2e/knowledge.e2e.test.ts @@ -38,25 +38,13 @@ describe("e2e: knowledge retrieve", () => { }); test("缺少 --index-id 时报用法错误并退出 (2)", async () => { - const { stderr, exitCode } = await runCli([ - "knowledge", - "retrieve", - "--query", - "test", - "--non-interactive", - ]); + const { stderr, exitCode } = await runCli(["knowledge", "retrieve", "--query", "test"]); expect(exitCode).toBe(2); expect(stderr).toMatch(/--index-id|Usage:/i); }); test("缺少 --query 时报用法错误并退出 (2)", async () => { - const { stderr, exitCode } = await runCli([ - "knowledge", - "retrieve", - "--index-id", - "idx_test", - "--non-interactive", - ]); + const { stderr, exitCode } = await runCli(["knowledge", "retrieve", "--index-id", "idx_test"]); expect(exitCode).toBe(2); expect(stderr).toMatch(/--query|Usage:/i); }); @@ -67,17 +55,7 @@ describe("e2e: knowledge retrieve", () => { describe("e2e: knowledge retrieve errors", () => { test("无任何凭证时提示缺少密钥并非零退出", async () => { const { stderr, exitCode } = await runCli( - [ - "knowledge", - "retrieve", - "--index-id", - "idx_test", - "--query", - "test", - "--non-interactive", - "--output", - "json", - ], + ["knowledge", "retrieve", "--index-id", "idx_test", "--query", "test", "--output", "json"], { DASHSCOPE_API_KEY: undefined, DASHSCOPE_ACCESS_TOKEN: undefined, @@ -102,7 +80,6 @@ describe("e2e: knowledge retrieve dry-run", () => { "idx_test", "--query", "hello", - "--non-interactive", "--output", "json", ], @@ -127,7 +104,6 @@ describe("e2e: knowledge retrieve dry-run", () => { "hello", "--top-k", "5", - "--non-interactive", "--output", "json", ], @@ -153,7 +129,6 @@ describe("e2e: knowledge retrieve dry-run", () => { "5", "--rerank-top-n", "10", - "--non-interactive", "--output", "json", ], @@ -185,7 +160,6 @@ describe("e2e: knowledge retrieve dry-run", () => { "100", "--sparse-similarity-top-k", "50", - "--non-interactive", "--output", "json", ], diff --git a/packages/cli/tests/e2e/mcp.e2e.test.ts b/packages/cli/tests/e2e/mcp.e2e.test.ts index 9611cd6..fec9919 100644 --- a/packages/cli/tests/e2e/mcp.e2e.test.ts +++ b/packages/cli/tests/e2e/mcp.e2e.test.ts @@ -53,7 +53,6 @@ describe("e2e: mcp", () => { "mcp", "list", "--dry-run", - "--non-interactive", "--output", "json", "--name", @@ -92,7 +91,6 @@ describe("e2e: mcp", () => { "mcp", "list", "--dry-run", - "--non-interactive", "--output", "json", "--console-region", @@ -110,7 +108,6 @@ describe("e2e: mcp", () => { "--server", "market-cmapi00073529", "--dry-run", - "--non-interactive", "--output", "json", ]); @@ -132,7 +129,6 @@ describe("e2e: mcp", () => { "--url", "https://example.com/custom/mcp", "--dry-run", - "--non-interactive", "--output", "json", ]); @@ -143,7 +139,7 @@ describe("e2e: mcp", () => { }); test("mcp tools 缺少 --server 时报用法错误并退出 (2)", async () => { - const { stderr, exitCode } = await runCli(["mcp", "tools", "--non-interactive"]); + const { stderr, exitCode } = await runCli(["mcp", "tools", "--quiet"]); expect(exitCode, stderr).toBe(2); expect(stderr).toMatch(/--server|Usage:/i); }); @@ -157,7 +153,6 @@ describe("e2e: mcp", () => { "--query", "筛选ROE>15%的消费股", "--dry-run", - "--non-interactive", "--output", "json", ]); @@ -190,7 +185,6 @@ describe("e2e: mcp", () => { "--query", "招商银行", "--dry-run", - "--non-interactive", "--output", "json", ]); @@ -218,7 +212,6 @@ describe("e2e: mcp", () => { "call", "--target", "no-dot-target", - "--non-interactive", "--output", "json", ]); @@ -234,7 +227,6 @@ describe("e2e: mcp", () => { "srv.tool", "--arg", "no-equals-sign", - "--non-interactive", "--output", "json", ]); @@ -250,7 +242,6 @@ describe("e2e: mcp", () => { "srv.tool", "--json", "{not-json", - "--non-interactive", "--output", "json", ]); @@ -259,7 +250,7 @@ describe("e2e: mcp", () => { }); test("mcp call 缺少 --target 时报用法错误并退出 (2)", async () => { - const { stderr, exitCode } = await runCli(["mcp", "call", "--non-interactive"]); + const { stderr, exitCode } = await runCli(["mcp", "call", "--quiet"]); expect(exitCode, stderr).toBe(2); expect(stderr).toMatch(/--target|Usage:/i); }); @@ -275,7 +266,6 @@ describe.skipIf(!isDashScopeE2EReady())("e2e: mcp (live)", () => { "tools", "--server", "WebSearch", - "--non-interactive", "--output", "json", ]); diff --git a/packages/cli/tests/e2e/memory.e2e.test.ts b/packages/cli/tests/e2e/memory.e2e.test.ts index af541ac..66bcf9d 100644 --- a/packages/cli/tests/e2e/memory.e2e.test.ts +++ b/packages/cli/tests/e2e/memory.e2e.test.ts @@ -76,7 +76,6 @@ describe.skipIf(!isBailianE2EEnabled() || !isDashScopeE2EReady())( ...memoryLibraryCliArgs(), "--content", "仅内容无用户", - "--non-interactive", ]); expect(exitCode).toBe(2); expect(stderr).toMatch(/--user-id|Usage:/i); @@ -90,7 +89,6 @@ describe.skipIf(!isBailianE2EEnabled() || !isDashScopeE2EReady())( ...memoryLibraryCliArgs(), "--user-id", userId, - "--non-interactive", ]); expect(exitCode).toBe(2); expect(stderr).toMatch(/messages|content|required/i); @@ -107,7 +105,6 @@ describe.skipIf(!isBailianE2EEnabled() || !isDashScopeE2EReady())( userId, "--content", "dry-run 不入网", - "--non-interactive", "--output", "json", ]); @@ -132,7 +129,6 @@ describe.skipIf(!isBailianE2EEnabled() || !isDashScopeE2EReady())( userId, "--content", contentA, - "--non-interactive", "--output", "json", ]); @@ -146,7 +142,6 @@ describe.skipIf(!isBailianE2EEnabled() || !isDashScopeE2EReady())( ...memoryLibraryCliArgs(), "--user-id", userId, - "--non-interactive", "--output", "json", ]); @@ -172,7 +167,6 @@ describe.skipIf(!isBailianE2EEnabled() || !isDashScopeE2EReady())( "vp test", "--top-k", "5", - "--non-interactive", "--output", "json", ]); @@ -190,7 +184,6 @@ describe.skipIf(!isBailianE2EEnabled() || !isDashScopeE2EReady())( userId, "--content", contentB, - "--non-interactive", "--output", "json", ]); @@ -204,7 +197,6 @@ describe.skipIf(!isBailianE2EEnabled() || !isDashScopeE2EReady())( nodeId!, "--user-id", userId, - "--non-interactive", "--output", "json", ]); diff --git a/packages/cli/tests/e2e/omni.e2e.test.ts b/packages/cli/tests/e2e/omni.e2e.test.ts index 969c31d..cd589a5 100644 --- a/packages/cli/tests/e2e/omni.e2e.test.ts +++ b/packages/cli/tests/e2e/omni.e2e.test.ts @@ -21,12 +21,7 @@ describe.skipIf(!isBailianE2EMediaEnabled() || !isDashScopeE2EReady())( "e2e: omni(DashScope 媒体)", () => { test("omni 缺少 --message 时报用法错误并退出 (2)", async () => { - const { stderr, exitCode } = await runCli([ - "omni", - "--model", - "qwen3.5-omni-flash", - "--non-interactive", - ]); + const { stderr, exitCode } = await runCli(["omni", "--model", "qwen3.5-omni-flash"]); expect(exitCode).toBe(2); expect(stderr).toMatch(/--message|Usage:/i); }); @@ -41,7 +36,6 @@ describe.skipIf(!isBailianE2EMediaEnabled() || !isDashScopeE2EReady())( "--text-only", "--message", "这段音频在说什么?", - "--non-interactive", ]); expect(exitCode).toBe(2); expect(stderr).toMatch(/Unsupported audio extension|Cannot infer audio format/i); @@ -58,7 +52,6 @@ describe.skipIf(!isBailianE2EMediaEnabled() || !isDashScopeE2EReady())( "--text-only", "--message", "这段音频在说什么?", - "--non-interactive", "--output", "json", ]); @@ -102,7 +95,6 @@ describe.skipIf(!isBailianE2EMediaEnabled() || !isDashScopeE2EReady())( "wav", "--out", clipWav, - "--non-interactive", "--output", "json", ]); @@ -119,7 +111,6 @@ describe.skipIf(!isBailianE2EMediaEnabled() || !isDashScopeE2EReady())( "请逐字转写用户提供的音频内容,不要添加解释。", "--message", "请转写这段音频。", - "--non-interactive", "--output", "json", ]); diff --git a/packages/cli/tests/e2e/pipeline.e2e.test.ts b/packages/cli/tests/e2e/pipeline.e2e.test.ts index 6f5ad85..5fa8b85 100644 --- a/packages/cli/tests/e2e/pipeline.e2e.test.ts +++ b/packages/cli/tests/e2e/pipeline.e2e.test.ts @@ -128,7 +128,7 @@ describe("e2e: pipeline", () => { }); test("pipeline run 缺少 --file 时报用法错误并退出 (2)", async () => { - const { stderr, exitCode } = await runCli(["pipeline", "run", "--non-interactive"]); + const { stderr, exitCode } = await runCli(["pipeline", "run", "--quiet"]); expect(exitCode, stderr).toBe(2); expect(stderr).toMatch(/Usage: bl pipeline run --file |--file/i); }); @@ -144,7 +144,6 @@ describe("e2e: pipeline", () => { "--dry-run", "--output", "json", - "--non-interactive", ]); expect(exitCode, stderr).toBe(0); const report = parseStdoutJson<{ @@ -169,16 +168,7 @@ describe("e2e: pipeline", () => { test("pipeline run 使用 config 输出格式", async () => { const { stdout, stderr, exitCode } = await runCli( - [ - "pipeline", - "run", - "--file", - chatBasicPath, - "--input", - '{"message":"hello"}', - "--dry-run", - "--non-interactive", - ], + ["pipeline", "run", "--file", chatBasicPath, "--input", '{"message":"hello"}', "--dry-run"], { DASHSCOPE_OUTPUT: "text" }, ); expect(exitCode, stderr).toBe(0); @@ -196,7 +186,6 @@ describe("e2e: pipeline", () => { '{"message":"hello"}', "--dry-run", "--verbose", - "--non-interactive", ]); expect(exitCode, stderr).toBe(0); expect(stderr).toMatch(/\[pipeline\.started\] 1 step/); @@ -214,7 +203,6 @@ describe("e2e: pipeline", () => { "--dry-run", "--events", "jsonl", - "--non-interactive", ]); expect(exitCode, stderr).toBe(0); const events = stdout @@ -241,7 +229,6 @@ describe("e2e: pipeline", () => { "--dry-run", "--events", "bogus", - "--non-interactive", ]); expect(exitCode).toBe(2); expect(stdout).toBe(""); diff --git a/packages/cli/tests/e2e/quota.e2e.test.ts b/packages/cli/tests/e2e/quota.e2e.test.ts index e380ef1..08c4ab5 100644 --- a/packages/cli/tests/e2e/quota.e2e.test.ts +++ b/packages/cli/tests/e2e/quota.e2e.test.ts @@ -243,7 +243,6 @@ describe.skipIf(!isConsoleE2EReady())("e2e: quota(Console)", () => { "quota", "check", "--dry-run", - "--non-interactive", "--output", "json", "--console-region", diff --git a/packages/cli/tests/e2e/search-web.e2e.test.ts b/packages/cli/tests/e2e/search-web.e2e.test.ts index 423a5fd..817f7f7 100644 --- a/packages/cli/tests/e2e/search-web.e2e.test.ts +++ b/packages/cli/tests/e2e/search-web.e2e.test.ts @@ -30,7 +30,7 @@ describe("e2e: search web", () => { test("search web --dry-run --list-tools 无需 --query 也无需凭证即可干跑", async () => { const { stdout, stderr, exitCode } = await runCli( - ["search", "web", "--dry-run", "--list-tools", "--non-interactive", "--output", "json"], + ["search", "web", "--dry-run", "--list-tools", "--output", "json"], { DASHSCOPE_API_KEY: undefined, DASHSCOPE_ACCESS_TOKEN: undefined, @@ -44,7 +44,7 @@ describe("e2e: search web", () => { describe.skipIf(!isDashScopeE2EReady())("e2e: search web", () => { test("search web 缺少 --query 时报用法错误并退出 (2)", async () => { - const { stderr, exitCode } = await runCli(["search", "web", "--non-interactive"]); + const { stderr, exitCode } = await runCli(["search", "web", "--quiet"]); expect(exitCode).toBe(2); expect(stderr).toMatch(/--query|Usage:/i); }); @@ -54,7 +54,6 @@ describe.skipIf(!isDashScopeE2EReady())("e2e: search web", () => { "search", "web", "--dry-run", - "--non-interactive", "--output", "json", "--query", @@ -82,7 +81,6 @@ describe.skipIf(!isDashScopeE2EReady())("e2e: search web", () => { "阿里云百炼", "--count", "3", - "--non-interactive", "--output", "json", ]); diff --git a/packages/cli/tests/e2e/speech-list-voices.e2e.test.ts b/packages/cli/tests/e2e/speech-list-voices.e2e.test.ts index a069bc2..65a7120 100644 --- a/packages/cli/tests/e2e/speech-list-voices.e2e.test.ts +++ b/packages/cli/tests/e2e/speech-list-voices.e2e.test.ts @@ -28,7 +28,7 @@ describe("e2e: speech list-voices", () => { describe.skipIf(!isDashScopeE2EReady())("e2e: speech list-voices", () => { test("speech synthesize 缺少 --text 且非 --list-voices 时报用法错误并退出 (2)", async () => { - const { stderr, exitCode } = await runCli(["speech", "synthesize", "--non-interactive"]); + const { stderr, exitCode } = await runCli(["speech", "synthesize", "--quiet"]); expect(exitCode).toBe(2); expect(stderr).toMatch(/--text|Usage:/i); }); @@ -40,7 +40,6 @@ describe.skipIf(!isDashScopeE2EReady())("e2e: speech list-voices", () => { "--list-voices", "--model", "cosyvoice-v3-flash", - "--non-interactive", ]); expect(exitCode, stderr).toBe(0); expect(stdout).toContain("longxiaochun_v3"); diff --git a/packages/cli/tests/e2e/speech-recognize.e2e.test.ts b/packages/cli/tests/e2e/speech-recognize.e2e.test.ts index 83bdf1b..cc4a106 100644 --- a/packages/cli/tests/e2e/speech-recognize.e2e.test.ts +++ b/packages/cli/tests/e2e/speech-recognize.e2e.test.ts @@ -32,7 +32,7 @@ describe.skipIf(!isBailianE2EMediaEnabled() || !isDashScopeE2EReady())( "e2e: speech recognize(DashScope 媒体)", () => { test("speech recognize 缺少 --url 时报用法错误并退出 (2)", async () => { - const { stderr, exitCode } = await runCli(["speech", "recognize", "--non-interactive"]); + const { stderr, exitCode } = await runCli(["speech", "recognize", "--quiet"]); expect(exitCode).toBe(2); expect(stderr).toMatch(/--url|Usage:/i); }); @@ -51,7 +51,6 @@ describe.skipIf(!isBailianE2EMediaEnabled() || !isDashScopeE2EReady())( "端到端语音识别", "--out", outMp3, - "--non-interactive", "--output", "json", ]); @@ -72,7 +71,6 @@ describe.skipIf(!isBailianE2EMediaEnabled() || !isDashScopeE2EReady())( "zh", "--out", asrJson, - "--non-interactive", "--output", "json", ]); diff --git a/packages/cli/tests/e2e/speech-synthesize.e2e.test.ts b/packages/cli/tests/e2e/speech-synthesize.e2e.test.ts index d63b9bd..6dfe1a0 100644 --- a/packages/cli/tests/e2e/speech-synthesize.e2e.test.ts +++ b/packages/cli/tests/e2e/speech-synthesize.e2e.test.ts @@ -38,7 +38,6 @@ describe.skipIf(!isBailianE2EMediaEnabled() || !isDashScopeE2EReady())( "cosyvoice-v3-flash", "--voice", "longxiaochun_v3", - "--non-interactive", ]); expect(exitCode).toBe(2); expect(stderr).toMatch(/--text|Usage:/i); @@ -55,7 +54,6 @@ describe.skipIf(!isBailianE2EMediaEnabled() || !isDashScopeE2EReady())( "longxiaochun_v3", "--text", "干跑", - "--non-interactive", "--output", "json", ]); @@ -81,7 +79,6 @@ describe.skipIf(!isBailianE2EMediaEnabled() || !isDashScopeE2EReady())( "端到端语音测试", "--out", outMp3, - "--non-interactive", "--output", "json", ]); diff --git a/packages/cli/tests/e2e/text-chat.e2e.test.ts b/packages/cli/tests/e2e/text-chat.e2e.test.ts index e6ded3f..c54b6fb 100644 --- a/packages/cli/tests/e2e/text-chat.e2e.test.ts +++ b/packages/cli/tests/e2e/text-chat.e2e.test.ts @@ -21,13 +21,7 @@ describe("e2e: text chat", () => { describe.skipIf(!isDashScopeE2EReady())("e2e: text chat(DashScope)", () => { test("text chat 缺少 --message 时报用法错误并退出 (2)", async () => { - const { stderr, exitCode } = await runCli([ - "text", - "chat", - "--model", - "qwen3.7-max", - "--non-interactive", - ]); + const { stderr, exitCode } = await runCli(["text", "chat", "--model", "qwen3.7-max"]); expect(exitCode).toBe(2); expect(stderr).toMatch(/--message|Usage:/i); }); @@ -43,7 +37,6 @@ describe.skipIf(!isDashScopeE2EReady())("e2e: text chat(DashScope)", () => { "干跑", "--max-tokens", "8", - "--non-interactive", "--output", "json", ]); @@ -65,7 +58,6 @@ describe.skipIf(!isDashScopeE2EReady())("e2e: text chat(DashScope)", () => { "只回复一个字:好", "--max-tokens", "32", - "--non-interactive", "--output", "json", ]); diff --git a/packages/cli/tests/e2e/video-download.e2e.test.ts b/packages/cli/tests/e2e/video-download.e2e.test.ts index f75033f..2a32020 100644 --- a/packages/cli/tests/e2e/video-download.e2e.test.ts +++ b/packages/cli/tests/e2e/video-download.e2e.test.ts @@ -42,7 +42,6 @@ describe.skipIf(!isBailianE2EVideoEnabled() || !isDashScopeE2EReady())( "download", "--out", "/tmp/will-not-be-used.mp4", - "--non-interactive", ]); expect(exitCode).toBe(2); expect(stderr).toMatch(/--task-id|Usage:/i); @@ -54,7 +53,6 @@ describe.skipIf(!isBailianE2EVideoEnabled() || !isDashScopeE2EReady())( "download", "--task-id", PLACEHOLDER_TASK_ID, - "--non-interactive", ]); expect(exitCode).toBe(2); expect(stderr).toMatch(/--out|Usage:/i); @@ -71,7 +69,6 @@ describe.skipIf(!isBailianE2EVideoEnabled() || !isDashScopeE2EReady())( PLACEHOLDER_TASK_ID, "--out", fakeOut, - "--non-interactive", "--output", "json", ]); @@ -98,7 +95,6 @@ describe.skipIf(!isBailianE2EVideoEnabled() || !isDashScopeE2EReady())( "极简几何色块,静态镜头,用于下载测试", "--download", genMp4, - "--non-interactive", "--output", "json", ]); @@ -123,7 +119,6 @@ describe.skipIf(!isBailianE2EVideoEnabled() || !isDashScopeE2EReady())( genData.task_id!, "--out", downloadMp4, - "--non-interactive", "--output", "json", ]); diff --git a/packages/cli/tests/e2e/video-edit.e2e.test.ts b/packages/cli/tests/e2e/video-edit.e2e.test.ts index b912e55..b7224e1 100644 --- a/packages/cli/tests/e2e/video-edit.e2e.test.ts +++ b/packages/cli/tests/e2e/video-edit.e2e.test.ts @@ -40,7 +40,6 @@ describe.skipIf(!isBailianE2EVideoEnabled() || !isDashScopeE2EReady())( "happyhorse-1.0-video-edit", "--prompt", "仅提示词", - "--non-interactive", ]); expect(exitCode).toBe(2); expect(stderr).toMatch(/--video|Usage:/i); @@ -60,7 +59,6 @@ describe.skipIf(!isBailianE2EVideoEnabled() || !isDashScopeE2EReady())( "夕阳下海面波光,海边有两个小朋友在玩耍", "--download", t2vPath, - "--non-interactive", "--output", "json", ]); @@ -80,7 +78,6 @@ describe.skipIf(!isBailianE2EVideoEnabled() || !isDashScopeE2EReady())( "整体色调偏暖", "--download", join(outDir, "e2e-video-edit.mp4"), - "--non-interactive", "--output", "json", ]); diff --git a/packages/cli/tests/e2e/video-generate-i2v.e2e.test.ts b/packages/cli/tests/e2e/video-generate-i2v.e2e.test.ts index 20e23e4..62754c7 100644 --- a/packages/cli/tests/e2e/video-generate-i2v.e2e.test.ts +++ b/packages/cli/tests/e2e/video-generate-i2v.e2e.test.ts @@ -40,7 +40,6 @@ describe.skipIf(!isBailianE2EVideoEnabled() || !isDashScopeE2EReady())( "happyhorse-1.0-i2v", "--image", "https://example.com/placeholder.png", - "--non-interactive", ]); expect(exitCode).toBe(2); expect(stderr).toMatch(/--prompt|Usage:/i); @@ -56,7 +55,6 @@ describe.skipIf(!isBailianE2EVideoEnabled() || !isDashScopeE2EReady())( "happyhorse-1.0-t2v", "--prompt", "干跑无图", - "--non-interactive", "--output", "json", ]); @@ -82,7 +80,6 @@ describe.skipIf(!isBailianE2EVideoEnabled() || !isDashScopeE2EReady())( outDir, "--out-prefix", "e2e-gen", - "--non-interactive", "--output", "json", ]); @@ -102,7 +99,6 @@ describe.skipIf(!isBailianE2EVideoEnabled() || !isDashScopeE2EReady())( "镜头缓慢推进,小猫微微动一下", "--download", join(outDir, "e2e-video-i2v.mp4"), - "--non-interactive", "--output", "json", ]); diff --git a/packages/cli/tests/e2e/video-generate-t2v.e2e.test.ts b/packages/cli/tests/e2e/video-generate-t2v.e2e.test.ts index f917fd8..bf2bd19 100644 --- a/packages/cli/tests/e2e/video-generate-t2v.e2e.test.ts +++ b/packages/cli/tests/e2e/video-generate-t2v.e2e.test.ts @@ -38,7 +38,6 @@ describe.skipIf(!isBailianE2EVideoEnabled() || !isDashScopeE2EReady())( ...cliTimeoutPrefix(), "--model", "happyhorse-1.0-t2v", - "--non-interactive", ]); expect(exitCode).toBe(2); expect(stderr).toMatch(/--prompt|Usage:/i); @@ -54,7 +53,6 @@ describe.skipIf(!isBailianE2EVideoEnabled() || !isDashScopeE2EReady())( "happyhorse-1.0-t2v", "--prompt", "干跑校验", - "--non-interactive", "--output", "json", ]); @@ -78,7 +76,6 @@ describe.skipIf(!isBailianE2EVideoEnabled() || !isDashScopeE2EReady())( "夕阳下海面波光,远景静态镜头", "--download", join(outDir, "e2e-video-t2v.mp4"), - "--non-interactive", "--output", "json", ]); diff --git a/packages/cli/tests/e2e/video-ref-r2v.e2e.test.ts b/packages/cli/tests/e2e/video-ref-r2v.e2e.test.ts index 8d632fd..14a87e8 100644 --- a/packages/cli/tests/e2e/video-ref-r2v.e2e.test.ts +++ b/packages/cli/tests/e2e/video-ref-r2v.e2e.test.ts @@ -40,7 +40,6 @@ describe.skipIf(!isBailianE2EVideoEnabled() || !isDashScopeE2EReady())( "happyhorse-1.0-r2v", "--image", "https://example.com/x.png", - "--non-interactive", ]); expect(exitCode).toBe(2); expect(stderr).toMatch(/--prompt|Usage:/i); @@ -55,7 +54,6 @@ describe.skipIf(!isBailianE2EVideoEnabled() || !isDashScopeE2EReady())( "happyhorse-1.0-r2v", "--prompt", "仅有描述无素材", - "--non-interactive", ]); expect(exitCode).toBe(2); expect(stderr).toMatch(/--image|ref-video|At least one|required/i); @@ -74,7 +72,6 @@ describe.skipIf(!isBailianE2EVideoEnabled() || !isDashScopeE2EReady())( outDir, "--out-prefix", "e2e-gen", - "--non-interactive", "--output", "json", ]); @@ -95,7 +92,6 @@ describe.skipIf(!isBailianE2EVideoEnabled() || !isDashScopeE2EReady())( imagePath!, "--download", join(outDir, "e2e-video-r2v.mp4"), - "--non-interactive", "--output", "json", ]); diff --git a/packages/cli/tests/e2e/video-task-get.e2e.test.ts b/packages/cli/tests/e2e/video-task-get.e2e.test.ts index 83190a5..0ea0fc7 100644 --- a/packages/cli/tests/e2e/video-task-get.e2e.test.ts +++ b/packages/cli/tests/e2e/video-task-get.e2e.test.ts @@ -25,14 +25,7 @@ describe.skipIf(!isBailianE2EEnabled() || !taskId || !isDashScopeE2EReady())( "e2e: video task get(DashScope)", () => { test("video task get 缺少 --task-id 时报用法错误并退出 (2)", async () => { - const { stderr, exitCode } = await runCli([ - "video", - "task", - "get", - "--non-interactive", - "--output", - "json", - ]); + const { stderr, exitCode } = await runCli(["video", "task", "get", "--output", "json"]); expect(exitCode).toBe(2); const err = JSON.parse(stderr.trim()) as { error?: { code?: number; message?: string } }; expect(err.error?.code).toBe(2); @@ -47,7 +40,6 @@ describe.skipIf(!isBailianE2EEnabled() || !taskId || !isDashScopeE2EReady())( "--dry-run", "--task-id", taskId!, - "--non-interactive", "--output", "json", ]); @@ -63,7 +55,6 @@ describe.skipIf(!isBailianE2EEnabled() || !taskId || !isDashScopeE2EReady())( "get", "--task-id", taskId!, - "--non-interactive", "--output", "json", ]); diff --git a/packages/cli/tests/stress/lib/fixtures.mjs b/packages/cli/tests/stress/lib/fixtures.mjs index 8b8f9a4..870bd4c 100644 --- a/packages/cli/tests/stress/lib/fixtures.mjs +++ b/packages/cli/tests/stress/lib/fixtures.mjs @@ -97,7 +97,6 @@ export async function ensurePrerequisites(ctx) { "压测前置语音样本,用于语音识别链路。", "--out", outAudio, - "--non-interactive", "--output", "json", ]; @@ -137,7 +136,6 @@ export async function ensurePrerequisites(ctx) { fixturesDir, "--out-prefix", "stress-setup-image", - "--non-interactive", "--output", "json", "--timeout", @@ -187,7 +185,6 @@ export async function ensurePrerequisites(ctx) { "5", "--download", downloadPath, - "--non-interactive", "--output", "json", "--timeout", diff --git a/packages/cli/tests/stress/lib/suite-fixtures.mjs b/packages/cli/tests/stress/lib/suite-fixtures.mjs index e879bd5..a831049 100644 --- a/packages/cli/tests/stress/lib/suite-fixtures.mjs +++ b/packages/cli/tests/stress/lib/suite-fixtures.mjs @@ -59,7 +59,6 @@ export async function generateCombinedFixtures({ suiteRoot, cliPackage }) { "压测前置语音样本,用于语音识别链路。", "--out", outAudio, - "--non-interactive", "--output", "json", ], @@ -95,7 +94,6 @@ export async function generateCombinedFixtures({ suiteRoot, cliPackage }) { fixturesDir, "--out-prefix", "stress-setup-image", - "--non-interactive", "--output", "json", "--timeout", @@ -139,7 +137,6 @@ export async function generateCombinedFixtures({ suiteRoot, cliPackage }) { "5", "--download", downloadPath, - "--non-interactive", "--output", "json", "--timeout", diff --git a/packages/cli/tests/stress/targets/image-edit.mjs b/packages/cli/tests/stress/targets/image-edit.mjs index b9063b1..71265b0 100644 --- a/packages/cli/tests/stress/targets/image-edit.mjs +++ b/packages/cli/tests/stress/targets/image-edit.mjs @@ -52,7 +52,6 @@ export const runStress = defineStressTarget({ prompt, "--out-dir", runDir, - "--non-interactive", "--output", "json", "--timeout", diff --git a/packages/cli/tests/stress/targets/image-generate.mjs b/packages/cli/tests/stress/targets/image-generate.mjs index e4f9c9a..b53c8f9 100644 --- a/packages/cli/tests/stress/targets/image-generate.mjs +++ b/packages/cli/tests/stress/targets/image-generate.mjs @@ -95,7 +95,6 @@ export const runStress = defineStressTarget({ prompt, "--out-dir", runDir, - "--non-interactive", "--output", "json", "--timeout", diff --git a/packages/cli/tests/stress/targets/speech-recognize.mjs b/packages/cli/tests/stress/targets/speech-recognize.mjs index 06ed723..9259c3f 100644 --- a/packages/cli/tests/stress/targets/speech-recognize.mjs +++ b/packages/cli/tests/stress/targets/speech-recognize.mjs @@ -41,7 +41,6 @@ export const runStress = defineStressTarget({ String(POLL_INTERVAL), "--out", join(runDir, "asr-result.json"), - "--non-interactive", "--timeout", String(CLI_TIMEOUT_SEC), "--language", diff --git a/packages/cli/tests/stress/targets/speech-synthesize.mjs b/packages/cli/tests/stress/targets/speech-synthesize.mjs index 354f7b1..e6136a3 100644 --- a/packages/cli/tests/stress/targets/speech-synthesize.mjs +++ b/packages/cli/tests/stress/targets/speech-synthesize.mjs @@ -45,7 +45,6 @@ export const runStress = defineStressTarget({ prompt, "--out", `${runDir}/audio_${String(index + 1).padStart(3, "0")}.mp3`, - "--non-interactive", "--output", "json", "--timeout", diff --git a/packages/cli/tests/stress/targets/text-chat.mjs b/packages/cli/tests/stress/targets/text-chat.mjs index 18f2b1c..9286fc4 100644 --- a/packages/cli/tests/stress/targets/text-chat.mjs +++ b/packages/cli/tests/stress/targets/text-chat.mjs @@ -37,7 +37,6 @@ export const runStress = defineStressTarget({ MODEL, "--message", prompt, - "--non-interactive", "--output", "json", "--timeout", diff --git a/packages/cli/tests/stress/targets/video-edit.mjs b/packages/cli/tests/stress/targets/video-edit.mjs index 5ef7666..c6b8d19 100644 --- a/packages/cli/tests/stress/targets/video-edit.mjs +++ b/packages/cli/tests/stress/targets/video-edit.mjs @@ -64,7 +64,6 @@ export const runStress = defineStressTarget({ join(runDir, `edited_${String(index + 1).padStart(3, "0")}.mp4`), "--duration", String(extraParams.DURATION), - "--non-interactive", "--output", "json", "--timeout", diff --git a/packages/cli/tests/stress/targets/video-i2v.mjs b/packages/cli/tests/stress/targets/video-i2v.mjs index b0cecfc..1378d99 100644 --- a/packages/cli/tests/stress/targets/video-i2v.mjs +++ b/packages/cli/tests/stress/targets/video-i2v.mjs @@ -66,7 +66,6 @@ export const runStress = defineStressTarget({ join(runDir, `video_${String(index + 1).padStart(3, "0")}.mp4`), "--duration", String(extraParams.DURATION), - "--non-interactive", "--output", "json", "--timeout", diff --git a/packages/cli/tests/stress/targets/video-ref.mjs b/packages/cli/tests/stress/targets/video-ref.mjs index 480a1eb..ee8577b 100644 --- a/packages/cli/tests/stress/targets/video-ref.mjs +++ b/packages/cli/tests/stress/targets/video-ref.mjs @@ -66,7 +66,6 @@ export const runStress = defineStressTarget({ join(runDir, `ref_${String(index + 1).padStart(3, "0")}.mp4`), "--duration", String(extraParams.DURATION), - "--non-interactive", "--output", "json", "--timeout", diff --git a/packages/cli/tests/stress/targets/video-t2v.mjs b/packages/cli/tests/stress/targets/video-t2v.mjs index dda58a1..2edb944 100644 --- a/packages/cli/tests/stress/targets/video-t2v.mjs +++ b/packages/cli/tests/stress/targets/video-t2v.mjs @@ -79,7 +79,6 @@ export const runStress = defineStressTarget({ join(runDir, `video_${String(index + 1).padStart(3, "0")}.mp4`), "--duration", String(extraParams.DURATION), - "--non-interactive", "--output", "json", "--timeout", diff --git a/packages/commands/src/commands/image/edit.ts b/packages/commands/src/commands/image/edit.ts index 716a772..44a49a9 100644 --- a/packages/commands/src/commands/image/edit.ts +++ b/packages/commands/src/commands/image/edit.ts @@ -11,6 +11,7 @@ import { BailianError, resolveBooleanFlag, resolveWatermark, + CONCURRENT_FLAG, } from "bailian-cli-core"; import { downloadFile } from "bailian-cli-runtime"; import { runConcurrent, downloadParallel, getConcurrency } from "bailian-cli-runtime"; @@ -73,6 +74,7 @@ export default defineCommand({ valueHint: "", description: "Filename prefix (default: edited)", }, + ...CONCURRENT_FLAG, }, exampleArgs: [ '--image ./photo.png --prompt "Replace the background with a beach"', @@ -144,7 +146,7 @@ export default defineCommand({ process.stderr.write(`[Model: ${model}] [Mode: sync] [Images: ${resolvedImages.length}]\n`); } - const concurrent = getConcurrency(settings); + const concurrent = getConcurrency(flags); const results = await runConcurrent(concurrent, settings, () => ctx.client.requestJson({ diff --git a/packages/commands/src/commands/image/generate.ts b/packages/commands/src/commands/image/generate.ts index 7d46d53..f10bf82 100644 --- a/packages/commands/src/commands/image/generate.ts +++ b/packages/commands/src/commands/image/generate.ts @@ -19,6 +19,8 @@ import { generateFilename, resolveBooleanFlag, resolveWatermark, + ASYNC_FLAG, + CONCURRENT_FLAG, } from "bailian-cli-core"; import { poll } from "bailian-cli-runtime"; import { downloadFile } from "bailian-cli-runtime"; @@ -77,6 +79,8 @@ const GENERATE_FLAGS = { type: "switch", description: "Return task ID immediately without waiting (async models only)", }, + ...ASYNC_FLAG, + ...CONCURRENT_FLAG, outDir: { type: "string", valueHint: "", description: "Download images to directory" }, outPrefix: { type: "string", @@ -117,7 +121,7 @@ export default defineCommand({ const sizeInput = flags.size || defaultSize; const size = resolveImageSize(sizeInput, useSync); const n = flags.n ?? 1; - const concurrent = getConcurrency(settings); + const concurrent = getConcurrency(flags); const promptExtend = resolveBooleanFlag( flags.promptExtend, @@ -215,7 +219,7 @@ async function handleAsyncMode( const taskIds = responses.map((r) => r.output.task_id); // --no-wait: return all task IDs immediately - if (flags.noWait || settings.async) { + if (flags.noWait || flags.async) { emitResult({ task_ids: taskIds }, format as OutputFormat); return; } diff --git a/packages/commands/src/commands/quota/request.ts b/packages/commands/src/commands/quota/request.ts index d8695b8..da82c4d 100644 --- a/packages/commands/src/commands/quota/request.ts +++ b/packages/commands/src/commands/quota/request.ts @@ -89,6 +89,7 @@ export default defineCommand({ description: "Target TPM value (required)", required: true, }, + yes: { type: "switch", description: "Skip confirmation prompts" }, }, exampleArgs: [ "--model qwen-turbo --tpm 100000", @@ -100,7 +101,7 @@ export default defineCommand({ const { identity, settings, flags } = ctx; const modelName = flags.model; const tpmValue = Number(flags.tpm); - const autoConfirm = settings.yes; + const autoConfirm = flags.yes; const format = detectOutputFormat(settings.output); if (settings.dryRun) { diff --git a/packages/commands/src/commands/speech/recognize.ts b/packages/commands/src/commands/speech/recognize.ts index 60c2035..1ce520c 100644 --- a/packages/commands/src/commands/speech/recognize.ts +++ b/packages/commands/src/commands/speech/recognize.ts @@ -16,6 +16,7 @@ import { type OutputFormat, type FlagsDef, type ParsedFlags, + ASYNC_FLAG, } from "bailian-cli-core"; import { poll } from "bailian-cli-runtime"; import { emitResult, emitBare } from "bailian-cli-runtime"; @@ -47,6 +48,7 @@ const RECOGNIZE_FLAGS = { description: "Save full transcription result to JSON file", }, noWait: { type: "switch", description: "Return task ID immediately without polling" }, + ...ASYNC_FLAG, pollInterval: { type: "number", valueHint: "", @@ -147,7 +149,7 @@ async function handleAsyncMode( const taskId = response.output.task_id; // --no-wait: return task ID immediately - if (flags.noWait || settings.async) { + if (flags.noWait || flags.async) { emitResult({ task_id: taskId }, format); return; } diff --git a/packages/commands/src/commands/speech/synthesize.ts b/packages/commands/src/commands/speech/synthesize.ts index d372f64..5e6447b 100644 --- a/packages/commands/src/commands/speech/synthesize.ts +++ b/packages/commands/src/commands/speech/synthesize.ts @@ -17,6 +17,7 @@ import { DOCS_HOSTS, type FlagsDef, type ParsedFlags, + CONCURRENT_FLAG, } from "bailian-cli-core"; const COSYVOICE_CLONE_DESIGN_DOC = `${DOCS_HOSTS.cn}/cosyvoice-clone-design-api`; @@ -206,6 +207,7 @@ const SYNTHESIZE_FLAGS = { description: "Save audio to file (default: auto-generate in temp dir)", }, stream: { type: "switch", description: "Stream raw PCM audio to stdout (pipe to player)" }, + ...CONCURRENT_FLAG, } satisfies FlagsDef; type SynthesizeFlags = ParsedFlags; @@ -311,7 +313,7 @@ async function handleNonStreamMode( flags: SynthesizeFlags, format: OutputFormat, ): Promise { - const concurrent = getConcurrency(settings); + const concurrent = getConcurrency(flags); const results = await runConcurrent(concurrent, settings, () => client.requestJson({ diff --git a/packages/commands/src/commands/video/edit.ts b/packages/commands/src/commands/video/edit.ts index 333dbf4..20109f2 100644 --- a/packages/commands/src/commands/video/edit.ts +++ b/packages/commands/src/commands/video/edit.ts @@ -11,6 +11,7 @@ import { ExitCode, resolveBooleanFlag, resolveWatermark, + ASYNC_FLAG, } from "bailian-cli-core"; import { poll } from "bailian-cli-runtime"; import { downloadFile, formatBytes } from "bailian-cli-runtime"; @@ -91,6 +92,7 @@ export default defineCommand({ description: "Save video to file on completion", }, noWait: { type: "switch", description: "Return task ID immediately without waiting" }, + ...ASYNC_FLAG, pollInterval: { type: "number", valueHint: "", @@ -176,7 +178,7 @@ export default defineCommand({ } // --no-wait or --async: return task ID immediately - if (flags.noWait || settings.async) { + if (flags.noWait || flags.async) { emitResult({ task_id: taskId }, format); return; } diff --git a/packages/commands/src/commands/video/generate.ts b/packages/commands/src/commands/video/generate.ts index 53a0c30..ef22cc0 100644 --- a/packages/commands/src/commands/video/generate.ts +++ b/packages/commands/src/commands/video/generate.ts @@ -11,6 +11,8 @@ import { ExitCode, resolveBooleanFlag, resolveWatermark, + ASYNC_FLAG, + CONCURRENT_FLAG, } from "bailian-cli-core"; import { poll } from "bailian-cli-runtime"; import { downloadFile, formatBytes } from "bailian-cli-runtime"; @@ -81,6 +83,8 @@ export default defineCommand({ description: "Save video to file on completion", }, noWait: { type: "switch", description: "Return task ID immediately without waiting" }, + ...ASYNC_FLAG, + ...CONCURRENT_FLAG, pollInterval: { type: "number", valueHint: "", @@ -141,7 +145,7 @@ export default defineCommand({ } // Submit async task(s) — supports --concurrent for parallel generation - const concurrent = getConcurrency(settings); + const concurrent = getConcurrency(flags); const responses = await runConcurrent( concurrent, @@ -163,7 +167,7 @@ export default defineCommand({ } // --no-wait or --async: return task ID(s) immediately - if (flags.noWait || settings.async) { + if (flags.noWait || flags.async) { emitResult(taskIds.length === 1 ? { task_id: taskIds[0] } : { task_ids: taskIds }, format); return; } diff --git a/packages/commands/src/commands/video/ref.ts b/packages/commands/src/commands/video/ref.ts index d739cbc..cf870a9 100644 --- a/packages/commands/src/commands/video/ref.ts +++ b/packages/commands/src/commands/video/ref.ts @@ -11,6 +11,7 @@ import { ExitCode, resolveBooleanFlag, resolveWatermark, + ASYNC_FLAG, } from "bailian-cli-core"; import { poll } from "bailian-cli-runtime"; import { downloadFile, formatBytes } from "bailian-cli-runtime"; @@ -86,6 +87,7 @@ export default defineCommand({ description: "Save video to file on completion", }, noWait: { type: "switch", description: "Return task ID immediately without waiting" }, + ...ASYNC_FLAG, pollInterval: { type: "number", valueHint: "", @@ -196,7 +198,7 @@ export default defineCommand({ } // --no-wait or --async: return task ID immediately - if (flags.noWait || settings.async) { + if (flags.noWait || flags.async) { emitResult({ task_id: taskId }, format); return; } diff --git a/packages/core/src/config/loader.ts b/packages/core/src/config/loader.ts index 6e2c3b4..8fe349e 100644 --- a/packages/core/src/config/loader.ts +++ b/packages/core/src/config/loader.ts @@ -64,7 +64,6 @@ export function buildSettings(s: ResolutionSources): Settings { output: detectOutputFormat(flags.output || env.DASHSCOPE_OUTPUT || file.output), outputDir: file.output_dir || undefined, timeout, - concurrent: flags.concurrent, defaultTextModel: file.default_text_model, defaultVideoModel: file.default_video_model, defaultImageModel: file.default_image_model, @@ -77,10 +76,7 @@ export function buildSettings(s: ResolutionSources): Settings { verbose: flags.verbose || env.DASHSCOPE_VERBOSE === "1", quiet: flags.quiet || false, noColor: flags.noColor || env.NO_COLOR !== undefined || !process.stdout.isTTY, - yes: flags.yes || false, dryRun: flags.dryRun || false, - nonInteractive: flags.nonInteractive || false, - async: flags.async || false, telemetry: env.DO_NOT_TRACK === "1" ? false : (file.telemetry ?? true), }; } diff --git a/packages/core/src/config/schema.ts b/packages/core/src/config/schema.ts index 2f55ad5..d9132f5 100644 --- a/packages/core/src/config/schema.ts +++ b/packages/core/src/config/schema.ts @@ -112,8 +112,6 @@ export interface Settings { output: "text" | "json"; outputDir?: string; timeout: number; - /** `--concurrent`,仅 flag 源。 */ - concurrent?: number; defaultTextModel?: string; defaultVideoModel?: string; defaultImageModel?: string; @@ -126,9 +124,6 @@ export interface Settings { verbose: boolean; quiet: boolean; noColor: boolean; - yes: boolean; dryRun: boolean; - nonInteractive: boolean; - async: boolean; telemetry: boolean; } diff --git a/packages/core/src/telemetry/tracker.ts b/packages/core/src/telemetry/tracker.ts index 1245703..474db60 100644 --- a/packages/core/src/telemetry/tracker.ts +++ b/packages/core/src/telemetry/tracker.ts @@ -11,11 +11,8 @@ const GLOBAL_FLAG_KEYS = new Set([ "verbose", "timeout", "noColor", - "yes", "dryRun", "help", - "nonInteractive", - "async", "console", ]); diff --git a/packages/core/src/types/command.ts b/packages/core/src/types/command.ts index 69fe4ae..6f78fe6 100644 --- a/packages/core/src/types/command.ts +++ b/packages/core/src/types/command.ts @@ -68,20 +68,26 @@ export type AuthRequirement = "apiKey" | "console" | "none"; export const GLOBAL_FLAGS = { output: { type: "string", valueHint: "", description: "Output format: text, json" }, timeout: { type: "number", valueHint: "", description: "Request timeout" }, + quiet: { type: "switch", description: "Suppress non-essential output" }, + verbose: { type: "switch", description: "Print HTTP request/response details" }, + noColor: { type: "switch", description: "Disable ANSI colors" }, + dryRun: { type: "switch", description: "Dry run mode" }, + help: { type: "switch", description: "Show help" }, + version: { type: "switch", description: "Print version" }, +} satisfies FlagsDef; + +/** Command-scoped flag for commands that support parallel API calls. */ +export const CONCURRENT_FLAG = { concurrent: { type: "number", valueHint: "", description: "Run N parallel requests (default: 1)", }, - quiet: { type: "switch", description: "Suppress non-essential output" }, - verbose: { type: "switch", description: "Print HTTP request/response details" }, - noColor: { type: "switch", description: "Disable ANSI colors" }, - dryRun: { type: "switch", description: "Dry run mode" }, - nonInteractive: { type: "switch", description: "Disable interactive prompts" }, - yes: { type: "switch", description: "Skip confirmation prompts" }, +} satisfies FlagsDef; + +/** Command-scoped flag for task-based commands that can return without polling. */ +export const ASYNC_FLAG = { async: { type: "switch", description: "Return async task id without waiting" }, - help: { type: "switch", description: "Show help" }, - version: { type: "switch", description: "Print version" }, } satisfies FlagsDef; /** Model 域凭证/连接 flag,`auth: "apiKey"` 命令可见。 */ diff --git a/packages/core/src/types/index.ts b/packages/core/src/types/index.ts index 78de82a..30a9e83 100644 --- a/packages/core/src/types/index.ts +++ b/packages/core/src/types/index.ts @@ -10,6 +10,8 @@ export { defineCommand, credentialFlagDefs, GLOBAL_FLAGS, + CONCURRENT_FLAG, + ASYNC_FLAG, MODEL_AUTH_FLAGS, CONSOLE_AUTH_FLAGS, } from "./command.ts"; diff --git a/packages/core/tests/config-priority.test.ts b/packages/core/tests/config-priority.test.ts index 20a980f..5b1c6e5 100644 --- a/packages/core/tests/config-priority.test.ts +++ b/packages/core/tests/config-priority.test.ts @@ -140,28 +140,17 @@ test("default*Model / outputDir:仅 file 源", () => { expect(resolve({}).defaultTextModel).toBeUndefined(); }); -test("buildSettings:concurrent 仅 flag 源", () => { - expect(resolve({ flags: { concurrent: 4 } }).concurrent).toBe(4); - expect(resolve({}).concurrent).toBeUndefined(); -}); - -test("quiet/yes/dryRun/async/nonInteractive:仅 flag 源,直通", () => { +test("quiet/dryRun:仅 flag 源,直通", () => { const on = resolve({ - flags: { quiet: true, yes: true, dryRun: true, async: true, nonInteractive: true }, + flags: { quiet: true, dryRun: true }, }); expect(on).toMatchObject({ quiet: true, - yes: true, dryRun: true, - async: true, - nonInteractive: true, }); const off = resolve({}); expect(off).toMatchObject({ quiet: false, - yes: false, dryRun: false, - async: false, - nonInteractive: false, }); }); diff --git a/packages/core/tests/index.test.ts b/packages/core/tests/index.test.ts index 8cda549..69cf56b 100644 --- a/packages/core/tests/index.test.ts +++ b/packages/core/tests/index.test.ts @@ -23,10 +23,7 @@ function testDeps(identity: Partial = {}): { identity: Identity; setti verbose: false, quiet: true, noColor: true, - yes: true, dryRun: false, - nonInteractive: true, - async: false, telemetry: true, }, }; diff --git a/packages/runtime/src/pipeline/bl-config.ts b/packages/runtime/src/pipeline/bl-config.ts index 19789c6..230e209 100644 --- a/packages/runtime/src/pipeline/bl-config.ts +++ b/packages/runtime/src/pipeline/bl-config.ts @@ -19,14 +19,13 @@ export interface PipelineEnv { /** * Build the in-process env for pipeline steps. Uses the same source resolution * as the CLI itself (env vars, config file; no CLI flags), but forces JSON - * output + non-interactive + quiet mode. + * output + quiet mode. */ export function buildPipelineEnv(): PipelineEnv { const sources: ResolutionSources = { flags: {}, file: readConfigFile(), env: process.env }; const settings: Settings = { ...buildSettings(sources), output: "json", - nonInteractive: true, noColor: true, quiet: true, }; diff --git a/packages/runtime/src/utils/concurrent.ts b/packages/runtime/src/utils/concurrent.ts index 3f0598e..7e7c11a 100644 --- a/packages/runtime/src/utils/concurrent.ts +++ b/packages/runtime/src/utils/concurrent.ts @@ -2,7 +2,7 @@ * Generic concurrent execution utility. * * Allows any command to run N parallel API requests and aggregate results. - * Used via the global `--concurrent ` flag. + * Used by commands that declare `--concurrent `. * * @example * const results = await runConcurrent(3, config, () => callApi()); @@ -10,9 +10,9 @@ import type { Settings } from "bailian-cli-core"; -/** Resolve concurrency from settings(`--concurrent`,defaults to 1). */ -export function getConcurrency(settings: Settings): number { - return Math.max(1, settings.concurrent ?? 1); +/** Resolve concurrency from parsed command flags(`--concurrent`,defaults to 1). */ +export function getConcurrency(flags: { concurrent?: number }): number { + return Math.max(1, flags.concurrent ?? 1); } /** diff --git a/skills/bailian-cli/SKILL.md b/skills/bailian-cli/SKILL.md index cea0b9d..427c87b 100644 --- a/skills/bailian-cli/SKILL.md +++ b/skills/bailian-cli/SKILL.md @@ -184,7 +184,7 @@ When a `bl` command **fails** and the cause is **not** a user/service-side error 1. Classify the failure using [`assets/issue-reporting.md`](assets/issue-reporting.md) (EXCLUDE vs INCLUDE tables). 2. If INCLUDE matches, ask the user (Chinese prompt in that doc). If they agree, collect environment info, redact secrets, fill the issue template, and submit to https://github.com/modelstudioai/cli/issues (browser or `gh issue create`). 3. Before offering: align skill/CLI versions and retry with `--verbose` / `--output json` when output is thin. -4. Do **not** ask in CI or when `--non-interactive` is set unless the user explicitly wants to report. +4. Do **not** ask in CI or non-TTY automation unless the user explicitly wants to report. Full workflow, redaction rules, template, and exit-code reference: [`assets/issue-reporting.md`](assets/issue-reporting.md). diff --git a/skills/bailian-cli/assets/issue-reporting.md b/skills/bailian-cli/assets/issue-reporting.md index a2082be..929e577 100644 --- a/skills/bailian-cli/assets/issue-reporting.md +++ b/skills/bailian-cli/assets/issue-reporting.md @@ -126,7 +126,7 @@ If it still fails with INCLUDE signals → offer reporting. | Situation | Behavior | | ----------------------------- | -------------------------------------------------------------------------------- | -| **CI / `--non-interactive`** | Do **not** ask proactively. Only report if the user explicitly requests it. | +| **CI / non-TTY automation** | Do **not** ask proactively. Only report if the user explicitly requests it. | | **Same error in one session** | Ask **at most once** per distinct failure. | | **User declines** | Stop asking; continue troubleshooting or alternate tools. | | **Secrets** | Never paste raw API keys or tokens into the issue (see [Redaction](#redaction)). | diff --git a/skills/bailian-cli/reference/image.md b/skills/bailian-cli/reference/image.md index 9e877f3..139052d 100644 --- a/skills/bailian-cli/reference/image.md +++ b/skills/bailian-cli/reference/image.md @@ -37,6 +37,7 @@ Index: [index.md](index.md) | `--watermark ` | boolean | no | Enable watermark (true/false). Omit flag to use CLI default (true). | | `--out-dir ` | string | no | Download images to directory | | `--out-prefix ` | string | no | Filename prefix (default: edited) | +| `--concurrent ` | number | no | Run N parallel requests (default: 1) | | `--api-key ` | string | no | API key | | `--base-url ` | string | no | API base URL | @@ -83,6 +84,8 @@ bl image edit --image ./photo.png --prompt "Replace the background with a beach" | `--prompt-extend ` | boolean | no | Enable prompt extend (true/false). Omit flag: true for qwen-image sync; parameter omitted on async models (API default). | | `--watermark ` | boolean | no | Enable watermark (true/false). Omit flag to use CLI default (true). | | `--no-wait` | switch | no | Return task ID immediately without waiting (async models only) | +| `--async` | switch | no | Return async task id without waiting | +| `--concurrent ` | number | no | Run N parallel requests (default: 1) | | `--out-dir ` | string | no | Download images to directory | | `--out-prefix ` | string | no | Filename prefix (default: image) | | `--poll-interval ` | number | no | Polling interval when waiting (default: 3) | diff --git a/skills/bailian-cli/reference/index.md b/skills/bailian-cli/reference/index.md index cfb4e4f..3ccc675 100644 --- a/skills/bailian-cli/reference/index.md +++ b/skills/bailian-cli/reference/index.md @@ -86,20 +86,16 @@ Use this index for the full quick index and global flags. Available on every command (in addition to command-specific flags): -| Flag | Type | Required | Description | -| --------------------- | ------ | -------- | ------------------------------------ | -| `--output ` | string | no | Output format: text, json | -| `--timeout ` | number | no | Request timeout | -| `--concurrent ` | number | no | Run N parallel requests (default: 1) | -| `--quiet` | switch | no | Suppress non-essential output | -| `--verbose` | switch | no | Print HTTP request/response details | -| `--no-color` | switch | no | Disable ANSI colors | -| `--dry-run` | switch | no | Dry run mode | -| `--non-interactive` | switch | no | Disable interactive prompts | -| `--yes` | switch | no | Skip confirmation prompts | -| `--async` | switch | no | Return async task id without waiting | -| `--help` | switch | no | Show help | -| `--version` | switch | no | Print version | +| Flag | Type | Required | Description | +| --------------------- | ------ | -------- | ----------------------------------- | +| `--output ` | string | no | Output format: text, json | +| `--timeout ` | number | no | Request timeout | +| `--quiet` | switch | no | Suppress non-essential output | +| `--verbose` | switch | no | Print HTTP request/response details | +| `--no-color` | switch | no | Disable ANSI colors | +| `--dry-run` | switch | no | Dry run mode | +| `--help` | switch | no | Show help | +| `--version` | switch | no | Print version | ## Model auth flags diff --git a/skills/bailian-cli/reference/quota.md b/skills/bailian-cli/reference/quota.md index 2701dbf..dae12b6 100644 --- a/skills/bailian-cli/reference/quota.md +++ b/skills/bailian-cli/reference/quota.md @@ -154,6 +154,7 @@ bl quota list --output json | ------------------------------ | ------ | -------- | -------------------------------------------------------- | | `--model ` | string | yes | Model name (required) | | `--tpm ` | string | yes | Target TPM value (required) | +| `--yes` | switch | no | Skip confirmation prompts | | `--console-region ` | string | no | Console gateway region (e.g. cn-beijing, ap-southeast-1) | | `--console-site ` | string | no | Console site: domestic, international | | `--console-switch-agent ` | number | no | Switch agent UID for delegated access | diff --git a/skills/bailian-cli/reference/speech.md b/skills/bailian-cli/reference/speech.md index 6df7591..f519483 100644 --- a/skills/bailian-cli/reference/speech.md +++ b/skills/bailian-cli/reference/speech.md @@ -35,6 +35,7 @@ Index: [index.md](index.md) | `--channel-id ` | number | no | Audio channel ID (default: 0) | | `--out ` | string | no | Save full transcription result to JSON file | | `--no-wait` | switch | no | Return task ID immediately without polling | +| `--async` | switch | no | Return async task id without waiting | | `--poll-interval ` | number | no | Polling interval in seconds (default: 2) | | `--api-key ` | string | no | API key | | `--base-url ` | string | no | API base URL | @@ -97,6 +98,7 @@ bl speech recognize --url https://example.com/audio.mp3 --no-wait --quiet | `--enable-ssml` | switch | no | Enable SSML markup parsing in input text | | `--out ` | string | no | Save audio to file (default: auto-generate in temp dir) | | `--stream` | switch | no | Stream raw PCM audio to stdout (pipe to player) | +| `--concurrent ` | number | no | Run N parallel requests (default: 1) | | `--api-key ` | string | no | API key | | `--base-url ` | string | no | API base URL | diff --git a/skills/bailian-cli/reference/video.md b/skills/bailian-cli/reference/video.md index f7cb4a4..5485ba8 100644 --- a/skills/bailian-cli/reference/video.md +++ b/skills/bailian-cli/reference/video.md @@ -70,6 +70,7 @@ bl video download --task-id 3b256896-xxxx --out video.mp4 --quiet | `--seed ` | number | no | Random seed for reproducible generation | | `--download ` | string | no | Save video to file on completion | | `--no-wait` | switch | no | Return task ID immediately without waiting | +| `--async` | switch | no | Return async task id without waiting | | `--poll-interval ` | number | no | Polling interval when waiting (default: 15) | | `--api-key ` | string | no | API key | | `--base-url ` | string | no | API base URL | @@ -116,6 +117,8 @@ bl video edit --video https://example.com/input.mp4 --prompt "Put clothes on the | `--seed ` | number | no | Random seed for reproducible generation | | `--download ` | string | no | Save video to file on completion | | `--no-wait` | switch | no | Return task ID immediately without waiting | +| `--async` | switch | no | Return async task id without waiting | +| `--concurrent ` | number | no | Run N parallel requests (default: 1) | | `--poll-interval ` | number | no | Polling interval when waiting (default: 5) | | `--api-key ` | string | no | API key | | `--base-url ` | string | no | API base URL | @@ -168,6 +171,7 @@ bl video generate --prompt "A cat playing with a ball" --watermark false | `--seed ` | number | no | Random seed for reproducible generation | | `--download ` | string | no | Save video to file on completion | | `--no-wait` | switch | no | Return task ID immediately without waiting | +| `--async` | switch | no | Return async task id without waiting | | `--poll-interval ` | number | no | Polling interval when waiting (default: 15) | | `--api-key ` | string | no | API key | | `--base-url ` | string | no | API base URL |