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

  1. List your agents and copy an id.

    octo agents list
    
  2. Save it as the default.

    octo config set defaultAgent agt_123
    
  3. Run 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:

  1. A command line flag, such as --agent or --json.
  2. An environment variable. OCTO_API_KEY sets the API key.
  3. 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.

Something unclear or missing? Tell us and we will fix the page.