Agent-first AI platform access. Sign up users, manage accounts, generate content, handle billing — 105+ commands, all programmatic, all non-interactive.
Installation
Install with your preferred package manager or download a prebuilt binary.
# Install via Homebrew $ brew install modelslab/tap/modelslab
# Install via .deb package $ curl -fsSL https://github.com/ModelsLab/modelslab-cli/releases/latest/download/modelslab_linux_amd64.deb \ -o modelslab.deb && sudo dpkg -i modelslab.deb
# Install via Scoop > scoop bucket add modelslab https://github.com/ModelsLab/scoop-bucket > scoop install modelslab
# Install via shell script (macOS, Linux) $ curl -fsSL https://modelslab.sh/install.sh | sh
# Install via Go $ go install github.com/ModelsLab/modelslab-cli/cmd/modelslab@latest
See all releases on GitHub Releases. Prebuilt binaries for macOS (arm64/amd64), Linux, and Windows.
Quick Start
Authenticate, generate, explore. That's it.
Log in with your ModelsLab API key.
Create AI-generated images from text prompts.
Search and discover available AI models.
Agent Guide
Every command accepts flags for non-interactive execution. Agents can create accounts, verify emails, log in, and manage tokens without any human interaction.
Register a new user. All fields are passed as flags for non-interactive execution. The password is sent as both password and password_confirmation automatically.
On success, the user receives a verification email. The response includes account details as JSON when --output json is used.
After signup, the user receives a verification email containing a token. Use it to verify the account. If the email is lost, resend it.
Authenticate with email and password. Returns a bearer token and an API key. Both are automatically stored in the OS keychain (macOS Keychain, Windows Credential Manager, or Linux Secret Service).
The --expiry flag accepts: 1_week, 1_month, 3_months, 6_months, 1_year, never. Default: 1_month. The bearer token is used for control-plane API calls; the API key is used for generation endpoints. Both are auto-stored per profile.
Verify that credentials are stored and valid. Returns profile name, email, masked token, and whether an API key is present.
List active sessions, revoke specific tokens, or revoke all other sessions.
Trigger a password reset email, then reset with the token received. All flags are non-interactive.
Use profiles to manage multiple accounts. Switch to team member context for team operations. Logout clears local credentials and revokes the server-side token.
Complete API Coverage
14 command groups, 105+ commands. Every endpoint in the ModelsLab platform is accessible from the CLI.
Agent Integration
Use the CLI directly, as an MCP server, or compose commands in shell scripts.
Run any command with --output json for machine-readable output and --jq to extract specific fields. Every command supports both flags.
Start a Model Context Protocol server that exposes all CLI tools to AI assistants. Works with Claude Code, Claude Desktop, Cursor, and any MCP-compatible client.
Pipe commands together, use exit codes for flow control, and build automated workflows. All commands exit with structured codes for error handling.
Output & Automation
Structured output, JQ filtering, typed exit codes, and environment variable overrides. Everything an agent needs for reliable automation.
Every command supports --output json (or -o json) for structured output, and --jq for inline filtering without piping to external tools.
All commands return typed exit codes. Use these for branching in scripts and agents.
| Code | Constant | Meaning |
|---|---|---|
| 0 | ExitSuccess | Command completed successfully |
| 1 | ExitGeneralError | General/unexpected error |
| 2 | ExitUsageError | Invalid flags or arguments |
| 3 | ExitAuthError | Authentication failed (bad credentials, expired token) |
| 4 | ExitRateLimited | API rate limit exceeded |
| 5 | ExitNotFound | Resource not found |
| 6 | ExitPaymentError | Payment or billing error |
| 7 | ExitGenTimeout | Generation timed out (still processing) |
| 10 | ExitNetworkError | Network connectivity error |
Override any configuration via environment variables. These take precedence over config files but are overridden by CLI flags.
| Variable | Description |
|---|---|
| MODELSLAB_API_KEY | API key for generation endpoints (overrides keychain) |
| MODELSLAB_TOKEN | Bearer token for control-plane API (overrides keychain) |
| MODELSLAB_BASE_URL | Override API base URL (for self-hosted or staging) |
| NO_COLOR | Disable colored terminal output (set to any value) |
These flags are available on every command and control behavior across the entire CLI.
Features
A comprehensive CLI designed to integrate seamlessly into your workflow.
Full coverage of the ModelsLab API. Image, video, audio, 3D, training, upscaling, and more.
Structured JSON output, non-interactive mode, and machine-readable errors for AI agents and automation.
Built-in Model Context Protocol server. Connect directly to Claude, Cursor, or any MCP-compatible AI tool.
Native binaries for macOS, Linux, and Windows. Install via Homebrew, Scoop, apt, or direct download.
Pipe outputs between commands, integrate with shell scripts, and build complex AI generation pipelines.
API keys stored in your OS keychain. No credentials in plaintext config files or environment variables.
Commands
Organized by domain. Click to expand each group.