Artifact df46d509396b27a2e856e8ffc79a3a35f1b31c637db8884fd3f175c081f7c47a:
- File docs/reference/cli.md — part of check-in [d5b0e6d9f1] at 2026-11-21 18:53:39 on branch lapse-default — Lapse compaction on by default above 100000 tokens, with a random holdout and pic usage --lapse to measure what it saves (user: dmestas, size: 12631) [annotate] [blame] [check-ins using] [more...]
Command line
Every command and flag pic accepts. pic --help prints a short synopsis; this file is the full list.
How each mode behaves is in the manual topics (pic help lists them).
Flags
| Flag | Argument | Used with | What it does |
|---|---|---|---|
--workspace |
DIR | any command | the workspace (default: the current directory); import --claude takes it too |
--db |
PATH | any command | the journal (default WORKSPACE/.pic/journal.sqlite) |
--model |
MODEL | any command | the model, as provider/id |
--thinking |
LEVEL | any command | off, minimal, low, medium, high, xhigh, max; the model's supported ones |
--exec-timeout |
SECONDS | any command | the bash tool's default timeout (600) |
--tools, -t |
LIST | any command | only these tools, or +name/-name entries that change the default four |
--exclude-tools, -xt |
LIST | any command | leave these tools out |
--no-tools, -nt |
any command | no tools | |
--no-builtin-tools, -nbt |
any command | no built-in tools | |
--tui-mode |
MODE | tui |
fullscreen (the default) or regular; setting tuiMode |
--theme, --use-theme |
NAME | tui |
the colour theme for this run; setting theme |
--json |
ask, run, bash, listings |
Pi's JSON events on stdout, or JSON output for a listing | |
--stream |
ask, run |
stream the reply even when stdout is piped | |
--commands |
ask, run with --json |
Pi's RPC command lines on stdin steer the running request | |
--context-window |
TOKENS | any command | compact past this minus 16384; default: the model's, 0 never |
--lapse |
on, off | any command | lapse compaction (PIC_LAPSE, setting lapseCompaction) |
--lapse-seconds |
N | any command | the cache lifetime lapse compaction assumes (PIC_LAPSE_SECONDS) |
--lapse-floor |
TOKENS | any command | the context below which lapse compaction waits (PIC_LAPSE_FLOOR) |
--now |
compact |
summarize the conversation now instead of before its next request (Pi's /compact) |
|
--trial |
LABEL | any command | a benchmark arm kept on each request admitted (PIC_TRIAL) |
--max-requests |
N | any command | stop a request before its (N+1)th reply request (PIC_MAX_REQUESTS) |
--print, -p |
[TEXT] | Pi's print mode: one prompt, the answer on stdout | |
--system-prompt |
TEXT or FILE | -p, ask, chat, tui |
replaces the system prompt |
--append-system-prompt |
TEXT or FILE | -p, ask, chat, tui |
adds to the system prompt (repeatable) |
--mode |
rpc | Pi's RPC mode | |
--continue, -c |
-p, ask, tui, chat, bash, --mode rpc |
continue the latest conversation | |
--session |
ID | -p, ask, tui, chat, bash, submit, --mode rpc |
continue that conversation |
--image |
PATH | ask |
attach an image file (png, jpeg, gif, webp) after the text |
--unset |
KEY | settings |
remove a setting |
--all |
models, ps |
every model, not only those with a key; finished processes too | |
--refresh |
models |
fetch the model catalog now | |
--default |
NAME | models |
save the default model (setting defaultModel) |
--thinking-default |
LEVEL | models |
save the default thinking level (setting defaultThinkingLevel) |
--no-context |
bash |
journal the command without sending it to the model (!!) |
|
--at |
ENTRY | fork |
fork after this entry |
--summarize |
fork |
start the new conversation with a summary of the branch left behind | |
--instructions |
TEXT | fork --summarize |
what the summary should focus on |
--script |
FILE | run, fork --summarize |
a scripted provider, for tests |
--api-url |
URL | run, fork --summarize |
the provider's endpoint |
--provider |
NAME | run |
the provider to run against |
--html |
ID | export |
a conversation as one self-contained HTML page |
--pi |
[DIR or -] | export |
conversations as Pi session lines |
--since |
ENTRY | export |
finished entries after ENTRY |
--claude |
PATH | import |
a Claude Code transcript as a new conversation |
--until |
UUID | import --claude |
stop before this record |
--count |
import --claude |
also count pic's first request on it by the provider's counter | |
--clear |
scoped-models |
cycle every model again | |
--set |
PATTERN... | scoped-models |
the models Ctrl+P cycles |
--list |
bug |
the bug reports kept | |
--by-trial |
usage |
requests, tokens and cost by trial label | |
--dry-run |
prune |
report what would be dropped | |
--kill |
ID or --all |
ps |
stop a process pic started, by process group |
--help, -h |
print the usage text below |
Commands
Options go before the command: pic [options] COMMAND. With no command, pic opens the terminal
interface in a terminal.
Conversations
pic ask [-c | --session ID] [--image PATH]... TEXT: run TEXT in the workspace (default: the current directory) and print the answer, in a new conversation, the latest (-c) or that one (--session).--imageattaches an image file (png, jpeg, gif, webp) after the text. The journal defaults toWORKSPACE/.pic/journal.sqlite.pic -p [TEXT] [@FILE]... [TEXT]...(or--print): Pi's print mode, one prompt and its answer. Piped stdin comes first in the prompt, then the @files (text as<file name="PATH">, images attached), then the first TEXT; each further TEXT continues the conversation.-cor--continuejoins the latest conversation,--session IDthat one; an unknown ID is an error.--ends the options: what follows is TEXT and @FILE, even with a leading-or@.pic tui [-c | --session ID]: the terminal interface (plainpicin a terminal).-ccontinues the latest conversation (the first inpic sessions),--sessionthat one.pic chat [-c | --session ID]: a plain line prompt for one conversation.pic --mode rpc [-c | --continue | --session ID]: Pi's RPC mode. Pi's JSONL commands on stdin (prompt, steer, follow_up, abort, compact, bash, fork, get_state and the rest), responses and Pi's events on stdout. The journal is held only while a command, request, compaction or bash runs.pic bash [--no-context] [-c | --session ID] COMMAND: run COMMAND in the workspace and journal it as Pi's bashExecution message (what!COMMANDdoes in the terminal). It reaches the model with the conversation's next request, unless--no-context(!!). pic exits with the command's status. With--json:bash_execution_updateevents and Pi's bash response (output, exitCode, cancelled, truncated, conversation).pic compact [ID [INSTRUCTIONS]]: summarize the conversation before its next request;pic compact --now [ID [INSTRUCTIONS]]summarizes it now (Pi's/compact).
Sessions and export
pic sessions [--json],pic log [--json] [ID],pic name ID NAME,pic fork ID [--at ENTRY].pic tree --json [ID]: the requests of ID's conversation tree, branches included.pic fork ID --at ENTRY --summarize [--instructions TEXT] [--script FILE | --api-url URL]: Pi's/treewith a summary: a new conversation from ENTRY, with a summary of what ID leaves behind.pic export --html ID [PATH | -]: a conversation as one self-contained HTML page (default-).pic export [--since ENTRY]: finished entries as JSON lines.pic export --pi [DIR | -]: conversations as Pi session lines, as rows in~/.pic/pic.sqlite(for ctx; ask, chat and the terminal write them after each request unlessPIC_PI_EXPORT=0), and~/.pic/sessionsfiles only withpiSessionFiles=1. DIR writes files there,-to stdout.pic import PATH | -: a Pi v3 session JSONL as a new conversation (the text of its messages).pic import --claude PATH [--until UUID] [--workspace DIR] [--count]: a Claude Code transcript as a new conversation in its cwd's workspace (or DIR), its main thread before the record UUID. It prints the id, counts, pic's estimate of the next request's context and the transcript's own at the cut.--countalso counts pic's first request on it (system prompt, tools, messages) by the provider's counter.
Models, keys and settings
pic models [--json] [--all] [--refresh]: models from Pi's catalog (and models.json) whose provider has a key;--allevery one.pic models --default NAMEandpic models --thinking-default LEVELsave the defaults.pic scoped-models [--clear | --set PATTERN...]: the models Ctrl+P cycles.pic login PROVIDER: store PROVIDER's API key (typed with echo off, or piped on stdin) in~/.pic/pic.sqlite, sealed under a key from a passphrase (asked once per process, when a stored key is needed). PROVIDER's variable (ANTHROPIC_API_KEYand the like) still wins when set.pic logout PROVIDER: remove the stored key.pic keys: the stored keys' names and dates, never values.pic settings [KEY [VALUE] | --unset KEY]: the settings kept in~/.pic/pic.sqlite; see settings.pic trust [yes | no]: the workspace's trust.pic projects: the projects kept in~/.pic/pic.sqlite: name, kind, state, remote.
Prompts, skills, hooks and processes
pic prompts [--json]: the prompt templates (~/.pic/prompts, and the trusted workspace's.pic/prompts)./NAME ARGSin a message sends the template with$1,$@,${@:2}and the like filled in.pic skills [--json]: the skills (~/.pic/skills, and the trusted workspace's.pic/skills; symlinks followed), listed in the system prompt./skill:NAME ARGSin a message sends the skill's instructions and ARGS.pic hooks: the command hooks of~/.pic/hooks.json(and the trusted workspace's.pic/hooks.json), in Claude Code's shape and events.pic dumplists their runs.pic hooks end REASONfires SessionEnd for whatPIC_HOOK_OWNERbegan.pic ps [--all] [--json],pic ps --kill ID | --all: the processes pic started that are still running (hooks, bash and!commands, the terminal's request children).--alladds recent finished ones;--killstops one (or all) by process group. Processes a hook script starts on its own are not tracked.
Housekeeping
pic help [TOPIC]: the manual and this reference, compiled in.pic helplists the topics.pic usage --by-trial [--json]: requests, tokens (cache reads and writes too) and cost by trial.pic usage --lapse [--json]: what lapse compaction saved, compacted lapses against held-out ones.pic prune [--dry-run]: drop the bytes of images no request sends any more (compacted away) or older thanimageRetentionDays(default 30, 0 never). pic also prunes at open, hourly.pic bug [--list | TEXT]: a bug report kept in~/.pic/pic.sqlite, sent nowhere.
Internal commands
Used by the terminal interface, the tests and scripts; not meant to be typed.
pic submit KEY TEXT [--session ID]andpic cancel KEY.pic run --script FILE.pic run [--session ID] [--provider anthropic] [--api-url URL]: finish unfinished requests, each with the model and thinking level it was admitted with;--session: only that conversation's.pic dump,pic checkandpic result CALL_ID.
Options in detail
--tools,-t LIST: a comma list of read, bash, edit, write, grep, find, ls: only these;*patterns work. A list of only+name/-nameentries changes the default four instead. ThedefaultToolssetting takes the same entries (default read,bash,edit,write).--thinking LEVEL: the model's supported levels only. Default: the settingthinkingLevel:MODEL, thendefaultThinkingLevel, else medium.--lapse on|off: compact before a request when the conversation has been idle past the prompt cache's lifetime and its context is above the floor.--lapse-secondsdefaults to the cache's lifetime (300, 3600 withcacheRetentionlong, OpenAI 86400);--lapse-floorto 100000. On by default.--trial LABEL: a benchmark arm (1-64 printable bytes) kept on each request admitted.--max-requests N: a request stops cleanly (request_cap) before its (N+1)th reply request, retries not counted;pic ask -ccontinues it.--commands(with--json, for ask and run): Pi's RPC command lines on stdin steer the running request: steer, follow_up, clear_queue, abort, set_steering_mode, set_follow_up_mode. Each is journaled as it arrives. While a request runs its process owns the journal, so this is the only way to steer it: there is no separate steer command.