Skip to content

Commit ed78e84

Browse files
lin.zhangcz-cli
andcommitted
refactor: rename gateway command to ai-gateway
Co-Authored-By: cz-cli <noreply@clickzetta.com>
1 parent c0dd862 commit ed78e84

4 files changed

Lines changed: 17 additions & 17 deletions

File tree

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@ cz-cli <command> [options]
5858
| `runs list` | View task run history |
5959
| `job <job_id>` | Inspect job execution details |
6060
| `datasource list` | List external data sources |
61-
| `gateway key list` | List AI Gateway virtual keys |
62-
| `gateway key create <alias>` | Create a virtual key |
63-
| `gateway model list [key]` | List available models |
61+
| `ai-gateway key list` | List AI Gateway virtual keys |
62+
| `ai-gateway key create <alias>` | Create a virtual key |
63+
| `ai-gateway model list [key]` | List available models |
6464
| `profile list` | Manage connection profiles |
6565
| `setup` | Interactive configuration wizard |
6666

packages/cz-cli/src/cli.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ export function createCli(args: string[]) {
108108
const aiMessage = "Run the command with --help to see available options and usage."
109109
const message = (msg && msg.trim() !== "") ? msg : (() => {
110110
const KNOWN_FLAGS = new Set(["profile", "p", "jdbc", "pat", "username", "password", "service", "protocol", "instance", "workspace", "schema", "s", "vcluster", "v", "format", "field", "debug", "d", "help", "h", "version"])
111-
const KNOWN_COMMANDS = new Set(["sql", "schema", "table", "workspace", "status", "profile", "task", "runs", "attempts", "job", "agent", "setup", "update", "ai-guide","datasource","gateway"])
111+
const KNOWN_COMMANDS = new Set(["sql", "schema", "table", "workspace", "status", "profile", "task", "runs", "attempts", "job", "agent", "setup", "update", "ai-guide","datasource","ai-gateway"])
112112
const unknownFlags = args.filter((a) => a.startsWith("-")).map((a) => a.replace(/^-+/, "").split("=")[0]).filter((a) => !KNOWN_FLAGS.has(a))
113113
if (unknownFlags.length > 0) return `Unknown argument: ${unknownFlags[0]}`
114114
const topLevelCmd = args.find((a) => !a.startsWith("-"))

packages/cz-cli/src/commands/gateway.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ function buildRoutingRule(argv: Dict): Dict | undefined {
211211
}
212212

213213
export function registerGatewayCommand(cli: Argv<GlobalArgs>): void {
214-
cli.command("gateway", "Manage ClickZetta AI Gateway virtual keys and list available models", (yargs) => {
214+
cli.command("ai-gateway", "Manage ClickZetta AI Gateway virtual keys and list available models", (yargs) => {
215215
yargs
216216
.command("key", "Manage AI Gateway virtual keys", (k) => {
217217
k
@@ -458,7 +458,7 @@ export function registerGatewayCommand(cli: Argv<GlobalArgs>): void {
458458
}
459459
},
460460
)
461-
return commandGroup(k, "gateway key")
461+
return commandGroup(k, "ai-gateway key")
462462
})
463463
// ── model list ───────────────────────────────────────────────────────
464464
.command("model", "Browse AI Gateway models", (m) => {
@@ -494,9 +494,9 @@ export function registerGatewayCommand(cli: Argv<GlobalArgs>): void {
494494
}
495495
},
496496
)
497-
return commandGroup(m, "gateway model")
497+
return commandGroup(m, "ai-gateway model")
498498
})
499-
return commandGroup(yargs, "gateway")
499+
return commandGroup(yargs, "ai-gateway")
500500
})
501501
}
502502

packages/opencode/src/session/prompt/cz-cli-inner.txt

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -83,17 +83,17 @@ cz-cli datasource test <name_or_id> Test data source connectivity
8383
cz-cli datasource sample <name_or_id> <catalog> <object>
8484
Get sample data from an object
8585

86-
cz-cli gateway key list List AI Gateway virtual keys
87-
cz-cli gateway key create <alias> Create a virtual key (--period daily|weekly|monthly|total --quota N)
86+
cz-cli ai-gateway key list List AI Gateway virtual keys
87+
cz-cli ai-gateway key create <alias> Create a virtual key (--period daily|weekly|monthly|total --quota N)
8888
Use --add-to-llm [name] to register as [llm.<name>]; --use to set as default_llm
89-
cz-cli gateway key upsert <alias> Create or update a virtual key (idempotent)
90-
cz-cli gateway key get <vApiKey> Show full key value; --add-to-llm to register
91-
cz-cli gateway key set-quota --key K --period P --quota N
89+
cz-cli ai-gateway key upsert <alias> Create or update a virtual key (idempotent)
90+
cz-cli ai-gateway key get <vApiKey> Show full key value; --add-to-llm to register
91+
cz-cli ai-gateway key set-quota --key K --period P --quota N
9292
Update quota on a key
93-
cz-cli gateway key enable <vApiKey> Enable a virtual key
94-
cz-cli gateway key disable <vApiKey> Disable a virtual key
95-
cz-cli gateway key delete <vApiKey> Delete a virtual key; --remove-from-llm to also remove [llm.*] entry
96-
cz-cli gateway model list [key] List models available to a virtual key
93+
cz-cli ai-gateway key enable <vApiKey> Enable a virtual key
94+
cz-cli ai-gateway key disable <vApiKey> Disable a virtual key
95+
cz-cli ai-gateway key delete <vApiKey> Delete a virtual key; --remove-from-llm to also remove [llm.*] entry
96+
cz-cli ai-gateway model list [key] List models available to a virtual key
9797
```
9898

9999
## Output Formats

0 commit comments

Comments
 (0)