Configuration
Where the CLI stores things, the environment variables it reads, what it writes to disk, and how it behaves in scripts.
Environment variables
Config lives at ~/.config/stndp/config.json (created owner-readable only, since it
holds your token). Endpoints are resolved from the environment, never from disk:
STNDP_DEV=1 # point the CLI at the local dev stack (http://127.0.0.1:8080, API under /api)
STNDP_API_URL=... # override the API base URL explicitly
STNDP_WEB_URL=... # override the web base URL explicitly
STNDP_AGENT_LABEL=... # label MCP/agent writes are attributed to (default: mcp)
STNDP_EDITOR_STATE=... # path to the editor state file `checkpoint --editor` reads
CODEX_HOME=... # override where `agent setup --target codex` writes config
By default the CLI talks to production: https://stndp.io for the browser login and
https://stndp.io/api for the API. With STNDP_DEV=1 it targets the local
stack at 127.0.0.1:8080 (IPv4 — not localhost, which can resolve to IPv6
::1 first and stall each request); STNDP_API_URL /
STNDP_WEB_URL override either explicitly. Real environment variables always win.
.env handling. The CLI loads a .env only from
~/.config/stndp/.env — your per-user config dir — and never from the
current working directory. This is deliberate: the CLI sends your bearer token on every API call
and may run from any repo (including a git hook), so a project-local .env pointing
STNDP_API_URL at an attacker's host could otherwise capture the token. Set
STNDP_DEV=1 in your shell to target localhost instead.
Files stndp writes
~/.config/stndp/config.json # your identity + bearer token (owner-readable only)
~/.config/stndp/.env # optional, for local dev (the only .env that's auto-loaded)
~/.stndp/YYYY/MM/YYYY-MM-DD.md # Markdown mirror of each posted/edited entry
~/.stndp/checkpoints/ # checkpoint mirrors (by id + latest-*.json) for offline resume
~/.stndp/glob/ # per-repo markers so `stn glob` stays idempotent
~/.stndp/editor.json # editor state read by `checkpoint --editor` (or $STNDP_EDITOR_STATE)
./stndp-export/ # default output of `stn export`
In a project, stn agent setup also writes
.mcp.json, .cursor/mcp.json, .gemini/settings.json, a
CLAUDE.md / AGENTS.md / GEMINI.md rules block, and (globally)
~/.codex/config.toml / ~/.codeium/windsurf/mcp_config.json;
stn hooks install writes
.git/hooks/post-commit. Writes are atomic, so an interrupted command can't leave a
truncated file.
Exit codes & output
0— success.1— a runtime or API error (the API's message is printed), or you're not logged in.2— a validation error caught before any request (e.g. an invalid--severity;--autowith no interactive terminal; or a required value omitted while running non-interactively, where the message names the argument to pass).
Most commands render Rich tables or formatted feeds. brag
and export emit Markdown; resume
--json emits machine-readable JSON. When a command needs a value you didn't pass it
prompts — except where a prompt would silently auto-confirm a machine-generated draft, which is
refused outside a terminal (so the CLI is safe to script).