Configuration

Configure the Opta CLI with persistent settings, environment profiles, and a TUI settings menu. All configuration is stored in a single JSON file and can be managed via commands or edited directly.

Overview

The Opta CLI stores its configuration in a JSON file at ~/.config/opta/config.json. Settings control connection parameters, default model selection, provider fallback behavior, UI preferences, and more. You can manage configuration through three interfaces: CLI commands, the TUI settings menu, or direct file editing.

Config Commands

Listing Config

opta config list displays all current configuration values in a readable format. Settings are grouped by category.

List all configuration settings
opta config list
connection.host     192.168.188.11
connection.port     1234
model.default       qwen3-30b-a3b
provider.fallback   true
ui.theme            dark
ui.streaming        true

Get and Set

Use opta config get to read a single setting and opta config set to update one. Settings use dot notation for nested keys.

Read a single setting
opta config get connection.host
192.168.188.11
Update a setting
opta config set connection.host 192.168.1.100
connection.host = 192.168.1.100
Change default model
opta config set model.default deepseek-r1
model.default = deepseek-r1

TUI Settings Menu

opta config menu opens an interactive terminal UI for browsing and modifying settings. This is the easiest way to explore available options and understand what each setting does.

Open interactive settings TUI
opta config menu
Settings TUI
Opta Settings
━━━━━━━━━━━━━
> Connection
    Host: 192.168.188.11
    Port: 1234
  Model
    Default: qwen3-30b-a3b
    Fallback: Anthropic (enabled)
  UI
    Theme: dark
    Streaming: enabled

[Enter] Edit  [Tab] Next section  [q] Save & Quit

Config File Location

The configuration file lives at ~/.config/opta/config.json and follows the XDG Base Directory specification. On Linux, it respects $XDG_CONFIG_HOME if set.

~/.config/opta/config.json
{
  "connection": {
    "host": "192.168.188.11",
    "port": 1234
  },
  "model": {
    "default": "qwen3-30b-a3b",
    "aliases": {
      "qwen": "mlx-community/Qwen3-30B-A3B-MLX-4bit",
      "deepseek": "mlx-community/DeepSeek-R1-0528-MLX-4bit"
    }
  },
  "provider": {
    "fallback": true,
    "anthropicKey": null
  },
  "ui": {
    "theme": "dark",
    "streaming": true
  }
}
Info
The config file is created automatically on first run with sensible defaults. You can safely edit it by hand -- the CLI validates the schema on startup and reports any errors.

Environment Profiles

Environment profiles let you save and switch between named configuration snapshots. This is useful when you work with different LMX servers, switch between local and cloud inference, or maintain separate configs for different projects.

1

Save the current config as a profile

opta env save home
Profile 'home' saved.
2

Modify settings for a different environment

opta config set connection.host 10.0.0.50
3

Save the new config as another profile

opta env save office
Profile 'office' saved.
4

Switch between profiles

opta env use home
Switched to profile 'home'.\nconnection.host = 192.168.188.11
List all environment profiles
opta env list
Profiles:
  * home    (active)
    office
Quick switching
Profiles are stored alongside the main config file at ~/.config/opta/profiles/. Switching profiles overwrites the active config, so always save your current settings before switching.

Key Settings Reference

KeyDefaultDescription
connection.host192.168.188.11LMX server IP address
connection.port1234LMX server port
model.defaultqwen3-30b-a3bModel loaded at daemon startup
provider.fallbacktrueFall back to Anthropic if LMX fails
provider.anthropicKeynullAnthropic API key for cloud fallback
ui.themedarkCLI color theme
ui.streamingtrueEnable token-by-token streaming output