Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content
SDKs and tools

Command line

mubit-cli is for developers who manage Mubit from a terminal, a script or CI. It does what the console does for projects, calls, tasks and trained models, keys, usage and jobs. This page covers version 1.0.5.

Install

Homebrew

brew install MubitLabs/tap/mubit-cli

Release archives

Download the archive for your platform from the latest release. A .sha256 file sits beside each archive. Check the archive against it before you run the program.

PlatformArchive
macOS, Apple siliconmubit-cli-<version>-macos-arm64.tar.gz
macOS, Intelmubit-cli-<version>-macos-x86_64.tar.gz
Linux, arm64mubit-cli-<version>-linux-arm64.tar.gz
Linux, x86_64mubit-cli-<version>-linux-x86_64.tar.gz
Windows, x86_64mubit-cli-<version>-windows-x86_64.zip
shasum -a 256 -c mubit-cli-<version>-<platform>.tar.gz.sha256
tar -xzf mubit-cli-<version>-<platform>.tar.gz
sudo mv mubit-cli-<version>-<platform>/mubit-cli /usr/local/bin/

On Windows, unzip the archive and put mubit-cli.exe in a folder on your PATH.

On Linux, the CLI keeps a stored key in the system secret service, so a downloaded build needs libdbus when it runs. Homebrew installs it for you.

sudo apt-get install -y libdbus-1-3    # Debian, Ubuntu
sudo dnf install -y dbus-libs          # Fedora, RHEL

Run mubit-cli --version to check the install, and mubit-cli --help for the list of commands.

ℹ️Note

The command is mubit-cli. pip install mubit-sdk also puts a command named mubit on your PATH. It is a separate program, and this page doesn't cover it.

Sign in

mubit-cli signs in with a management key, which starts with mwm_. It doesn't use inference keys: those are for sending model calls through Mubit. SDKs and tools shows how to create a management key and what each role can do.

Give the key to the CLI in one of two ways. The first reads the key from the environment on every run and stores nothing:

export MUBIT_MANAGEMENT_KEY=<your management key>
mubit-cli whoami

The second stores the key. login asks for it without showing it:

mubit-cli login
mubit-cli whoami

In a script, pipe the key to mubit-cli login instead. whoami shows your organization and the key in use, masked.

The key goes to your system keychain: macOS Keychain, Windows Credential Manager or the Linux secret service. On a machine without one, add --storage file: the key then goes to a file that only you can read. To make that the default, run mubit-cli config set storage file. mubit-cli logout removes the stored key.

The CLI looks for a key in this order: --key, then MUBIT_MANAGEMENT_KEY, then the stored key. Prefer the variable to --key: a key on the command line shows up in your shell history and in process lists.

Commands

Every command takes --help. A command with ls also answers to list.

mubit-cli tasks ls                                      # every task, with its stage
mubit-cli calls ls --project <project-id> --limit 20
mubit-cli calls feedback <call-id> --rating down --comment "Missed the sales tax line."
 
mubit-cli tasks train <task-id>                         # train a new version now
 
mubit-cli versions ls <task-id>
mubit-cli versions rollout <version-id> --canary 10     # serve it on 10% of the task's calls
mubit-cli versions promote <version-id>                 # then on all of them
mubit-cli versions rollback <version-id>                # or go back to the previous version
AreaCommands
Sign inlogin, logout, whoami
Projectsprojects ls, projects get <id>
Keyskeys ls --project <id>, providers ls, management-keys ls, management-keys create --name <name> --role <role> [--project <id>], management-keys rotate <id>, management-keys revoke <id>
Callscalls ls, calls get <id>, calls feedback <id> --rating <up|down> [--comment <text>] [--correction <text>]
Taskstasks ls, tasks get <id>, tasks examples <id>, tasks settings get <id>, tasks train <id> [--reason <text>] [--dry-run]
Trained modelsversions ls <task-id>, versions get <id>, versions rollout <id> [--shadow <percent>] [--canary <percent>], versions promote <id> [--reason <text>], versions rollback <id>
Lessonslessons ls [--status <status>], lessons get <id>
Importsimports ls
Usage and activityusage [--project <id>] [--start-date <date>] [--end-date <date>], billing, activity
Jobsjobs get <id>, jobs wait <id> [--timeout <seconds>]
The CLI itselfconfig list, config get <key>, config set <key> <value>, config unset <key>, console [--no-browser]

Manage Mubit shows each command next to the SDK methods and MCP tools that do the same. console opens the Mubit console in your browser, or prints its address with --no-browser.

The CLI also has commands for operations Mubit doesn't serve yet. Mubit answers those with 501 not_implemented, and this page leaves them out.

A few commands in detail:

  • versions rollout sets how much of a task's traffic a version gets. --shadow runs it silently beside the current model, and --canary serves it on a share of the calls.
  • jobs wait prints the job's last state when it stops. It exits 0 when the job succeeds, and 1 when the job fails, is canceled, or the timeout (60 seconds unless you set another) passes first.

Output and scripting

  • Tables by default. --json prints the API's answer as JSON, and --jsonl prints one JSON object per line. Progress, warnings and errors go to stderr, so stdout stays pipeable.
  • Lists come in pages. A list command prints its first page. When there are more, a table ends with Next cursor: <value>, and --json shows it as next_cursor. Pass it back with --cursor <value>. --limit <n> sets the page size.
  • Destructive commands ask first, for example versions rollback and management-keys revoke. In a script, pass --yes. Without a terminal and without --yes, such a command sends no request and exits with code 2.
  • A new key is shown once, when you create or rotate it. Save it then.
FlagEnvironment variableWhat it does
--keyMUBIT_MANAGEMENT_KEYThe management key to use.
--base-urlnoneThe API's address. The default is https://api.mubit.ai.
--projectnoneThe project for commands that filter by project.
--storagenoneWhere login keeps the key: keyring (the default) or file.
--json, --jsonlnoneThe output format. mubit-cli config set output json makes JSON the default.
--yesnoneSkip the confirmation question.

Exit codes

CodeMeaning
0Success.
1An unexpected error, or a job that failed, was canceled or timed out under jobs wait.
2A usage error: a bad flag or value, an HTTP 400, or confirmation required (run again with --yes).
3No key, or the key was refused (HTTP 401 or 403).
4Not found (HTTP 404).
5A conflict (HTTP 409 or 412).
6Rate limited (HTTP 429).
7A server error (HTTP 5xx).

With --json, an error also prints a JSON object with error and exit_code on stderr.

Related