User Guide & Documentation

Learn how to use AI CLI Config Studio to connect OpenAI-compatible gateways, discover authorized models, and configure AI coding CLIs with automatic backups.

📖 How to Use AI CLI Config Studio

Setting up your AI coding assistant with a custom gateway takes less than 30 seconds using the 3-step workflow:

1 Connect your AI Gateway Provider

Choose one of the quick presets (9Router, OpenRouter, DeepSeek, Groq, Together AI) or type your custom gateway URL into the Base URL input.

Enter your gateway API key into the API Key input and click Fetch Models.

🔒 Security Guarantee: Your API key is saved only in this browser's local storage so the form survives a reload. It is used to query your provider's /models endpoint and injected directly into your local clipboard command. It is never stored in a remote database or transmitted to a third-party service.
2 Select Model & Assistant
  • Target Model: Select your preferred model from the dropdown populated by your gateway.
  • Target Assistant: Choose from Claude Code, Codex CLI, or OpenCode.
3 Copy & Execute the Generated Command

Choose Temporary or Permanent configuration and select macOS / Linux or Windows directly above the command preview. Then click the copy button and paste the command into your terminal.

No Node.js setup required: You do not need Node.js, npm, Bun, or project dependencies. Temporary macOS/Linux commands use shell features only. Permanent commands automatically use Python 3, system Perl, or the JavaScript runtime built into macOS; Windows uses PowerShell.

Permanent mode will automatically:

  1. Create a timestamped backup of any existing configuration (e.g. ~/.claude/settings.json.bak-YYYYMMDD-HHMMSS).
  2. Safely merge the gateway URL, authentication key, and model directly into your config file.
  3. Preserve all of your other custom preferences, tools, and hooks.
  4. Show each setup step, then open the selected CLI interactively with the chosen model.

Permanent mode opens the CLI after saving the configuration. It does not send an automatic prompt or make a model request by itself.

Temporary mode produces a readable command with plainly labeled environment variables, then immediately opens the selected CLI with the chosen model in that terminal session. It does not modify or back up configuration files, and it does not send an automatic prompt.

💻 CLI Usage & Verification Guides

After running the generated command in your terminal, verify that your assistant is connected to your gateway:

🟣 1. Claude Code (`claude`)

Launch Claude Code and check its active configuration status:

# Start Claude Code in any project
claude

# Inside Claude Code session, check gateway status:
/status

You can also specify models on launch: claude --model <model-name>.

🟢 2. OpenAI Codex CLI (`codex`)

Your settings are saved to ~/.codex/config.toml using a custom OpenAI-compatible model provider. Launch Codex to start generating code:

# Run Codex CLI
codex

🟠 3. OpenCode (`opencode`)

OpenCode reads from ~/.config/opencode/opencode.json. Launch it with:

# Start OpenCode TUI
opencode

⏪ Restoring Previous Backups

Every time you generate and run a command, an automatic timestamped backup is made before modifying any files.

To revert to your previous configuration:

  1. Go to the Studio page.
  2. Expand the Restore Previous Config accordion below the terminal preview.
  3. Click Copy Restore Command.
  4. Paste and run the command in your terminal. It reinstates the most recent .bak-* file, chosen by the timestamp in its name.

The restore command reports what it did: it prints the backup it reinstated, or exits with No backup found when there is nothing to roll back to. Before overwriting the current configuration it keeps a .prerestore-YYYYMMDD-HHMMSS copy, so an accidental restore can be undone. That copy is never treated as a backup, so running the restore twice reinstates the same .bak-* file both times.

📁 Configuration File Locations & Schema

Below are the persistent configuration paths and schemas managed by AI CLI Config Studio:

CLI Tool macOS / Linux Path Windows Path Key Attributes Configured
Claude Code ~/.claude/settings.json $HOME\.claude\settings.json env.ANTHROPIC_BASE_URL, env.ANTHROPIC_AUTH_TOKEN, env.ANTHROPIC_MODEL, effortLevel, modelSettings
Codex CLI ~/.codex/config.toml $HOME\.codex\config.toml model, model_provider, model_providers.config-studio, model_reasoning_effort
OpenCode ~/.config/opencode/opencode.json $HOME\.config\opencode\opencode.json model, provider.config-studio.options, provider.config-studio.models (with options.reasoningEffort)

🌐 Supported Gateways & Presets

AI CLI Config Studio works with any public HTTPS provider that exposes an OpenAI-compliant GET /models endpoint. Built-in presets include:

  • 9Router: https://9router.eminai.cloud/v1
  • OpenRouter: https://openrouter.ai/api/v1
  • DeepSeek: https://api.deepseek.com/v1
  • Groq: https://api.groq.com/openai/v1
  • Together AI: https://api.together.xyz/v1

🛡️ Privacy & Security Guarantees

  • In-Memory Only: API keys are never stored on disk, never logged to terminal history on the server, and never sent to remote analytics.
  • Zero Telemetry: No tracking cookies, external analytics, or remote logging.
  • SSRF Hardening: The proxy requires HTTPS, validates resolved IPv4 and IPv6 addresses, blocks local/private networks, and refuses cross-origin redirects.

🐳 Running Locally or with Docker

Local Bun Server

bun install
bun run dev

Docker Compose

docker compose up -d

Run Directly from GitHub (No Clone Needed)

docker build -t ai-cli-config-studio https://github.com/KhBayazidAhmed/ai-cli-config-studio.git#main
docker run -d -p 3000:3000 --name ai-cli-config-studio ai-cli-config-studio