setup · diff
git:20261016.11e901a to git:20261016.69d4794
14 added, 10 removed. Audit B to B.
---
name: setup
- description: Finish setting up the ModelPlan Codex plugin right after it is installed, or when the user asks how to turn on its proactive quota hints - check the optional modelplan CLI, offer to install it, and explain the hook trust step.
+ description: Check and finish the ModelPlan Codex plugin's setup - after it is installed or upgraded, or whenever the user asks why ModelPlan quota hints or the task-start brief do not appear. Reports each part (plugin, optional CLI, hook trust, hints) on its own, offers the CLI with consent, and re-checks.
---
- Codex runs this once after the plugin is installed. Keep it short and in the user's language. Install nothing without the user's yes.
+ Codex may run this after the plugin is installed; the user can also ask for it at any time ("check ModelPlan setup"). A user's question always gets a full answer, whatever the automatic notices did before. Keep it short and in the user's language.
- 1. Check for the optional CLI. Codex may run commands with a short PATH, so look in the usual places too:
- `command -v modelplan || ls ~/.local/bin/modelplan /opt/homebrew/bin/modelplan /usr/local/bin/modelplan 2>/dev/null`.
- If it is there, run `<path> version` and skip to step 3.
- 2. Without it, say in two sentences what it adds: proactive hints when a quota window will reset with allowance left (step up or turn on Fast), when it runs tight, after an announced Codex reset, and a reminder to switch back to ★ once the reset happened; the dashboard and the quota reading work without it. Ask whether to install it. Only on a yes, run
+ 1. Check, and report each part on its own line:
+ - **Plugin**: answering if `get_model_dashboard` works; its `structuredContent.setup` has the rest.
+ - **CLI** (`setup.cli.status`): `ok` (version), `missing`, `outdated` (older than `setup.cli.min`), or `failed` (with `error`). Without the tool: `sh "<plugin root>/hooks/find-cli.sh"`, then `<path> version`.
+ - **Hook**: `setup.hook.lastRun` empty means Codex has not run it yet, normally because it is not trusted.
+ - **Hints**: on only when the CLI is `ok` (or `outdated`) and the hook has run.
+ Never call a part done because a command was run; only what the check shows.
+ 2. CLI missing or outdated: say in one sentence what it adds (quota hints before and after resets, a model and effort suggestion at the start of a task, the Codex account reading with reset credits) and ask. Only on a yes, run
`curl -fsSL https://raw.githubusercontent.com/modelplan/modelplan/main/install.sh | sh`
- (latest release for this OS and CPU, checked against the release checksums, into `~/.local/bin`; it changes no PATH or shell profile). On Windows, point to https://github.com/modelplan/modelplan/releases instead. The dashboard's "Install CLI" button does the same.
- 3. Hints reach the chat through the plugin's hooks, which Codex runs only after the user trusts them: in the CLI with `/hooks`, in the desktop app in its hooks review. Say this once; do not try to change hook trust or any setting yourself.
- 4. Offer to open the dashboard with `open_model_dashboard`. For a full check, the user can run `node "<plugin root>/doctor.cjs" --lang zh`.
+ (latest release for this OS and CPU, checked against the release checksums, into `~/.local/bin`; no PATH, profile or sudo changes; on Windows point to https://github.com/modelplan/modelplan/releases). Then check again (`~/.local/bin/modelplan version`, or the tool) and report the version actually found. If an older copy elsewhere is still found first, say where. The dashboard's Install/Upgrade CLI button does the same.
+ If the user says not now: `mkdir -p ~/.cache/modelplan-codex && touch ~/.cache/modelplan-codex/cli-declined` (the hook then stays quiet for 90 days; the dashboard's "Not now" does the same).
+ 3. Hook not run: Codex runs plugin hooks only after the user trusts them. The review lists it as "UserPromptSubmit · Hook 1", source `Plugin - modelplan-codex@modelplan`, command `sh "$PLUGIN_ROOT/hooks/modelplan-quota-hints.sh"`, timeout 5 s. It reads the local quota and the cached publication and only adds context; it installs and changes nothing. Trust it with `/hooks` in the CLI or in the desktop app's hook review; it starts with the next message. A changed hook needs trusting again after a plugin update. Do not change hook trust yourself.
+ 4. Offer the dashboard (`open_model_dashboard`); it shows the same setup lines. For a full check: `node "<plugin root>/doctor.cjs" --lang zh`.
- Never switch the model, effort or Fast, and never use a reset credit; those stay the user's choice.
+ Never switch the model, effort or Fast, and never redeem a reset credit; those stay the user's.