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-cliRelease 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.
| Platform | Archive |
|---|---|
| macOS, Apple silicon | mubit-cli-<version>-macos-arm64.tar.gz |
| macOS, Intel | mubit-cli-<version>-macos-x86_64.tar.gz |
| Linux, arm64 | mubit-cli-<version>-linux-arm64.tar.gz |
| Linux, x86_64 | mubit-cli-<version>-linux-x86_64.tar.gz |
| Windows, x86_64 | mubit-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, RHELRun mubit-cli --version to check the install, and mubit-cli --help for the list of commands.
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 whoamiThe second stores the key. login asks for it without showing it:
mubit-cli login
mubit-cli whoamiIn 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| Area | Commands |
|---|---|
| Sign in | login, logout, whoami |
| Projects | projects ls, projects get <id> |
| Keys | keys 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> |
| Calls | calls ls, calls get <id>, calls feedback <id> --rating <up|down> [--comment <text>] [--correction <text>] |
| Tasks | tasks ls, tasks get <id>, tasks examples <id>, tasks settings get <id>, tasks train <id> [--reason <text>] [--dry-run] |
| Trained models | versions ls <task-id>, versions get <id>, versions rollout <id> [--shadow <percent>] [--canary <percent>], versions promote <id> [--reason <text>], versions rollback <id> |
| Lessons | lessons ls [--status <status>], lessons get <id> |
| Imports | imports ls |
| Usage and activity | usage [--project <id>] [--start-date <date>] [--end-date <date>], billing, activity |
| Jobs | jobs get <id>, jobs wait <id> [--timeout <seconds>] |
| The CLI itself | config 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 rolloutsets how much of a task's traffic a version gets.--shadowruns it silently beside the current model, and--canaryserves it on a share of the calls.jobs waitprints 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.
--jsonprints the API's answer as JSON, and--jsonlprints 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--jsonshows it asnext_cursor. Pass it back with--cursor <value>.--limit <n>sets the page size. - Destructive commands ask first, for example
versions rollbackandmanagement-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.
| Flag | Environment variable | What it does |
|---|---|---|
--key | MUBIT_MANAGEMENT_KEY | The management key to use. |
--base-url | none | The API's address. The default is https://api.mubit.ai. |
--project | none | The project for commands that filter by project. |
--storage | none | Where login keeps the key: keyring (the default) or file. |
--json, --jsonl | none | The output format. mubit-cli config set output json makes JSON the default. |
--yes | none | Skip the confirmation question. |
Exit codes
| Code | Meaning |
|---|---|
| 0 | Success. |
| 1 | An unexpected error, or a job that failed, was canceled or timed out under jobs wait. |
| 2 | A usage error: a bad flag or value, an HTTP 400, or confirmation required (run again with --yes). |
| 3 | No key, or the key was refused (HTTP 401 or 403). |
| 4 | Not found (HTTP 404). |
| 5 | A conflict (HTTP 409 or 412). |
| 6 | Rate limited (HTTP 429). |
| 7 | A server error (HTTP 5xx). |
With --json, an error also prints a JSON object with error and exit_code on stderr.
Related
- SDKs and tools: the keys, and the other tools.
- Manage Mubit: every operation in all four tools.
- Releases: the archives and their checksums.