Environment variables
PiG reads these variables at startup. Each one has a setting or a default that covers the normal case, so set a variable only when you need to change PiG from outside its configuration: in a container, in CI, or while debugging.
Variables named PI_* are read for compatibility with upstream Pi. PiG reads
both spellings where both exist.
Location
Variable | Effect |
PIG_HOME | Configuration root. Default ~/.pig |
PIG_CODING_AGENT_DIR | Agent directory alone. Default $PIG_HOME/agent |
PIG_HOME moves settings, keybindings, sessions, trust decisions and installed
packages together. Use it to run two configurations side by side.
Network
Variable | Effect |
PIG_OFFLINE, PI_OFFLINE | Do not check for package updates. Accepts 1, true or yes |
PIG_UPDATE_URL | Release manifest used by pig update |
PIG_UPDATE_TRUST_ROOT | Public key that signs the release manifest |
PI_OAUTH_CALLBACK_HOST | Host the OAuth callback listens on |
PI_SHARE_GATEWAY_URL | Artifact upload endpoint used only when you run /share. Default https://pi-in-go.dev/v1/artifacts?visibility=unlisted&title=PiG+session |
PI_TELEMETRY | Override the enableInstallTelemetry setting: 1, true or yes enables it, anything else disables it. Gates the install/update ping and the OpenRouter/NVIDIA/Cloudflare attribution headers. The ping is not active yet: PiG has no endpoint to send it to. |
Set PIG_OFFLINE in CI. Without it, every run checks for updates and fails
slowly when the network is blocked.
Diagnostics
Variable | Effect |
PIG_DEBUG | Write a debug log |
PIG_DEBUG_KEYS | Log every key as PiG decodes it |
PIG_DEBUG_TOOLS | Log tool calls and their results |
PIG_RENDER_DEBUG | Write render diagnostics |
PIG_DEBUG_REDRAW | Log why the screen was fully repainted |
PIG_STARTUP_TRACE | Time each startup step |
Use PIG_DEBUG_KEYS when a keybinding does not respond: it shows whether the key
reached PiG at all. See terminal setup.
Use PIG_DEBUG_REDRAW when the view jumps while output arrives. A full repaint
clears the terminal's scrollback, which moves the reader, and every cause emits
the same bytes. The log names the cause, in $PIG_HOME/agent/pig-debug.log.
Any non-empty value turns these on.
Display
Variable | Effect |
PI_HARDWARE_CURSOR | Show the terminal's own cursor |
PI_CLEAR_ON_SHRINK | Repaint when content shrinks |
Both have settings that do the same thing. See settings.
Extensions and piglets
Variable | Effect |
PIG_PIGLET_NAME | Piglet to run |
PIG_PIGLET_PATH | Directories searched for piglets |
PIG_SDK_GO_ROOT | Go SDK used when building an extension |
PIG_SDK_PY_ROOT | Python SDK used when building an extension |
PIG_SDK_RS_ROOT | Rust SDK used when building an extension |
PIG_CELL_BUILD_TIMEOUT | Time an extension build may take |
The PIG_SDK_* variables point a build at an SDK checkout instead of the staged
copy. Use them while developing the SDK itself. See
extensions.
Process markers
Pig sets two markers that every child process inherits, as Pi does:
Variable | Effect |
AI_AGENT=pi | Generic marker that lets tooling identify the launching agent |
PI_CODING_AGENT=true | Lets a child process detect that it runs inside the coding agent |
Related
- Settings covers the same behavior in configuration.
- Settings lists the configuration files and keys.
- Terminal setup covers display and key problems.