Configuration
Configuration, scripting and debugging.
1 min read
Configuration
The CLI reads configuration in this order (first match wins):
- Command-line flags (
--api-key,--project) - Environment variables (
CODESPAR_API_KEY,CODESPAR_PROJECT) - The config file at
~/.codespar/config.json
Project scoping
If you have multiple CodeSpar projects, pin the CLI to one:
codespar config set project proj_abc123Or per-command:
codespar servers list --project proj_abc123Scripting
The CLI returns valid JSON on stdout and human-readable messages on stderr, so you can pipe output into jq:
# Servers that support Pix, as a newline-delimited list
codespar servers list --json | jq -r '.[] | select(.capabilities | contains(["pix"])) | .id'Use --json on any command to force JSON output even in a TTY.
Debugging
Add --verbose to any command to see the underlying HTTP requests:
codespar servers list --verboseReset the CLI (clears cached auth, config, and completions):
codespar reset