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

CommandDescription
authLogin, logout, check status, set default workspace
workspaceList and inspect workspaces
projectList, get, and create projects
versionList, get, download, and export dataset versions
imageUpload, get, search, tag, delete, and annotate images
modelList, get, and upload trained models
trainStart model training
inferRun inference on an image
searchSearch workspace images and export results
deploymentManage dedicated deployments
workflowManage workflows
folderManage workspace folders
annotationAnnotation batches and jobs
universeSearch Roboflow Universe
videoVideo inference
batchBatch processing jobs (coming soon)
completionGenerate shell completion scripts (bash, zsh, fish)

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:

FlagShortDescription
--json-jOutput results as structured JSON (for agents and piping)
--api-key-kAPI key override
--workspace-wWorkspace override
--quiet-qSuppress progress bars and status messages
--versionShow package version

JSON Output for Agents

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

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

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

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:

ShorthandMeaning
my-projectUses your default workspace
my-ws/my-projectExplicit workspace
my-project/3Default workspace, version 3
my-ws/my-project/3Explicit workspace, version 3

Version numbers are always numeric - that's how x/y is disambiguated between workspace/project and project/version.

Convenience Aliases

Common operations have short top-level aliases:

AliasEquivalent
roboflow loginroboflow auth login
roboflow whoamiroboflow auth status
roboflow uploadroboflow image upload
roboflow downloadroboflow version download