Step 3 of 8

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

CLI
npm install -g @restormel/keys-cli

Or as a dev dependency:

CLI
pnpm add -D @restormel/keys-cli

Then 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):

CLI
npx keys doctor

Doctor 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

CLI
npx keys models list

Filter 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

CLI
npx keys routing explain gpt-4o

You'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.