Artifact 9a38e6900de445d6250cf87adb6149f5e0e25af7bc213cee8e203fd89c58f29c:
- File
docs/reference/env.md
— part of check-in
[bcb82b941e]
at
2026-11-23 11:55:36
on branch keysource
— Keep the credential store's key in the Keychain or a key file, not behind a passphrase
A new store gets a random 32-byte master key kept in the login Keychain (macOS, /usr/bin/security run as a child with the command on stdin) or the keyring (secret-tool), else ~/.pic/master.key at 0600. The source is recorded in picu_credential_key.source; a passphrase store keeps working as before. pic auth rekey keychain|file|passphrase reseals every sealed row in one transaction, and a typed passphrase is followed once by the offer to stop asking. --passphrase-fd and PIC_PASSPHRASE_COMMAND (setting passphraseCommand) give a passphrase with no terminal. pic remote opens a keychain or file store with no prompt. Every OS service stays in platform.c behind secret_key, secret_keep and secret_drop. (user: dmestas, size: 3063) [annotate] [blame] [check-ins using] [more...]
# Environment variables The variables pic reads. Variables that only the test suite sets are listed in `test/pic/docs.allow` instead. ## API keys A key or sign-in stored with `pic login` or `/login` is used before the provider's variable, as in Pi. See [the lookup order](../manual/credentials.md#the-lookup-order). | Variable | Provider | |---|---| | `ANTHROPIC_API_KEY` | anthropic | | `OPENAI_API_KEY` | openai | | `OPENROUTER_API_KEY` | openrouter | | `XAI_API_KEY` | xai | | `GROQ_API_KEY` | groq | | `CEREBRAS_API_KEY` | cerebras | | `DEEPSEEK_API_KEY` | deepseek | | `FIREWORKS_API_KEY` | fireworks | | `GEMINI_API_KEY` | google | | `HF_TOKEN` | huggingface | | `MOONSHOT_API_KEY` | moonshotai | | `NVIDIA_API_KEY` | nvidia | | `TOGETHER_API_KEY` | together | | `ZAI_API_KEY` | zai | ## pic | Variable | Values | What it does | |---|---|---| | `PIC_LAPSE` | on, off | lapse compaction, as `--lapse` (setting `lapseCompaction`) | | `PIC_LAPSE_SECONDS` | seconds | the cache lifetime lapse compaction assumes, as `--lapse-seconds` | | `PIC_LAPSE_FLOOR` | tokens | the context floor for lapse compaction, as `--lapse-floor` | | `PIC_LAPSE_HOLDOUT` | 0 to 1 | the share of lapses left uncompacted, as the setting `lapseHoldout` | | `PIC_TRIAL` | label | a benchmark arm kept on each request, as `--trial` | | `PIC_PASSPHRASE_COMMAND` | shell command | prints the credential store's passphrase (its first line), instead of asking on the terminal; before the setting `passphraseCommand` | | `PIC_MAX_REQUESTS` | N | the request cap, as `--max-requests` | | `PIC_PI_EXPORT` | 0 | `0` stops `ask`, `chat` and the terminal from writing Pi session lines after each request | | `PIC_MODELS_FILE` | path | read this file instead of `~/.pic/models.json` (and Pi's `~/.pi/agent/models.json`) | | `PIC_MODEL_CATALOG` | offline | `offline` never fetches the model catalog; the built-in snapshot is used | | `PIC_CA` | builtin | `builtin` skips the system certificate bundles and trusts only pic's built-in roots | | `PIC_NO_NATIVE_CLIPBOARD` | any | the terminal interface does not use the system clipboard tools | | `PIC_HOOK_OWNER` | id | set by the terminal interface for its request children, so `pic hooks end` ends what it began | | `PIC_HOOK` | 1 | set by pic in a hook's environment | | `PI_CACHE_RETENTION` | long | as Pi's: the prompt cache retention when the `cacheRetention` setting is not set | ## System | Variable | What pic does with it | |---|---| | `HOME` | `~/.pic` is under it | | `USER` | the login name in `/remote-control`'s ssh command and address | | `TMPDIR` | where the external editor's file and RPC mode's full output of a truncated bash command go | | `VISUAL` | the external editor (Ctrl+G), before `EDITOR` | | `EDITOR` | the external editor when `VISUAL` is not set | | `SSL_CERT_FILE` | an absolute path to a certificate bundle, read before the system bundles | | `COLORTERM` | truecolor when it says so, otherwise the nearest of 256 colours | | `COLORFGBG` | the terminal's background, for the `system` and `light/dark` themes |