Configure AI Coding Tools with ModelGo CLI

ModelGo provides two official command-line tools. Choose the task you want to complete and run the corresponding command.

@model-go/config

Connect AI coding clients

Configure Claude Code, Codex, and other common clients with one command.

bash
npx @model-go/config -r global
@model-go/cli

Use the official CLI

Pair it with official ModelGo Skills so an AI agent can operate ModelGo directly.

bash
npx @model-go/cli@latest install

Connect AI coding clients @model-go/config

Guided setup

Follow the terminal prompts to enter your API key, select clients and models, review the configuration, and verify connectivity after the changes are written.

bash
npx @model-go/config -r global

One-command setup (non-interactive, suitable for automation)

bash
npx @model-go/config -k mgk_your_api_key -r global --only claude,codex

Pass a comma-separated list of client IDs to --only. Passing -k switches the tool to non-interactive mode: it no longer prompts for the key, clients, or models, and skips the confirmation. Without --only it configures Claude Code and Codex, without --models it writes every available chat model, and without -r it uses the international site (global), so always include -r global. Every selected client must already be installed; otherwise the tool lists the missing clients and exits without writing any configuration.

Supported clients

Claude Code Hermes Copilot CLI OpenCode DeepSeek Harness
Codex Factory Droid nanobot Oh My Pi
OpenClaw CC Switch Crush CodeBuddy

Client IDs for --only: claude, codex, openclaw, hermes, factory, cc-switch, copilot, nanobot, crush, opencode, oh-my-pi, codebuddy, dsh.

What happens next

StepPrompt
01Enter your ModelGo API key.
02Select one or more clients, or choose “Configure all.” The tool checks that the selected clients are installed.
03Select the models to write into the clients (multiple allowed).
04Review the site, Base URL, masked API key, and selected clients.
05Confirm the changes, write the client configuration, and verify connectivity with GET /v1/models. A failed check only prints a warning; the configuration is still written.

Common options:

OptionDescription
-k, --api-keyModelGo API key; omit it to enter the key at the prompt.
-r, --regionSite: domestic (China site) or global (international site).
--onlyComma-separated client IDs, or all.
--modelsComma-separated model names, or all. Interactive runs show a picker when omitted; non-interactive runs write every available model.
--skip-verifySkip the connectivity check after writing.

Common usage

bash
# Configure several clients at once
npx @model-go/config -k mgk_your_api_key -r global --only claude,codex,crush

# Configure all 13 clients (enter the key and pick models at the prompts)
npx @model-go/config -r global --only all

# Write only specific models
npx @model-go/config -k mgk_your_api_key -r global --only claude,codex --models your-model-1,your-model-2
  • --only all is the same as choosing “Configure all” in the picker. If any installation check fails, the tool exits without writing anything: Claude Code, Codex, and OpenClaw are checked for their commands, DeepSeek Harness for ~/.dsh/settings.yaml, and the other clients are not checked, so make sure they are installed. Listing only the clients installed on your machine is usually safer.
  • Models are selected once with --models and shared by every client in the run. Model names not in the catalog are reported and skipped; if none match, the tool falls back to writing all models. Each client's default model is picked automatically from the selected models, preferring the newest GPT-5 models.
  • Claude Code, Copilot CLI, and Crush write environment variables to your shell profile. When the run finishes, the terminal prints a source command to apply them to the current terminal.
  • For the exact files each client writes, see the “One-command setup” note in its setup guide.

Setup succeeded: the terminal reports that configuration is complete and the connectivity check passes, then shows how to start the selected client.

View @model-go/config on npm

Let an AI agent operate ModelGo @model-go/cli

Install the official CLI and ModelGo Skills when you want an agent such as Claude Code or Codex to use ModelGo directly. The installer sets up the CLI, distributes Skills, selects the site, and optionally signs you in.

bash
npx @model-go/cli@latest install

What happens next

StepPrompt
01Confirm installation of @model-go/cli when npm asks.
02Choose Simplified Chinese or English. The rest of the installation prompts will use your selected language.
03Install or upgrade the ModelGo CLI and install ModelGo Skills.
04Select the environment for this site (https://api.modelgo.ai).
05Choose whether to sign in through the browser now, or skip and run modelgo auth login later.

Using the CLI after installation

After installation, restart your AI agent or open a new session. ModelGo Skills lets the agent call the ModelGo CLI directly to perform queries and operations, so you can ask in natural language, for example:

  • “Which models does ModelGo currently support?”
  • “What is my current ModelGo account balance?”

To use the CLI yourself, run modelgo in your terminal to see every available command and option:

bash
modelgo

The most common commands are grouped by task:

TaskCommon commandsWhat they do
Authenticationmodelgo auth login, modelgo auth status, modelgo auth logoutSign in to ModelGo, inspect the current authentication state, or clear local credentials.
Environmentsmodelgo env list, modelgo env current, modelgo env use <name>List environments, show the active environment, or switch sites. Use env add and env remove to manage custom environments.
Workspacesmodelgo tenant list, modelgo tenant use <slug>List the workspaces available to your account and use a workspace slug or ID to select the workspace for subsequent CLI commands.
Account and usagemodelgo balance, modelgo permissions, modelgo logsView balances and transactions, account permissions, call logs, and usage statistics.
Model callsmodelgo models, modelgo chat, modelgo embeddings, modelgo callList available models, make chat or embedding requests, or call any /v1/* model endpoint directly.
Keys and paymentsmodelgo key, modelgo payManage the model API key stored for the active environment or configure x402 pay-per-call payments.
CLI maintenancemodelgo update, modelgo --version, modelgo --helpUpdate the CLI, print its version, or reopen the complete help output.

Run modelgo <command> --help to inspect the options for a specific command. For balance, permissions, and logs, you can also use the global --tenant <slug\|id> option to target a workspace for that command only.

View @model-go/cli on npm

Continue exploring