Artifact fff412cc4157d2166224dcfcb4e2f73f2b63ef6dfb0cc65eee6f38b9294c85a7:
- File
docs/manual/start.md
— part of check-in
[c8bc1bfa6d]
at
2026-11-23 11:40:21
on branch ux-models
— Model choice says why and recovers from a refused key
With no saved default, pic starts on a provider whose key worked and passes over one that was refused, out of credit or limited; OpenRouter, Moonshot and DeepSeek start on inexpensive general models. The first screen (and stderr for ask and -p) names the model and why; with no key it says how to get one. The picker shows prices and key marks, lists keyless models once typed, ranks exact and prefix matches first, says what it saved and when the thinking level changes. After a refused key, Alt+P picks another model and the message returns to the editor for it. pic sessions shows each conversation's model and marks failed ones; pic models --json carries key; pic --version; pic help start opens with the user path. (user: dmestas, size: 4264) [annotate] [blame] [check-ins using]
Getting started
pic is a coding agent for the terminal: it reads, edits and runs code in your project with a model you choose, and keeps every step in a journal, so a crash or a lost connection loses nothing.
1. Give it a key
pic needs a key for at least one model provider. Either export one, as in Pi:
export OPENROUTER_API_KEY=sk-or-... # or ANTHROPIC_API_KEY, OPENAI_API_KEY, DEEPSEEK_API_KEY, ...
or store one in pic, sealed in ~/.pic/pic.sqlite (/login does the same in the terminal):
pic login openrouter # the key, typed with echo off (or piped on stdin)
pic auth login openai # or sign in with a subscription (ChatGPT)
pic auth status --check # which keys you have, and whether each provider accepts it
Credentials says how the store works; environment variables lists every provider's variable.
2. Start
cd your-project
pic
The first screen names the model and why pic chose it, for example model
openrouter/deepseek/deepseek-v4.1-flash (OPENROUTER_API_KEY is set; Alt+P to change). Type a
message and press Enter. With no key yet, it says so and how to get one.
3. Choose a model
Alt+P opens the model picker: type to filter, Enter uses a model for now, Ctrl+S also saves it as
your default. Each row shows its price per million tokens (in/out) and marks a provider with no
key, a refused key or a ChatGPT plan. In a shell, pic models lists models and
pic models --default NAME saves the default. Models says how pic picks one when you
have not.
If a provider refuses your key, the message says so; Alt+P picks another model and Enter sends the same message to it.
More ways to run it
pic tui -c # continue the latest conversation
pic ask "fix the failing test"
pic ask -c "now add a regression test"
pic -p "list the TODOs" # Pi's print mode: one prompt, the answer on stdout
git diff | pic -p "review this" # piped stdin comes first in the prompt
pic -p @notes.md @shot.png "summarize" # @files: text as <file name="...">, images attached
pic --system-prompt "Be terse." -p "..." # TEXT or a file; --append-system-prompt adds to the default
pic chat # a plain line prompt
pic --model openrouter/deepseek/deepseek-v4-flash --thinking high ask "..."
pic sessions # conversations in this workspace, with the model each used
pic log ID # one conversation, with why a request failed
pic skills # skills in ~/.pic/skills (and the trusted workspace's); /skill:name runs one
pic --json ask "..." # Pi's JSON events on stdout
pic --mode rpc # Pi's RPC mode: JSONL commands on stdin, responses and events on stdout
ask and -p name the model they use on stderr. pic help lists the topics of this manual and
pic help TOPIC prints one (/help TOPIC in the terminal interface). pic --help is a short
synopsis; the command line reference (pic help cli) lists every command
and flag. pic --version prints the version.
Where to go next
- The terminal interface, themes and keys
- Coming from Claude Code
- Sessions, models, print mode and JSON, RPC mode
- Tools, prompts and skills, hooks, processes
- Benchmarks, where pic can run, differences from Pi
Building pic
make pic # build/pic/release/pic
make install-pic # runs the test suite, then installs to ~/.local/bin/pic
The build uses CC (default cc) and compiles with -Werror; it is warning-clean under clang and
gcc (make CC=gcc-16 pic).
Without Make, build pic from its release bundle, pic-amalgamation-VERSION.tar.gz: pic's own code
as one pic.c, beside the vendored SQLite, libfossil, zlib and BearSSL sources. It needs only a C11
compiler, libc, libm and pthread, and no flags beyond optimization:
cc -O2 *.c -o pic -lm -lpthread. make amalgamation makes the bundle from a checkout.