Skip to content

Commit 503e146

Browse files
lishengzxcclaude
andcommitted
refactor: rename bl agent setup to bl config agent and reorganize files
Move agent configuration command under the `config` command group for better semantic alignment. Relocate all related files from `commands/agent/` into `commands/config/agent/`. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 64473c6 commit 503e146

17 files changed

Lines changed: 62 additions & 76 deletions

File tree

packages/cli/src/commands/catalog.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ import quotaList from "./quota/list.ts";
4646
import quotaRequest from "./quota/request.ts";
4747
import quotaHistory from "./quota/history.ts";
4848
import quotaCheck from "./quota/check.ts";
49-
import agentSetup from "./agent/setup.ts";
49+
import agentSetup from "./config/agent/index.ts";
5050

5151
/** Command registry map (no dependency on registry.ts — safe for build-time import). */
5252
export const commands: Record<string, Command> = {
@@ -95,6 +95,6 @@ export const commands: Record<string, Command> = {
9595
"quota request": quotaRequest,
9696
"quota history": quotaHistory,
9797
"quota check": quotaCheck,
98-
"agent setup": agentSetup,
98+
"config agent": agentSetup,
9999
update: update,
100100
};

packages/cli/src/commands/agent/setup.ts renamed to packages/cli/src/commands/config/agent/index.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ import {
99
import { AGENTS, VALID_AGENT_NAMES, type WriteParams } from "./writers.ts";
1010

1111
export default defineCommand({
12-
name: "agent setup",
12+
name: "config agent",
1313
description: "Configure a coding agent to use DashScope API",
1414
skipDefaultApiKeySetup: true,
15-
usage: "bl agent setup --agent <name> --base-url <url> --api-key <key> --model <model>",
15+
usage: "bl config agent --agent <name> --base-url <url> --api-key <key> --model <model>",
1616
options: [
1717
{
1818
flag: "--agent <name>",
@@ -23,12 +23,12 @@ export default defineCommand({
2323
{ flag: "--model <model>", description: "Default model name" },
2424
],
2525
examples: [
26-
"npx bailian-cli agent setup --agent claude-code --base-url https://dashscope.aliyuncs.com/apps/anthropic --api-key sk-xxxxx --model qwen3.7-max",
27-
"npx bailian-cli agent setup --agent qwen-code --base-url https://dashscope.aliyuncs.com/compatible-mode/v1 --api-key sk-xxxxx --model qwen3.6-plus",
28-
"npx bailian-cli agent setup --agent opencode --base-url https://dashscope.aliyuncs.com/apps/anthropic/v1 --api-key sk-xxxxx --model qwen3.7-max",
29-
"npx bailian-cli agent setup --agent openclaw --base-url https://dashscope.aliyuncs.com/apps/anthropic --api-key sk-xxxxx --model qwen3.6-plus",
30-
"npx bailian-cli agent setup --agent hermes --base-url https://dashscope.aliyuncs.com/apps/anthropic --api-key sk-xxxxx --model qwen3.7-max",
31-
"npx bailian-cli agent setup --agent codex --base-url https://dashscope.aliyuncs.com/compatible-mode/v1 --api-key sk-xxxxx --model qwen3.7-max",
26+
"npx bailian-cli config agent --agent claude-code --base-url https://dashscope.aliyuncs.com/apps/anthropic --api-key sk-xxxxx --model qwen3.7-max",
27+
"npx bailian-cli config agent --agent qwen-code --base-url https://dashscope.aliyuncs.com/compatible-mode/v1 --api-key sk-xxxxx --model qwen3.6-plus",
28+
"npx bailian-cli config agent --agent opencode --base-url https://dashscope.aliyuncs.com/apps/anthropic/v1 --api-key sk-xxxxx --model qwen3.7-max",
29+
"npx bailian-cli config agent --agent openclaw --base-url https://dashscope.aliyuncs.com/apps/anthropic --api-key sk-xxxxx --model qwen3.6-plus",
30+
"npx bailian-cli config agent --agent hermes --base-url https://dashscope.aliyuncs.com/apps/anthropic --api-key sk-xxxxx --model qwen3.7-max",
31+
"npx bailian-cli config agent --agent codex --base-url https://dashscope.aliyuncs.com/compatible-mode/v1 --api-key sk-xxxxx --model qwen3.7-max",
3232
],
3333
async run(_config: Config, flags: GlobalFlags) {
3434
const agent = flags.agent as string | undefined;
@@ -40,7 +40,7 @@ export default defineCommand({
4040
throw new BailianError(
4141
"All flags are required: --agent, --base-url, --api-key, --model",
4242
ExitCode.USAGE,
43-
"bl agent setup --agent <name> --base-url <url> --api-key <key> --model <model>",
43+
"bl config agent --agent <name> --base-url <url> --api-key <key> --model <model>",
4444
);
4545
}
4646

packages/cli/src/commands/agent/scripts/pure/agent-setup.ps1 renamed to packages/cli/src/commands/config/agent/scripts/pure/agent-setup.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Bailian — Pure Agent Setup (no Node.js / npx required)
1+
# Bailian — Pure Agent Config (no Node.js / npx required)
22
#
33
# Directly writes config files for coding agents to use DashScope API.
44
#

packages/cli/src/commands/agent/scripts/pure/agent-setup.sh renamed to packages/cli/src/commands/config/agent/scripts/pure/agent-setup.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env bash
2-
# Bailian — Pure Agent Setup (no Node.js / npx required)
2+
# Bailian — Pure Agent Config (no Node.js / npx required)
33
#
44
# Directly writes config files for coding agents to use DashScope API.
55
#

packages/cli/src/commands/agent/scripts/via-bailian-cli/agent-setup.ps1 renamed to packages/cli/src/commands/config/agent/scripts/via-bailian-cli/agent-setup.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ if (-not $Agent -or -not $BaseUrl -or -not $ApiKey -or -not $Model) {
6363

6464
Test-Node
6565

66-
$npxArgs = @("bailian-cli@latest", "agent", "setup",
66+
$npxArgs = @("bailian-cli@latest", "config", "agent",
6767
"--agent", $Agent,
6868
"--base-url", $BaseUrl,
6969
"--api-key", $ApiKey,

packages/cli/src/commands/agent/scripts/via-bailian-cli/agent-setup.sh renamed to packages/cli/src/commands/config/agent/scripts/via-bailian-cli/agent-setup.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ done
100100

101101
check_node
102102

103-
log_info "Running: npx bailian-cli@latest agent setup $*"
103+
log_info "Running: npx bailian-cli@latest config agent $*"
104104
echo ""
105105

106-
npx bailian-cli@latest agent setup "$@"
106+
npx bailian-cli@latest config agent "$@"
File renamed without changes.

packages/cli/src/commands/agent/writers/claude-code.ts renamed to packages/cli/src/commands/config/agent/writers/claude-code.ts

File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)