Skip to content
pi-c Artifact [91eb85fb5c]
Login

Artifact [91eb85fb5c]

Artifact 91eb85fb5cac8d2f57e68b55098ca44ca5c971b5c9f5f5b4bcbb73c4ec36b973:


# 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:

```sh
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):

```sh
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](credentials.md) says how the store works; [environment variables](../reference/env.md)
lists every provider's variable.

## 2. Start

```sh
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](models.md) 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

```sh
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 on stderr when pic chose it (not when you gave `--model`). `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](../reference/cli.md)
(`pic help cli`) lists every command and flag. `pic --version` prints the version.

## Where to go next

- [The terminal interface](tui.md), [themes](themes.md) and [keys](../reference/keys.md)
- [Coming from Claude Code](from-claude-code.md)
- [Sessions](sessions.md), [models](models.md), [print mode and JSON](print-and-json.md), [RPC
  mode](rpc.md)
- [Tools](tools.md), [prompts and skills](prompts-and-skills.md), [hooks](hooks.md),
  [processes](processes.md)
- [Benchmarks](benchmarks.md), [where pic can run](platforms.md), [differences from
  Pi](differences-from-pi.md)

## Building pic

```sh
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.