# CircleCI CLI > Command-line interface to CircleCI for use in your terminal or scripts. This is the full command reference, generated from the live command tree. # Getting started `circleci` is a command-line interface to CircleCI for use in your terminal or your scripts. ## Installation Installation instructions are in the [README](https://github.com/CircleCI-Public/circleci-cli#readme) ## Configuration Run `circleci auth login` to authenticate with your CircleCI account. You can also set the `CIRCLE_TOKEN` environment variable. ## Model Context Protocol The CLI supports the MCP protocol. To enable it, run: Claude: ```shell circleci mcp claude enable # Enable in Claude desktop claude mcp add-from-claude-desktop -s user # Add with current user scope ``` Cursor: ```shell circleci mcp cursor enable ``` VS Code: ```shell circleci mcp vscode enable ``` ## Support Report bugs or search for existing feature requests in our [issue tracker](https://github.com/CircleCI-Public/circleci-cli/issues) # Reference Work with CircleCI from the command line. ## Global Flags | Flag | Description | | --------------------- | ------------------------------------------------------------ | | `-c, --config string` | path to config file (default: ~/.config/circleci/config.yml) | | `--debug` | enable debug logging | | `-q, --quiet` | suppress informational output; data on stdout is unaffected | ## CI Commands ### `circleci artifact [flags]` List and download a job's artifact files | Flag | Description | | --------------------- | ------------------------------------------------ | | `--jq string` | Process values from the response using jq syntax | | `--json` | Output as JSON | | `-o, --output string` | Download artifacts into this directory | **Arguments:** is the UUID of the job whose artifacts you want to list or download, e.g. 5034460f-c7c4-4c43-9457-de07e2029e7b. ### `circleci config ` Generate, validate, process and pack config YAML #### `circleci config generate [path]` Generate .circleci/config.yml from a repository scan #### `circleci config pack ` Bundle split config files into a single YAML document **Arguments:** is the path to a split config directory to pack, e.g. ".circleci" or "src/ci". The directory structure is mapped to YAML keys in the merged document. #### `circleci config process [flags]` Compile and expand a pipeline config file | Flag | Description | | ------------------------------ | ------------------------------------------------------------------------------ | | `-n, --next` | Enable config next which previews upcoming potentially breaking config changes | | `--org string` | Organization slug (e.g. gh/myorg) or UUID for private orb resolution | | `--pipeline-parameters string` | Pipeline parameters as a YAML map or path to a YAML file | **Arguments:** is the path to a pipeline config file to compile, e.g. ".circleci/config.yml". Pass "-" to read the config from stdin. #### `circleci config validate [flags]` Validate a pipeline config file | Flag | Description | | --------------------- | ------------------------------------------------------------------------------ | | `-c, --config string` | Path to config file (use "-" for stdin) (default ".circleci/config.yml") | | `--json` | Output as JSON | | `-n, --next` | Enable config next which previews upcoming potentially breaking config changes | | `--org string` | Organization slug (e.g. gh/myorg) or UUID for private orb resolution | ### `circleci job ` Inspect a job's details, output and artifacts #### `circleci job artifact [flags]` List or download artifacts for a job | Flag | Description | | --------------------- | ------------------------------------------------ | | `--jq string` | Process values from the response using jq syntax | | `--json` | Output as JSON | | `-o, --output string` | Download artifacts into this directory | **Arguments:** is the UUID of the job whose artifacts to list or download. Job UUIDs are shown in the output of "circleci workflow get" and "circleci run get --json". #### `circleci job get [flags]` Get job details | Flag | Description | | ------------- | ------------------------------------------------ | | `--jq string` | Process values from the response using jq syntax | | `--json` | Output as JSON | **Arguments:** is the UUID of the job to look up. Job UUIDs are shown in the output of "circleci workflow get" and "circleci run get --json". #### `circleci job output ` Work with job step output ##### `circleci job output get [flags]` Get the output of a job step | Flag | Description | | ----------------- | ---------------------------------------------------------------------------------------------- | | `--execution int` | Parallel execution index to read output from | | `--step-num int` | Step number whose output to fetch (required) | | `--strip-ansi` | Force (or with =false, disable) ANSI stripping; defaults to stripping only when not a terminal | **Arguments:** is the UUID of the job whose step output to fetch. Job UUIDs are shown in the output of "circleci workflow get" and "circleci job get". Use --step-num to select which step's output to read. ##### `circleci job output list [flags]` List a job's steps with their output | Flag | Description | | ----------------- | ------------------------------------------------ | | `--execution int` | Parallel execution index to list output from | | `--jq string` | Process values from the response using jq syntax | | `--json` | Output as JSON | **Arguments:** is the UUID of the job whose steps and output to list. Job UUIDs are shown in the output of "circleci workflow get" and "circleci job get". ### `circleci pipeline ` Define what will happen in a run #### `circleci pipeline create [flags]` Create a pipeline definition | Flag | Description | | ---------------------------- | ----------------------------------------------------------------------- | | `--checkout-provider string` | Checkout source provider (one of: github_app, github_server) | | `--checkout-repo-id string` | Checkout source repo external ID | | `--config-file string` | Config file path (e.g. .circleci/config.yml) | | `--config-provider string` | Config source provider (one of: github_app, github_server, circleci) | | `--config-repo-id string` | Config source repo external ID (required for github_app, github_server) | | `--description string` | Pipeline definition description | | `--jq string` | Process values from the response using jq syntax | | `--json` | Output as JSON | | `--name string` | Pipeline definition name (required) | | `--project string` | Project slug (e.g. gh/org/repo); defaults to git remote | | `--project-id string` | Project UUID (overrides --project) | #### `circleci pipeline list [flags]` List pipeline definitions for a project | Flag | Description | | --------------------- | ------------------------------------------------------- | | `--jq string` | Process values from the response using jq syntax | | `--json` | Output as JSON | | `--project string` | Project slug (e.g. gh/org/repo); defaults to git remote | | `--project-id string` | Project UUID (overrides --project) | **Aliases:** `circleci pipeline ls` #### `circleci pipeline run [flags]` Trigger a new pipeline run | Flag | Description | | ------------------------ | -------------------------------------------------------------------- | | `-b, --branch string` | Branch for config fetch and checkout (mutually exclusive with --tag) | | `--definition-id string` | Pipeline definition UUID to run (prompted interactively if omitted) | | `--jq string` | Process values from the response using jq syntax | | `--json` | Output as JSON | | `--param stringArray` | Pipeline parameter as key=value (repeatable) | | `--project string` | Project slug (e.g. gh/org/repo); defaults to git remote | | `-t, --tag string` | Tag for config fetch and checkout (mutually exclusive with --branch) | ### `circleci run ` Trigger, watch and cancel CI runs #### `circleci run cancel [flags]` Cancel a run | Flag | Description | | ------------------ | --------------------------------------------------------------- | | `-f, --force` | skip confirmation prompt | | `--project string` | Project slug (e.g. gh/org/repo); used when cancelling by number | **Arguments:** identifies the run to cancel. It can be: - a run UUID (shown in "circleci run list --json") - a run number (shown in "circleci run list"); the project is inferred from the git remote unless overridden with --project #### `circleci run get [] [flags]` Get a run's status | Flag | Description | | --------------------- | ----------------------------------------------------------- | | `-b, --branch string` | Branch name (defaults to current branch) | | `--jq string` | Process values from the response using jq syntax | | `--json` | Output as JSON | | `--project string` | Project slug (e.g. gh/org/repo); used for latest-run lookup | **Arguments:** is optional and is the UUID of the run to look up. When omitted, the latest run is resolved from the project and branch inferred from the current git repository's remote and checked-out branch (override with --project and --branch). #### `circleci run list [flags]` List recent runs for a project | Flag | Description | | ---------------------- | --------------------------------------------------------- | | `-b, --branch string` | Filter by branch | | `-B, --current-branch` | Filter by the currently checked-out branch | | `--jq string` | Process values from the response using jq syntax | | `--json` | Output as JSON | | `--limit int` | Maximum number of runs to show [default: 10] (default 10) | | `--project string` | Project slug (e.g. gh/org/repo); defaults to git remote | **Aliases:** `circleci run ls` #### `circleci run open [flags]` Open the current project's runs page in the browser | Flag | Description | | --------------------- | ------------------------------------- | | `-b, --branch string` | Filter runs to a specific branch | | `--current-branch` | Filter runs to the current git branch | #### `circleci run trigger [flags]` Trigger a new run | Flag | Description | | ------------------------- | ------------------------------------------------------- | | `-b, --branch string` | Branch to trigger (defaults to current branch) | | `--jq string` | Process values from the response using jq syntax | | `--json` | Output as JSON | | `--parameter stringArray` | Run parameter as key=value (repeatable) | | `--project string` | Project slug (e.g. gh/org/repo); defaults to git remote | #### `circleci run watch [] [flags]` Watch a run until it completes | Flag | Description | | --------------------- | ---------------------------------------------------------------------- | | `-b, --branch string` | Branch to watch (defaults to current branch) | | `--failfast` | Exit as soon as any job fails, without waiting for the rest of the run | | `--project string` | Project slug (e.g. gh/org/repo); defaults to git remote | | `--sha string` | Watch run for this commit SHA; polls up to 2m if not yet created | | `--timeout duration` | Maximum time to wait for run completion (default 30m0s) | **Arguments:** is optional and selects the run to watch. It can be: - a run UUID (shown in "circleci run list --json") - a run number (shown in "circleci run list"); the project is inferred from the git remote unless overridden with --project When omitted, the latest run for the current branch is watched (override the branch with --branch, or match a commit with --sha). ### `circleci workflow ` Inspect, rerun and cancel workflows (job graphs) #### `circleci workflow cancel [flags]` Cancel a running workflow | Flag | Description | | ------------- | ------------------------ | | `-f, --force` | skip confirmation prompt | **Arguments:** is the UUID of the workflow to cancel. Workflow IDs are shown in the output of "circleci run get". #### `circleci workflow get [flags]` Get workflow details | Flag | Description | | ------------- | ------------------------------------------------ | | `--jq string` | Process values from the response using jq syntax | | `--json` | Output as JSON | **Arguments:** is the UUID of the workflow to look up. Workflow IDs are shown in the output of "circleci run get". #### `circleci workflow list [] [flags]` List workflows for a run or recent runs | Flag | Description | | --------------------- | ------------------------------------------------------------- | | `-b, --branch string` | Filter by branch (recent-runs mode) | | `--jq string` | Process values from the response using jq syntax | | `--json` | Output as JSON | | `--limit int` | Number of recent runs to show (recent-runs mode) (default 10) | | `--project string` | Project slug (e.g. gh/org/repo); defaults to git remote | **Arguments:** is optional and selects a single run. It can be: - a run UUID (shown in "circleci run list --json") - a run number (shown in "circleci run list"); the project is inferred from the git remote unless overridden with --project When omitted, workflows for recent runs in the current project are listed, grouped by run. **Aliases:** `circleci workflow ls` #### `circleci workflow rerun [flags]` Rerun a workflow | Flag | Description | | --------------- | ---------------------- | | `--from-failed` | Rerun only failed jobs | **Arguments:** is the UUID of the workflow to rerun. Workflow IDs are shown in the output of "circleci run get". ## Management Commands ### `circleci certificate ` Manage iOS code signing certificates #### `circleci certificate delete [flags]` Delete an iOS certificate | Flag | Description | | ------------- | ------------------------ | | `-f, --force` | skip confirmation prompt | **Arguments:** is the ID of the certificate to delete (see: circleci certificate list). **Aliases:** `circleci certificate rm` #### `circleci certificate list [flags]` List uploaded iOS certificates | Flag | Description | | -------------- | ----------------------------------------------------------------- | | `--jq string` | Process values from the response using jq syntax | | `--json` | Output as JSON | | `--org string` | Organization slug (e.g. gh/myorg) or UUID; defaults to git remote | **Aliases:** `circleci certificate ls` #### `circleci certificate upload [flags]` Upload a .p12 certificate | Flag | Description | | -------------------- | ----------------------------------------------------------------------------------------- | | `--cert-file string` | Path to the .p12 certificate file | | `--jq string` | Process values from the response using jq syntax | | `--json` | Output as JSON | | `--org string` | Organization slug (e.g. gh/myorg) or UUID; defaults to git remote | | `--password string` | Password for the .p12 file. Pass - to read from stdin. Prompted if omitted in a terminal. | ### `circleci context ` Manage secret env vars shared across pipelines #### `circleci context create [flags]` Create a new context | Flag | Description | | -------------- | --------------------------------------------------------- | | `--jq string` | Process values from the response using jq syntax | | `--json` | Output as JSON | | `--org string` | Organization slug (e.g. gh/myorg); defaults to git remote | **Arguments:** The name for the new context, e.g. "build-secrets". #### `circleci context delete [flags]` Delete a context | Flag | Description | | -------------- | ----------------------------------------------------------------- | | `-f, --force` | skip confirmation prompt | | `--org string` | Organization slug (e.g. gh/myorg); used when resolving name to ID | **Arguments:** A context can be specified in the form: - "context-name" - by ID, e.g. 849e7902-802f-4082-8a70-da77dcd084e3 **Aliases:** `circleci context rm` #### `circleci context get [flags]` Get details of a context | Flag | Description | | -------------- | ----------------------------------------------------------------- | | `--jq string` | Process values from the response using jq syntax | | `--json` | Output as JSON | | `--org string` | Organization slug (e.g. gh/myorg); used when resolving name to ID | **Arguments:** A context can be specified in the form: - "context-name" - by ID, e.g. 849e7902-802f-4082-8a70-da77dcd084e3 #### `circleci context list [flags]` List contexts for an organization | Flag | Description | | --------------- | --------------------------------------------------------- | | `--jq string` | Process values from the response using jq syntax | | `--json` | Output as JSON | | `--name string` | Find contexts by name (partial match) | | `--org string` | Organization slug (e.g. gh/myorg); defaults to git remote | **Aliases:** `circleci context ls` #### `circleci context open [flags]` Open the contexts settings page in the browser | Flag | Description | | -------------- | --------------------------------------------------------- | | `--org string` | Organization slug (e.g. gh/myorg); defaults to git remote | #### `circleci context restriction ` Manage context restrictions ##### `circleci context restriction create [flags]` Add a restriction to a context | Flag | Description | | ---------------- | ----------------------------------------------------------------- | | `--jq string` | Process values from the response using jq syntax | | `--json` | Output as JSON | | `--org string` | Organization slug (e.g. gh/myorg); used when resolving name to ID | | `--type string` | Restriction type: project, expression, or group | | `--value string` | Value of the restriction | **Arguments:** A context can be specified in the form: - "context-name" - by ID, e.g. 849e7902-802f-4082-8a70-da77dcd084e3 ##### `circleci context restriction delete [flags]` Delete a restriction from a context | Flag | Description | | ------------------------- | ----------------------------------------------------------------- | | `-f, --force` | Skip confirmation prompt | | `--org string` | Organization slug (e.g. gh/myorg); used when resolving name to ID | | `--restriction-id string` | UUID of the restriction to delete | **Arguments:** A context can be specified in the form: - "context-name" - by ID, e.g. 849e7902-802f-4082-8a70-da77dcd084e3 **Aliases:** `circleci context restriction rm` #### `circleci context secret ` Manage context environment variables ##### `circleci context secret delete [flags]` Delete an environment variable from a context | Flag | Description | | --------------- | ----------------------------------------------------------------- | | `-f, --force` | skip confirmation prompt | | `--name string` | Name of the environment variable to delete | | `--org string` | Organization slug (e.g. gh/myorg); used when resolving name to ID | **Arguments:** A context can be specified in the form: - "context-name" - by ID, e.g. 849e7902-802f-4082-8a70-da77dcd084e3 **Aliases:** `circleci context secret rm` ##### `circleci context secret list [flags]` List environment variables in a context | Flag | Description | | -------------- | ----------------------------------------------------------------- | | `--jq string` | Process values from the response using jq syntax | | `--json` | Output as JSON | | `--org string` | Organization slug (e.g. gh/myorg); used when resolving name to ID | **Arguments:** A context can be specified in the form: - "context-name" - by ID, e.g. 849e7902-802f-4082-8a70-da77dcd084e3 **Aliases:** `circleci context secret ls` ##### `circleci context secret set [flags]` Set an environment variable in a context | Flag | Description | | ---------------- | --------------------------------------------------------------------- | | `--name string` | Name of the environment variable | | `--org string` | Organization slug (e.g. gh/myorg); used when resolving name to ID | | `--value string` | Value of the environment variable (prompted if omitted in a terminal) | **Arguments:** A context can be specified in the form: - "context-name" - by ID, e.g. 849e7902-802f-4082-8a70-da77dcd084e3 ### `circleci deploy ` Track released components and versions #### `circleci deploy init [flags]` Instrument your config for deploy tracking | Flag | Description | | -------------------------- | -------------------------------------------------------------------------- | | `--component string` | Service/component name (skips prompt) | | `--environment string` | Default environment for jobs whose target can't be inferred (skips prompt) | | `--pipeline-config string` | Path to CircleCI pipeline config file (default ".circleci/config.yml") | #### `circleci deploy list [flags]` List recent deploys | Flag | Description | | ------------------ | ------------------------------------------------------- | | `--jq string` | Process values from the response using jq syntax | | `--json` | Output as JSON | | `--project string` | Project slug (e.g. gh/org/repo); defaults to git remote | **Aliases:** `circleci deploy ls` #### `circleci deploy open [flags]` Open the deploys page in the browser | Flag | Description | | ------------------ | ------------------------------------------------------- | | `--project string` | Project slug (e.g. gh/org/repo); defaults to git remote | ### `circleci dlc ` Purge a project's Docker layer cache (DLC) #### `circleci dlc purge --project [flags]` Purge the Docker Layer Cache for a project | Flag | Description | | ------------------ | ------------------------------------------------------- | | `--json` | Output as JSON | | `--project string` | Project slug (e.g. gh/org/repo); defaults to git remote | ### `circleci envvar ` List, set and delete a project's environment variables #### `circleci envvar delete [flags]` Delete a project environment variable | Flag | Description | | ------------------ | ------------------------------------------------------- | | `-f, --force` | skip confirmation prompt | | `--project string` | Project slug (e.g. gh/org/repo); defaults to git remote | **Arguments:** is the name of the environment variable to delete from the project. This action is irreversible. **Aliases:** `circleci envvar rm` #### `circleci envvar list [flags]` List project environment variables | Flag | Description | | ------------------ | ------------------------------------------------------- | | `--jq string` | Process values from the response using jq syntax | | `--json` | Output as JSON | | `--project string` | Project slug (e.g. gh/org/repo); defaults to git remote | **Aliases:** `circleci envvar ls` #### `circleci envvar set [flags]` Set a project environment variable | Flag | Description | | ------------------ | ------------------------------------------------------- | | `--project string` | Project slug (e.g. gh/org/repo); defaults to git remote | **Arguments:** is the name of the environment variable to create or update. is the value to store; it is never retrievable after being set and is masked in all subsequent list output. ### `circleci namespace ` Manage the org namespace orbs publish under #### `circleci namespace create --org [flags]` Create a namespace | Flag | Description | | -------------- | ------------------------------------------------------------------------------- | | `--jq string` | Process values from the response using jq syntax | | `--json` | Output as JSON | | `--org string` | Organization slug (e.g. gh/myorg) or UUID to claim the namespace for (required) | **Arguments:** is the namespace name to create. It must be globally unique across CircleCI, e.g. "myorg". #### `circleci namespace delete [flags]` Delete a namespace and all its orbs | Flag | Description | | --------------- | -------------------------------------------- | | `-n, --dry-run` | print what would be deleted without deleting | | `-f, --force` | skip confirmation prompt | **Arguments:** is the name of the namespace to delete, e.g. "myorg". **Aliases:** `circleci namespace rm` #### `circleci namespace get [flags]` Get details of a namespace | Flag | Description | | ------------- | ------------------------------------------------ | | `--jq string` | Process values from the response using jq syntax | | `--json` | Output as JSON | **Arguments:** is the name of the namespace to look up, e.g. "myorg". #### `circleci namespace rename [flags]` Rename a namespace | Flag | Description | | ------------- | ------------------------------------------------ | | `--jq string` | Process values from the response using jq syntax | | `--json` | Output as JSON | **Arguments:** - is the current name of the namespace, e.g. "oldname". - is the new name to assign, e.g. "newname". ### `circleci orb ` Create, publish and inspect orbs (reusable config) #### `circleci orb add-to-category / ` Add an orb to a registry category **Arguments:** - /: the orb to add, as "namespace/orb-name" - : the registry category name, e.g. "Testing" #### `circleci orb create / [flags]` Reserve an orb name in a namespace | Flag | Description | | ------------- | ------------------------------------------------ | | `--jq string` | Process values from the response using jq syntax | | `--json` | Output as JSON | | `--private` | create as a private orb | **Arguments:** - /: the orb name to reserve, as "namespace/orb-name". The namespace must already exist. #### `circleci orb diff / --from --to [flags]` Show a unified diff between two orb versions | Flag | Description | | --------------- | ------------------------------------------------------------------------ | | `--from string` | the first version (semver e.g. 1.0.0, or a dev label e.g. dev:my-branch) | | `--to string` | the second version, in the same form as --from | **Arguments:** - /: the orb to diff, as "namespace/orb-name" #### `circleci orb get /[@]/ [flags]` Get orb metadata and statistics | Flag | Description | | ------------- | ------------------------------------------------ | | `--jq string` | Process values from the response using jq syntax | | `--json` | Output as JSON | **Arguments:** An orb can be specified in the form: - "namespace/orb-name", optionally with a version, e.g. "namespace/orb-name@1.2.3" - by orb ID (UUID), e.g. 849e7902-802f-4082-8a70-da77dcd084e3 #### `circleci orb list [] [flags]` List orbs in the registry | Flag | Description | | --------------- | ------------------------------------------------ | | `--jq string` | Process values from the response using jq syntax | | `--json` | Output as JSON | | `--private` | only list private orbs (requires namespace) | | `--uncertified` | include uncertified orbs | **Arguments:** - : optional. When given, lists all orbs in that namespace. When omitted, lists certified orbs globally. **Aliases:** `circleci orb ls` #### `circleci orb list-categories [flags]` List orb registry categories | Flag | Description | | ------------- | ------------------------------------------------ | | `--jq string` | Process values from the response using jq syntax | | `--json` | Output as JSON | #### `circleci orb pack ` Pack a multi-file orb directory into a single YAML **Arguments:** - : path to an orb source directory or a single orb YAML file. #### `circleci orb process [flags]` Validate and print expanded orb YAML | Flag | Description | | -------------- | ---------------------------------------------------------------------- | | `--org string` | Organization slug (e.g. gh/myorg) or UUID for private orb dependencies | **Arguments:** - : path to an orb YAML file. Pass '-' to read from stdin. #### `circleci orb publish ` Publish orb versions ##### `circleci orb publish increment / --bump major|minor|patch [flags]` Increment and publish a new orb version | Flag | Description | | --------------- | ---------------------------------------------------------- | | `--bump string` | which version segment to increment: major, minor, or patch | **Arguments:** - : path to the orb YAML to publish. Pass '-' to read from stdin. - /: the orb to publish, as "namespace/orb-name" ##### `circleci orb publish promote /@dev: