Environment variables
| Variable | Default | Purpose |
|---|---|---|
CASTELLAN_SOCKET | ~/.config/castellan/castellan.sock | Multiplexer Unix socket path |
CASTELLAN_ENV | unset | Set to 1 in castellan-managed pane shells |
RUST_LOG | info | Tracing filter for castellan subcommands |
CASTELLAN_DOCS_URL | https://castellan-docs.pages.dev | llms.txt / sitemap base URL in CI scripts |
OPENROUTER_API_KEY | unset | OpenRouter auth when [models] provider = "openrouter" (never store in TOML) |
OPENAI_API_KEY | unset | OpenAI / compatible HTTP LLM auth |
CASTELLAN_LLM_API_KEY | unset | Fallback LLM API key (any OpenAI-compatible provider) |
CASTELLAN_LLM_BASE_URL | provider default | Override OpenAI-compatible base URL |
CASTELLAN_LLM_MODEL | gpt-4o-mini | Default model id for env-based HTTP clients |
OLLAMA_URL | unset | Optional local LLM base (doctor/tests; Ollama provider appends /v1) |
OLLAMA_MODEL | llama3.2 | Model name for Ollama chat API |
GOVCRAFT_MODE | in_tree_honest_equivalent | Meeting-sched acceptance mode: upstream_meeting_sched, llm_scheduling_hook (historical env name) |
GOVCRAFT_UPSTREAM_TRIALS | 5 | Trial count for --upstream-repro deterministic sweep |
CASTELLAN_PERMISSION_MODE | unset | Override permissions.default_mode (allow / deny / prompt) |
CASTELLAN_PERMISSION_PROMPT | unset (non-TTY → deny) | Headless Prompt resolution: allow or deny. TTY castellan run prompts interactively when unset. Legacy: FLOCK_PERMISSION_PROMPT |
OpenRouter
export OPENROUTER_API_KEY=sk-or-...
# castellan.toml:
# [models]
# provider = "openrouter"
# default = "openai/gpt-4o-mini"
cargo run -p castellan-cli --features llm-http -- doctor
cargo test -p castellan-runtime --features llm-http openrouter_chat_completions_smoke -- --ignored
castellan doctor stage llm_provider reports key_present and TCP reachability — never the key value.
Upstream meeting-sched acceptance (Bet 1)
Optional LLM repro on the upstream meeting-sched fixture (govcraft_acceptance crate — historical name):
export OLLAMA_URL=http://127.0.0.1:11434
cargo test -p govcraft_acceptance --test llm_integration -- --ignored
cargo run -q -p govcraft_acceptance -- --upstream-repro
Without OLLAMA_URL, --upstream-repro emits deterministic baselines and an honest gap table (not the published 48.5% LLM band).
Session / remote
| Variable | Purpose |
|---|---|
SSH_AUTH_SOCK | Used by castellan remote --ssh for agent forwarding |
Hooks
See agent hooks for CASTELLAN_SOCKET in shell hook scripts.
Related
- castellan.toml —
[models]provider seam - CLI reference
- Multiplexer overview
- Stigmergy ablation