octo config: CLI settings
View and change Askocto CLI settings such as the default agent and output format, and learn where the config file lives.
Working draft. These docs are illustrative: names, endpoints and examples describe the intended behaviour and can change before launch.
octo config reads and writes the CLI's settings. Use it to set a default agent so you do not repeat --agent, to switch the output format, or to see where the config file is stored.
The config file
Settings live in a JSON file at ~/.config/octo/config.json. The CLI creates it the first time you sign in.
{
"apiKey": "oc_live_a1b2c3d4e5",
"baseUrl": "https://api.askocto.co",
"defaultAgent": "agt_123",
"output": "table"
}
Settings
| Key | Description |
|---|---|
apiKey |
The API key saved by octo auth. |
baseUrl |
The API address. The default is https://api.askocto.co. |
defaultAgent |
The agent id used when a command needs --agent and you leave it out. |
output |
table for people or json for scripts. |
Commands
octo config list
octo config get defaultAgent
octo config set defaultAgent agt_123
octo config set output json
octo config unset defaultAgent
octo config path
| Command | What it does |
|---|---|
octo config list |
Prints every setting. The API key is shortened to its prefix. |
octo config get KEY |
Prints one value. |
octo config set KEY VALUE |
Saves a value. |
octo config unset KEY |
Removes a value and returns to the default. |
octo config path |
Prints the location of the config file. |
Set a default agent
List your agents and copy an id.
octo agents listSave it as the default.
octo config set defaultAgent agt_123Run a command without the flag.
octo sources list
You should see the sources of agt_123. Pass --agent agt_456 on any command to override the default for one call.
Order of precedence
For each value the CLI uses the first match from this list:
- A command line flag, such as
--agentor--json. - An environment variable.
OCTO_API_KEYsets the API key. - The config file.
Warning: The config file holds your API key in plain text. Do not commit it, and set its permissions so only your user can read it.
Related pages
- octo auth for keys and sign-in.
- CLI overview for the conventions all commands share.