Configuration
The CLI's local config file — three non-secret keys, where it lives, and how each value resolves.
The CLI keeps a small TOML file for your defaults. It holds exactly three non-secret keys, and it never holds credentials — API keys and login tokens live in your operating system's keychain, not on disk. Anything the config file sets, a flag or an environment variable can override for a single command.
api_url = "https://api.solwyn.ai"
default_project = "proj_abc12345"
format = "table"Where the file lives
The location follows platform convention via platformdirs — config.toml inside user_config_dir("solwyn"):
| Platform | Path |
|---|---|
| macOS | ~/Library/Application Support/solwyn/config.toml |
| Linux | ~/.config/solwyn/config.toml |
The directory and file are created the first time you write a value. Writes are atomic — the CLI stages a temporary file and replaces the config in one step under a cross-process lock, so a concurrent write or an interrupted one never leaves a half-written file. Unknown keys are ignored on read, so downgrading the CLI never breaks on a key a newer version wrote.
The three keys
These are the only keys the CLI models. Each has a matching environment variable and a default:
| Key | Environment override | Default | Meaning |
|---|---|---|---|
api_url | SOLWYN_API_URL | https://api.solwyn.ai | Solwyn Cloud API base URL |
default_project | SOLWYN_PROJECT_ID | (none) | Project used when --project is omitted |
format | SOLWYN_FORMAT | table | Default output format — table or json |
The output key is format, and its only values are table and json. See Scripting and CI for what each format does.
api_url must be a credential-free absolute HTTP(S) URL. The CLI rejects a value that carries a username or password, a query string, a fragment, or whitespace — a base_url is never a place to smuggle a secret. Point it at a self-hosted deployment or a local API during development:
api_url = "http://localhost:8000"How each value resolves
Every value resolves on its own, highest priority first:
api_url — --api-url flag → SOLWYN_API_URL → config api_url → https://api.solwyn.ai.
Project — --project / -p flag → SOLWYN_PROJECT_ID → config default_project. If none of these is set and the command needs a project, it fails with guidance.
Output format — --format (or --json) → SOLWYN_FORMAT → config format → table.
Reading and writing the file
The config command group manages the file for you, so you rarely edit the TOML by hand:
solwyn config list— prints every key askey=value.solwyn config get <key>— prints a single value.solwyn config set <key> <value>— validates and persists one key atomically.
Only the three keys above are accepted; any other key is a usage error. These commands emit plain text and ignore --format and --json — solwyn config get format prints the bare value, never a JSON object. Full reference: solwyn config.
Credentials never appear in this file. It models non-secret settings only; your project API key and login token are stored in the OS keychain. See Authentication and solwyn keys.
Related
- Scripting and CI — output formats, JSON schemas, and exit codes
- Authentication — credential storage and resolution
- SDK configuration reference — the Python SDK's settings, separate from the CLI