> For the complete documentation index, see [llms.txt](https://docs.roboflow.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.roboflow.com/reference/platform/cli.md).

# CLI

Reference for the Roboflow CLI commands, global flags, JSON output, resource shorthand, and convenience aliases.

The Roboflow Python package includes a CLI (`pip install roboflow`) that you can use to work with the Roboflow platform from the command line. It follows a consistent `roboflow <noun> <verb>` pattern and supports structured JSON output for use with AI coding agents and automation tools.

## Commands

<table data-search="false"><thead><tr><th>Command</th><th>Description</th></tr></thead><tbody><tr><td><code>auth</code></td><td>Login, logout, check status, set default workspace</td></tr><tr><td><code>workspace</code></td><td>List and inspect workspaces</td></tr><tr><td><code>project</code></td><td>List, get, and create projects</td></tr><tr><td><code>version</code></td><td>List, get, download, and export dataset versions</td></tr><tr><td><code>image</code></td><td>Upload, get, search, tag, delete, and annotate images</td></tr><tr><td><code>model</code></td><td>List, get, and upload trained models</td></tr><tr><td><code>train</code></td><td>Start model training</td></tr><tr><td><code>infer</code></td><td>Run inference on an image</td></tr><tr><td><code>search</code></td><td>Search workspace images and export results</td></tr><tr><td><code>deployment</code></td><td>Manage dedicated deployments</td></tr><tr><td><code>workflow</code></td><td>Manage workflows</td></tr><tr><td><code>folder</code></td><td>Manage workspace folders</td></tr><tr><td><code>annotation</code></td><td>Annotation batches and jobs</td></tr><tr><td><code>autolabel</code></td><td>Auto label a batch with a foundation or Roboflow model</td></tr><tr><td><code>universe</code></td><td>Search Roboflow Universe</td></tr><tr><td><code>video</code></td><td>Video inference</td></tr><tr><td><code>batch</code></td><td>Run and manage <a href="https://docs.roboflow.com/deployment/roboflow-cloud/batch-processing#asset-library-images">Batch Processing jobs on Asset Library images</a></td></tr><tr><td><code>completion</code></td><td>Generate shell completion scripts (bash, zsh, fish)</td></tr></tbody></table>

Run `roboflow <command> --help` for details on any command.

## Global Flags

These flags work on every command and can appear before or after the subcommand:

<table data-search="false"><thead><tr><th>Flag</th><th>Short</th><th>Description</th></tr></thead><tbody><tr><td><code>--json</code></td><td><code>-j</code></td><td>Output results as structured JSON (for agents and piping)</td></tr><tr><td><code>--api-key</code></td><td><code>-k</code></td><td>API key override</td></tr><tr><td><code>--workspace</code></td><td><code>-w</code></td><td>Workspace override</td></tr><tr><td><code>--quiet</code></td><td><code>-q</code></td><td>Suppress progress bars and status messages</td></tr><tr><td><code>--version</code></td><td></td><td>Show package version</td></tr></tbody></table>

## JSON Output for Agents

Every command supports `--json` for structured output that's safe to pipe and parse programmatically:

```bash
roboflow --json project list | jq '.[0].id'
```

Errors in JSON mode go to stderr with an empty stdout, making it safe for piping:

```bash
roboflow --json project get nonexistent 2>error.json
# stdout is empty, stderr contains: {"error": {"message": "...", "hint": "..."}}
```

Exit codes are consistent: 0 = success, 1 = error, 2 = auth error, 3 = not found.

## Resource Shorthand

Resources can be addressed with compact identifiers:

<table data-search="false"><thead><tr><th>Shorthand</th><th>Meaning</th></tr></thead><tbody><tr><td><code>my-project</code></td><td>Uses your default workspace</td></tr><tr><td><code>my-ws/my-project</code></td><td>Explicit workspace</td></tr><tr><td><code>my-project/3</code></td><td>Default workspace, version 3</td></tr><tr><td><code>my-ws/my-project/3</code></td><td>Explicit workspace, version 3</td></tr></tbody></table>

Version numbers are always numeric, so `x/y` identifies a project version when `y` is a number and a Workspace/project pair otherwise.

## Convenience Aliases

Common operations have short top-level aliases:

<table data-search="false"><thead><tr><th>Alias</th><th>Equivalent</th></tr></thead><tbody><tr><td><code>roboflow login</code></td><td><code>roboflow auth login</code></td></tr><tr><td><code>roboflow whoami</code></td><td><code>roboflow auth status</code></td></tr><tr><td><code>roboflow upload</code></td><td><code>roboflow image upload</code></td></tr><tr><td><code>roboflow download</code></td><td><code>roboflow version download</code></td></tr></tbody></table>
