Install and Set Up the CLI

Install the Roboflow CLI, authenticate, set a default workspace, and enable shell completion.

You will need Python >=3.10 to use the Roboflow Python package.

After you have Python installed, run the following command to install:

pip install roboflow

After installing, test that the CLI works:

roboflow --help

Authentication

There are three ways to authenticate:

export ROBOFLOW_API_KEY=rf_xxxxx

This is the recommended approach for CI/CD, automation, and AI coding agents. No interactive prompts required.

Option 2: API key flag

roboflow --api-key rf_xxxxx project list

Pass the key directly to any command. Useful for one-off commands.

Option 3: Interactive login

roboflow login

Open the link in your browser, get the token, and paste it in the terminal. Credentials are saved to ~/.config/roboflow/config.json so you only need to do this once.

You can also log in non-interactively with:

roboflow auth login --api-key rf_xxxxx

Verify Authentication

roboflow auth status

This shows your current workspace and a masked API key.

Set Default Workspace

If you have access to multiple workspaces, set which one is used by default:

roboflow auth set-workspace my-workspace-id

Shell Completion (Optional)

Enable tab completion for commands, options, and arguments:

# Zsh
eval "$(roboflow completion zsh)"

# Bash (requires bash >= 4.4)
eval "$(roboflow completion bash)"

# Fish
roboflow completion fish | source

To make it permanent, add the eval line to your shell profile (~/.zshrc, ~/.bashrc, etc.).