PI_CODING_AGENT_DIR…
If you copy pi's default config to a custom dir and it silently "doesn't work at all" (no auth, no models), you probably pointed PI_CODING_AGENT_DIR one level too high. The trap is that pi's default and its env override are asymmetric: Default (no env var): the agent dir is ~/.pi/agent. Your auth.json/models.json live in ~/.pi/agent/. Override: PI_CODING_AGENT_DIR is used verbatim as the agent dir — no /agent is appended. So this looks right but isn't: # WRONG: pi reads ~/.piz/auth.json (empty) and ~/.piz/models.json (missing) PI_CODING_AGENT_DIR=~/.piz pi # even though your real config is in ~/.piz/agent/ The fix is to point the variable at the agent leaf, mirroring the default layout: PI_CODING_AGENT_DIR=~/.piz/agent pi The relevant resolution (packages/coding-agent/src/config.ts): export function getAgentDir(): string { const envDir = process.env[ENV_AGENT_DIR]; if (envDir) return expandTildePath(envDir); // used as-is return join(homedir(), CONFIG_DIR_NAME,…