A local-first multi-agent app development platform, built on PenguinHarness
feat(cli,core,docs): penguin config model remove (#273)
GaoYuYangab8181a0d82f
diff --git a/changelog/unreleased/2026-08-11-cli-model-remove.md b/changelog/unreleased/2026-08-11-cli-model-remove.mdnew file mode 100644index 00000000..8a481877--- /dev/null+++ b/changelog/unreleased/2026-08-11-cli-model-remove.md@@ -0,0 +1,7 @@+# CLI: `penguin config model remove` closes the model CRUD gap++`penguin config model` could add an entry, list entries and point the default / vision settings at one, but never delete one — while its sibling `config vault` has had `remove` all along. Dropping a stale model, or a credential inlined on it, meant reaching for the Web App's models page or hand-editing `.project_config.toml`, which that file's own contract rules out: it is written with mode 0600 and read/written only through the system interfaces.++- `penguin config model remove --model-id <id> --provider <group>` deletes a model entry along with the credential stored inline on it. Both halves of the reference are required and matched exactly, so the same upstream id under another provider group is left alone — the same no-guessing rule the other `model` subcommands follow, here guarding a delete rather than a credential write. A pair that is not in the config is reported on stderr with a non-zero exit code, mirroring `vault remove`.+- `default_model` / `vision_model` are cleared when they named the removed entry, matching what the models page already does on delete. A pointer left naming a model that is no longer configured fails the next `createSession` outright, so the confirmation line carries the resulting default model, and calls out the vision setting when this removal is what unset it.+- New core `removeModel(root, projectId, ref)`, idempotent like `removeVaultEntry`: an absent pair is not an error and writes nothing, leaving the caller to decide whether that deserves a message.diff --git a/changelog/unreleased/README.md b/changelog/unreleased/README.mdindex 1f3ae86c..3c9b8c12 100644--- a/changelog/unreleased/README.md+++ b/changelog/unreleased/README.md@@ -2,3 +2,4 @@- [2026-08-14] Match the macOS app icon's visual size to neighbouring apps. ([details](2026-08-14-macos-app-icon-size.md))- [2026-08-14] Unknown model IDs can be moved to Custom with the OpenAI-compatible client. ([details](2026-08-14-model-group-protocol.md))+- [2026-08-11] CLI: `penguin config model remove --model-id <id> --provider <group>` deletes a model entry and the credential inlined on it, matched on the exact pair so a same-id entry under another group is left alone; the `default_model` / `vision_model` settings are cleared when they named the removed entry, matching what the Web App's models page already does on delete. ([details](2026-08-11-cli-model-remove.md))diff --git a/packages/cli/src/commands/config.ts b/packages/cli/src/commands/config.tsindex 4dd42c50..3e1f710c 100644--- a/packages/cli/src/commands/config.ts+++ b/packages/cli/src/commands/config.ts@@ -6,6 +6,7 @@* penguin config model default --model-id <upstream id> --provider <group> [--root <dir>]* penguin config model vision --model-id <upstream id> --provider <group> [--root <dir>]* penguin config model list [--root <dir>]+ * penguin config model remove --model-id <upstream id> --provider <group> [--root <dir>]* penguin config vault set --key <name> --value <value> [--agent-id <id>] [--root <dir>]* penguin config vault list [--agent-id <id>] [--root <dir>]* penguin config vault remove --key <name> [--agent-id <id>] [--root <dir>]@@ -13,13 +14,15 @@** `--model-id` always takes the **upstream id** (the request id sent to AgentHub verbatim),* which together with `--provider` forms a `(provider, model_id)` paired reference —- * **no string concatenation is ever performed**. `--provider` is **required** on all three- * model subcommands: the group is never guessed, so `--api-key` can never land on a vendor- * the user did not name. For `model add`, a new entry's client_type defaults according to- * the group's semantics (not set for first-party vendors; openai for custom / self-hosted+ * **no string concatenation is ever performed**. `--provider` is **required** on every model+ * subcommand that names an entry: the group is never guessed, so `--api-key` can never land on+ * a vendor the user did not name. For `model add`, a new entry's client_type defaults according+ * to the group's semantics (not set for first-party vendors; openai for custom / self-hosted* groups / gateways, with the gateway's endpoint base URL pre-filled). For `model default`* / `model vision`, core validation raises an error when the reference is not- * found in models. `--root` specifies the data root directory (priority: option >+ * found in models; `model remove` reports the same condition itself, since removal is+ * idempotent in core, and clears the default / vision pointers that named the removed entry.+ * `--root` specifies the data root directory (priority: option >* PENGUIN_HOME > ~/.penguin/data). The UI language is controlled by the PENGUIN_LANG* environment variable; `config lang` writes it into the shell startup file and restarts* the shell to take effect.@@ -42,6 +45,7 @@ import {loadAgentVault,loadProjectConfig,providerInfo,+ removeModel,removeVaultEntry,resolveRoot,setDefaultModel,@@ -252,6 +256,38 @@ export function registerConfigCommand(program: Command, t: Messages): void {}});+ model+ .command("remove")+ .description(t.config.removeDesc)+ .requiredOption("--model-id <id>", t.config.refModelId)+ .requiredOption("--provider <group>", t.config.refProvider)+ .option("--project-id <id>", t.common.projectId, DEFAULT_PROJECT_ID)+ .option("--root <dir>", t.common.root)+ .action(async (opts) => {+ const root = resolveRootOption(opts.root);+ // Paired reference semantics match `model default` / `model vision`. removeModel is+ // idempotent, so whether a missing entry is worth reporting is decided here — same+ // shape as `vault remove`, which also checks first and exits non-zero.+ const ref: ModelRef = { provider: opts.provider, model_id: opts.modelId };+ const before = await loadProjectConfig(root, opts.projectId);+ if (getModel(before, ref) === undefined) {+ process.stderr.write(`${t.modelNotConfigured(formatModelRef(ref))}\n`);+ process.exitCode = 1;+ return;+ }+ const cfg = await removeModel(root, opts.projectId, ref);+ // The default model rides along on the confirmation (as it does for add/update) because+ // removing the model it named leaves it unset, and the next run would otherwise fail with+ // a config error nobody would connect to this command. The vision pointer is rarer, so it+ // only speaks up when this removal is what cleared it.+ process.stdout.write(+ `${t.modelRemoved(formatModelRef(ref), cfg.default_model && formatModelRef(cfg.default_model))}\n`,+ );+ if (before.vision_model !== undefined && cfg.vision_model === undefined) {+ process.stdout.write(`${t.visionModelCleared()}\n`);+ }+ });+const vault = config.command("vault").description(t.config.vaultDesc);vaultdiff --git a/packages/cli/src/i18n.ts b/packages/cli/src/i18n.tsindex e2177b93..5515f33c 100644--- a/packages/cli/src/i18n.ts+++ b/packages/cli/src/i18n.ts@@ -56,11 +56,12 @@ export interface Messages {addSetDefault: string;defaultDesc: string;visionDesc: string;- /** `model default` / `model vision`'s --model-id: the upstream request id (pairs with --provider as a reference). */+ /** `model default` / `model vision` / `model remove`'s --model-id: the upstream request id (pairs with --provider as a reference). */refModelId: string;- /** `model default` / `model vision`'s --provider: the provider group of the referenced entry (required). */+ /** `model default` / `model vision` / `model remove`'s --provider: the provider group of the referenced entry (required). */refProvider: string;listDesc: string;+ removeDesc: string;langDesc: string;langArg: string;vaultDesc: string;@@ -230,11 +231,16 @@ export interface Messages {langRestartConfirm(): string;langRestart(): string;langRestartHint(rcPath: string): string;- /** Result output for model add/default/vision: the argument is the already-formatted pair reference (formatModelRef). */+ /** Result output for model add/default/vision/remove: the argument is the already-formatted pair reference (formatModelRef). */modelAdded(model: string, defaultModel: string | undefined): string;modelUpdated(model: string, defaultModel: string | undefined): string;defaultModelSet(model: string): string;visionModelSet(model: string): string;+ modelRemoved(model: string, defaultModel: string | undefined): string;+ /** `model remove` on a pair the Project config doesn't have. */+ modelNotConfigured(model: string): string;+ /** Follows modelRemoved when the removed entry was also the vision model. */+ visionModelCleared(): string;modelListTitle(): string;modelListEmpty(): string;vaultSet(key: string): string;@@ -320,6 +326,7 @@ const en: Messages = {refModelId: "Upstream model id; forms the (provider, model_id) pair reference with --provider",refProvider: "Provider group of the referenced entry (see `penguin config model list`)",listDesc: "List the Project's models (API keys hidden)",+ removeDesc: "Remove a model from the Project (clears the default / vision pointers naming it)",langDesc:"Set the interface language (en|zh); persists PENGUIN_LANG to your shell startup file",langArg: "Language: en or zh",@@ -492,6 +499,9 @@ const en: Messages = {modelUpdated: (model, def) => `Updated model ${model}. Default model: ${def ?? "(unset)"}`,defaultModelSet: (model) => `Default model set to ${model}.`,visionModelSet: (model) => `Vision model set to ${model}.`,+ modelRemoved: (model, def) => `Removed model ${model}. Default model: ${def ?? "(unset)"}`,+ modelNotConfigured: (model) => `Model ${model} is not in the Project config.`,+ visionModelCleared: () => "It was also the vision model; that setting is now unset.",modelListTitle: () => "Configured models:",modelListEmpty: () => "No models configured yet. Add one with `penguin config model add`.",vaultSet: (key) => `Saved vault entry ${key}.`,@@ -559,6 +569,7 @@ const zh: Messages = {refModelId: "上游模型 id;与 --provider 构成 (provider, model_id) 成对引用",refProvider: "引用条目的 provider 分组(见 `penguin config model list`)",listDesc: "列出当前 Project 的模型(API key 隐藏)",+ removeDesc: "从当前 Project 删除一个模型(指向它的默认模型 / 视觉模型设置一并清空)",langDesc: "设置界面语言(en|zh);将 PENGUIN_LANG 写入 shell 启动文件并持久化",langArg: "语言:en 或 zh",vaultDesc: "管理 Agent vault(注入该 Agent shell 命令的环境变量)",@@ -726,6 +737,9 @@ const zh: Messages = {modelUpdated: (model, def) => `已更新模型 ${model}。当前默认模型:${def ?? "(未设置)"}`,defaultModelSet: (model) => `默认模型已设为 ${model}。`,visionModelSet: (model) => `视觉模型已设为 ${model}。`,+ modelRemoved: (model, def) => `已删除模型 ${model}。当前默认模型:${def ?? "(未设置)"}`,+ modelNotConfigured: (model) => `模型 ${model} 不在当前 Project 配置中。`,+ visionModelCleared: () => "它同时是视觉模型,该设置已一并清空。",modelListTitle: () => "已配置的模型:",modelListEmpty: () => "尚未配置任何模型。用 `penguin config model add` 添加。",vaultSet: (key) => `已保存 vault 条目 ${key}。`,diff --git a/packages/cli/test/config-model.test.ts b/packages/cli/test/config-model.test.tsindex 010c2d2b..6cd97b74 100644--- a/packages/cli/test/config-model.test.ts+++ b/packages/cli/test/config-model.test.ts@@ -1,10 +1,11 @@/**- * Integration tests for `penguin config model add|default|vision|list` (run through+ * Integration tests for `penguin config model add|default|vision|list|remove` (run through* commander's parseAsync for the full command path): --model-id always takes the* upstream id, paired with --provider to form a (provider, model_id) reference- * (--provider is required on all three subcommands — the group is never inferred — and- * default / vision raise an error when the reference isn't found in models; no string- * concatenation is ever performed); --root+ * (--provider is required on every subcommand that names an entry — the group is never+ * inferred — and default / vision / remove report an error when the reference isn't found in+ * models; no string concatenation is ever performed); remove also clears the default /+ * vision pointers that named the removed entry; --root* specifies the data root directory (takes priority over PENGUIN_HOME); persisted to a* single hidden .project_config.toml (mode 0600, credentials inline, provider and* model_id as separate columns); list displays provider and model_id as separate@@ -400,3 +401,197 @@ describe("model add/default/vision: --provider is required, (provider, model_id)});});});++describe("penguin config model remove", () => {+ /** Reads back the persisted config, whose pointers are the point of most assertions below. */+ async function readConfig(): Promise<{+ models: Array<Record<string, unknown>>;+ default_model?: TomlModelRef;+ vision_model?: TomlModelRef;+ }> {+ return parseToml(+ await fs.readFile(projectConfigPath(tmpRoot, DEFAULT_PROJECT_ID), "utf8"),+ ) as unknown as {+ models: Array<Record<string, unknown>>;+ default_model?: TomlModelRef;+ vision_model?: TomlModelRef;+ };+ }++ it("removes the named pair and leaves every other entry in place", async () => {+ await runModel(["add", "--model-id", "keep-me", "--provider", "custom", "--root", tmpRoot]);+ await runModel(["add", "--model-id", "drop-me", "--provider", "custom", "--root", tmpRoot]);++ const removed = await runModel([+ "remove",+ "--model-id",+ "drop-me",+ "--provider",+ "custom",+ "--root",+ tmpRoot,+ ]);+ expect(removed.code).toBe(0);+ expect(removed.out).toContain("Removed model (provider=custom, model_id=drop-me).");++ const parsed = await readConfig();+ expect(+ parsed.models.find((m) => m.provider === "custom" && m.model_id === "drop-me"),+ ).toBeUndefined();+ expect(+ parsed.models.find((m) => m.provider === "custom" && m.model_id === "keep-me"),+ ).toBeDefined();+ });++ it("removing the default model clears the pointer, so nothing is left naming a model that is gone", async () => {+ await runModel([+ "add",+ "--model-id",+ "my-default",+ "--provider",+ "custom",+ "--set-default",+ "--root",+ tmpRoot,+ ]);+ expect((await readConfig()).default_model).toEqual({+ provider: "custom",+ model_id: "my-default",+ });++ const removed = await runModel([+ "remove",+ "--model-id",+ "my-default",+ "--provider",+ "custom",+ "--root",+ tmpRoot,+ ]);+ expect(removed.code).toBe(0);+ // The confirmation carries the consequence: the Project no longer has a default model.+ expect(removed.out).toContain("Default model: (unset)");+ expect((await readConfig()).default_model).toBeUndefined();+ });++ it("removing the vision model clears that pointer and says so", async () => {+ await runModel(["add", "--model-id", "my-eyes", "--provider", "custom", "--root", tmpRoot]);+ await runModel(["vision", "--model-id", "my-eyes", "--provider", "custom", "--root", tmpRoot]);++ const removed = await runModel([+ "remove",+ "--model-id",+ "my-eyes",+ "--provider",+ "custom",+ "--root",+ tmpRoot,+ ]);+ expect(removed.code).toBe(0);+ expect(removed.out).toContain("vision model");+ expect((await readConfig()).vision_model).toBeUndefined();+ });++ it("removing an unrelated entry leaves both pointers untouched", async () => {+ await runModel([+ "add",+ "--model-id",+ "the-default",+ "--provider",+ "custom",+ "--set-default",+ "--root",+ tmpRoot,+ ]);+ await runModel(["add", "--model-id", "the-eyes", "--provider", "custom", "--root", tmpRoot]);+ await runModel(["vision", "--model-id", "the-eyes", "--provider", "custom", "--root", tmpRoot]);+ await runModel(["add", "--model-id", "unrelated", "--provider", "custom", "--root", tmpRoot]);++ const removed = await runModel([+ "remove",+ "--model-id",+ "unrelated",+ "--provider",+ "custom",+ "--root",+ tmpRoot,+ ]);+ expect(removed.code).toBe(0);+ expect(removed.out).not.toContain("vision model");++ const parsed = await readConfig();+ expect(parsed.default_model).toEqual({ provider: "custom", model_id: "the-default" });+ expect(parsed.vision_model).toEqual({ provider: "custom", model_id: "the-eyes" });+ });++ it("a pair the config doesn't have: reported on stderr with a nonzero exit code", async () => {+ const missing = await runModel([+ "remove",+ "--model-id",+ "no-such-model",+ "--provider",+ "custom",+ "--root",+ tmpRoot,+ ]);+ expect(missing.code).toBe(1);+ expect(missing.err).toContain("(provider=custom, model_id=no-such-model)");+ expect(missing.out).toBe("");+ });++ it("the pair is exact: the same upstream id under another group is a different entry and survives", async () => {+ await runModel([+ "add",+ "--model-id",+ "claude-sonnet-4-6",+ "--provider",+ "myproxy",+ "--root",+ tmpRoot,+ ]);++ // Naming the wrong group must not delete the preset entry that happens to share the id.+ const wrongGroup = await runModel([+ "remove",+ "--model-id",+ "claude-sonnet-4-6",+ "--provider",+ "openai",+ "--root",+ tmpRoot,+ ]);+ expect(wrongGroup.code).toBe(1);++ const removed = await runModel([+ "remove",+ "--model-id",+ "claude-sonnet-4-6",+ "--provider",+ "myproxy",+ "--root",+ tmpRoot,+ ]);+ expect(removed.code).toBe(0);++ const parsed = await readConfig();+ expect(+ parsed.models.find((m) => m.provider === "myproxy" && m.model_id === "claude-sonnet-4-6"),+ ).toBeUndefined();+ expect(+ parsed.models.find((m) => m.provider === "anthropic" && m.model_id === "claude-sonnet-4-6"),+ ).toBeDefined();+ });++ it("missing --provider: a bare model_id is a usage error, so no entry is removed by guesswork", async () => {+ await runModel(["add", "--model-id", "guard-me", "--provider", "custom", "--root", tmpRoot]);++ const bad = await runModel(["remove", "--model-id", "guard-me", "--root", tmpRoot]);+ expect(bad.code).not.toBe(0);+ expect(bad.err).toContain("--provider");++ const parsed = await readConfig();+ expect(+ parsed.models.find((m) => m.provider === "custom" && m.model_id === "guard-me"),+ ).toBeDefined();+ });+});diff --git a/packages/core/src/state/project-config.ts b/packages/core/src/state/project-config.tsindex c1fc4e3e..52278fcd 100644--- a/packages/core/src/state/project-config.ts+++ b/packages/core/src/state/project-config.ts@@ -514,6 +514,40 @@ export async function setVisionModel(return cfg;}+/**+ * Removes a Model and saves. Idempotent, like `removeVaultEntry`: a pair the config doesn't+ * have is not an error and writes nothing, so the caller decides whether a missing entry+ * deserves a message.+ *+ * `default_model` / `vision_model` are cleared when they named the removed entry. Leaving a+ * pointer behind would name a model that is no longer configured, which createSession rejects+ * outright — the same rule the models page applies when a row is deleted, kept on one behavior+ * so the CLI and the Web App never disagree about what a deletion leaves behind.+ */+export async function removeModel(+ root: string,+ projectId: string,+ ref: ModelRef,+): Promise<ProjectConfig> {+ const cfg = await loadProjectConfig(root, projectId);+ const idx = cfg.models.findIndex((m) => sameRef(m, ref));+ if (idx < 0) return cfg;+ cfg.models.splice(idx, 1);+ if (cfg.default_model && sameRef(cfg.default_model, ref)) {+ delete cfg.default_model;+ }+ if (cfg.vision_model && sameRef(cfg.vision_model, ref)) {+ delete cfg.vision_model;+ }+ await saveProjectConfig(root, projectId, cfg);+ return cfg;+}++/** Whether two paired references name the same entry. Both halves must match — the pair is the config's unique key. */+function sameRef(a: ModelRef, b: ModelRef): boolean {+ return a.provider === b.provider && a.model_id === b.model_id;+}+/** Looks up a Model entry exactly by its `(provider, model_id)` paired reference; returns `undefined` if it doesn't exist. */export function getModel(cfg: ProjectConfig, ref: ModelRef): ModelEntry | undefined {return cfg.models.find((m) => m.provider === ref.provider && m.model_id === ref.model_id);diff --git a/packages/core/test/state.test.ts b/packages/core/test/state.test.tsindex 204c5fd5..14afd4d7 100644--- a/packages/core/test/state.test.ts+++ b/packages/core/test/state.test.ts@@ -26,6 +26,7 @@ import {SESSION_ID_PLACEHOLDER,SHELL_PLACEHOLDER,addModel,+ removeModel,setVisionModel,agentsMdPath,agentStateDir,@@ -1107,6 +1108,67 @@ describe("project-config round trip", () => {).rejects.toThrow(/not supporting images/);});+ it("removeModel drops the exact pair and leaves a same-id entry in another group alone", async () => {+ await addModel(tmpRoot, DEFAULT_PROJECT_ID, { provider: "pa", model_id: "m1" });+ await addModel(tmpRoot, DEFAULT_PROJECT_ID, { provider: "pb", model_id: "m1" });+ const removed = await removeModel(tmpRoot, DEFAULT_PROJECT_ID, {+ provider: "pa",+ model_id: "m1",+ });+ expect(getModel(removed, { provider: "pa", model_id: "m1" })).toBeUndefined();+ expect(getModel(removed, { provider: "pb", model_id: "m1" })).toBeDefined();+ // Persisted, not just returned.+ const loaded = await loadProjectConfig(tmpRoot, DEFAULT_PROJECT_ID);+ expect(getModel(loaded, { provider: "pa", model_id: "m1" })).toBeUndefined();+ expect(getModel(loaded, { provider: "pb", model_id: "m1" })).toBeDefined();+ });++ it("removeModel clears the default / vision pointers that named the removed entry", async () => {+ await addModel(tmpRoot, DEFAULT_PROJECT_ID, {+ provider: "custom",+ model_id: "both",+ vision: true,+ });+ const bothRef = { provider: "custom", model_id: "both" };+ await setDefaultModel(tmpRoot, DEFAULT_PROJECT_ID, bothRef);+ await setVisionModel(tmpRoot, DEFAULT_PROJECT_ID, bothRef);++ await removeModel(tmpRoot, DEFAULT_PROJECT_ID, bothRef);+ // A pointer left behind would name a model that is no longer configured, which+ // resolveModelRef rejects on the next createSession.+ const loaded = await loadProjectConfig(tmpRoot, DEFAULT_PROJECT_ID);+ expect(loaded.default_model).toBeUndefined();+ expect(loaded.vision_model).toBeUndefined();+ });++ it("removeModel leaves pointers aimed at other entries untouched", async () => {+ await addModel(tmpRoot, DEFAULT_PROJECT_ID, {+ provider: "custom",+ model_id: "keeper",+ vision: true,+ });+ await addModel(tmpRoot, DEFAULT_PROJECT_ID, { provider: "custom", model_id: "spare" });+ const keeperRef = { provider: "custom", model_id: "keeper" };+ await setDefaultModel(tmpRoot, DEFAULT_PROJECT_ID, keeperRef);+ await setVisionModel(tmpRoot, DEFAULT_PROJECT_ID, keeperRef);++ await removeModel(tmpRoot, DEFAULT_PROJECT_ID, { provider: "custom", model_id: "spare" });+ const loaded = await loadProjectConfig(tmpRoot, DEFAULT_PROJECT_ID);+ expect(loaded.default_model).toEqual(keeperRef);+ expect(loaded.vision_model).toEqual(keeperRef);+ });++ it("removeModel is idempotent: an absent pair is not an error and changes nothing", async () => {+ await addModel(tmpRoot, DEFAULT_PROJECT_ID, { provider: "custom", model_id: "only" });+ const before = await loadProjectConfig(tmpRoot, DEFAULT_PROJECT_ID);+ const after = await removeModel(tmpRoot, DEFAULT_PROJECT_ID, {+ provider: "custom",+ model_id: "never-added",+ });+ expect(after.models).toEqual(before.models);+ expect(getModel(after, { provider: "custom", model_id: "only" })).toBeDefined();+ });+it("upsert preserves existing context_window and inline credential when not re-specified", async () => {await addModel(tmpRoot, DEFAULT_PROJECT_ID, {provider: "custom",diff --git a/packages/docs/content/cli.en.md b/packages/docs/content/cli.en.mdindex 51149904..f57388d3 100644--- a/packages/docs/content/cli.en.md+++ b/packages/docs/content/cli.en.md@@ -94,16 +94,18 @@ penguin config model add --provider deepseek --model-id deepseek-v4-pro --api-ke| `--price-output <n>` | Output price || `--set-default` | Also set as the default model |-### model default / model vision / model list+### model default / model vision / model list / model remove```bashpenguin config model default --model-id <id> --provider <group>penguin config model vision --model-id <id> --provider <group>penguin config model list+penguin config model remove --model-id <id> --provider <group>```- `model default` sets the Project's default model; `model vision` sets the vision proxy model. Both require `--model-id` and `--provider`, and the reference must already exist in the model list.- `model list` lists configured models; the default model is marked with `*`.+- `model remove` deletes a model entry along with the credential stored inline on it. It requires `--model-id` and `--provider` — the pair is matched exactly, so the same upstream id under another group is left alone — and exits non-zero if the pair is not in the config. When the removed entry was the default model or the vision model, that setting is cleared: a pointer left naming a model that is no longer configured would fail the next session outright.### vaultdiff --git a/packages/docs/content/cli.zh.md b/packages/docs/content/cli.zh.mdindex 243ace06..58fda457 100644--- a/packages/docs/content/cli.zh.md+++ b/packages/docs/content/cli.zh.md@@ -94,16 +94,18 @@ penguin config model add --provider deepseek --model-id deepseek-v4-pro --api-ke| `--price-output <n>` | 输出价格 || `--set-default` | 同时设为默认模型 |-### model default / model vision / model list+### model default / model vision / model list / model remove```bashpenguin config model default --model-id <id> --provider <group>penguin config model vision --model-id <id> --provider <group>penguin config model list+penguin config model remove --model-id <id> --provider <group>```- `model default` 设置 Project 默认模型;`model vision` 设置视觉代理模型。两者的 `--model-id` 与 `--provider` 均为必填,且引用必须已存在于模型列表。- `model list` 列出已配置模型,默认模型以 `*` 标记。+- `model remove` 删除一个模型条目,连同内联在其上的凭据一并删除。`--model-id` 与 `--provider` 均为必填,按成对引用精确匹配——同名上游 id 在其他分组下的条目不受影响;引用不在配置中时以非零码退出。若被删条目正是默认模型或视觉模型,对应设置一并清空:留下一个指向已不存在模型的指针,只会让下一次会话直接失败。### vault