Phase 2 — CLI
Time: ~10 minutes
Prerequisites: Phase 1 complete; you chose "In my terminal" or want CLI
You'll need: Terminal, Node 18+, npm or pnpm
This phase installs the Restormel Keys CLI and runs doctor, validate, models list, and routing explain so you can debug and inspect from the terminal.
Step 2.1 — Install the CLI
npm install -g @restormel/keys-cliOr as a dev dependency:
pnpm add -D @restormel/keys-cliThen run via npx keys or pnpm exec keys. You'll see keys --help with init, add, list, validate, doctor, estimate, sync, models, routing.
Step 2.2 — Run doctor
From your app directory (where restormel.config.json lives):
npx keys doctorDoctor checks framework, @restormel/keys, and config. Exit 0 means the local setup is valid. How to test: npx keys doctor exits with code 0.
Step 2.3 — Validate (optional)
If you have provider credentials in the local key store: npx keys validate. Skip if you use gateway-backed provider access only.
Step 2.4 — Models list
npx keys models listFilter by provider: npx keys models list --provider anthropic. You'll see a list of providers and their models with pricing hints.
Step 2.5 — Routing explain
npx keys routing explain gpt-4oYou'll see steps: which provider was found for the model, cost lookup, resolution result.
Prompts for this phase
Optional. Use if a coding agent should install the CLI and verify doctor, models list, and routing explain.
Checkpoint
You now have: CLI installed (global or dev dependency), doctor passing, keys models list and keys routing explain working, and optionally validate run for local credentials.