9.2 Configuring the CLI

Two kinds of settings:

9.2.1 Default config file location

If you do not pass --config PATH and do not set $OWNSONA_CONFIG, the CLI looks at an OS-specific default:

OSDefault config path
Linux / BSD~/.config/ownsona/config.ini
macOS~/Library/Application Support/ownsona/config.ini
Windows%LOCALAPPDATA%\ownsona\config.ini

Create the parent directory if it doesn’t exist (mkdir -p ~/.config/ownsona on Linux, etc.).

9.2.2 Resolution order

For every setting, highest priority wins:

  1. CLI flag (--config, --server, --token, ...).
  2. Environment variable (OWNSONA_SERVER, OWNSONA_TOKEN, OWNSONA_LLM_API_KEY, etc.).
  3. Config file at $OWNSONA_CONFIG or the OS-specific default.
  4. Built-in defaults (only for LLM-side keys).

9.2.3 Config file format

INI-style. # and ; start comments. [sections] are parsed but ignored. A template ships at cli/config.ini.example:

# --- MCP server (required for every subcommand) ---
server_url = https://your.host/mcp
token      = <bearer-token>

# --- LLM (used only by `teach`) ---
llm_api_key  = sk-...
llm_model    = gpt-4o
llm_base_url = https://api.openai.com/v1
subject_name = Blake

The token is the same bearer token any other MCP client uses against your OwnSona server. Treat it as a secret.