CLI Tools

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

To use ModelGo in Claude Code, Codex, OpenCode, or another supported AI coding client, choose guided setup or configure all clients with a single command.

Guided setup

Follow the terminal prompts to enter your API key, select clients, 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 sk-your-token -r global --only all

Supported clients

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

Guided setup lets you select one or more clients; use --only all to configure every supported client at once.

What happens next

StepPrompt
01Enter your ModelGo API key.
02Select one or more clients, or choose “Configure all.”
03Review the site, Base URL, masked API key, and selected clients.
04Confirm the changes, write the client configuration, and verify connectivity.

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