Buildkite CLI pipeline command

The bk pipeline command allows you to manage pipelines from the command line.

Commands

Command Description
bk pipeline copy Copy an existing pipeline.
bk pipeline create Create a new pipeline.
bk pipeline list List pipelines.
bk pipeline convert Convert a CI/CD pipeline configuration to Buildkite format.
bk pipeline validate Validate a pipeline YAML file.
bk pipeline view View a pipeline.

Copy pipeline

Copy an existing pipeline.

Copy an existing pipeline's configuration to create a new pipeline.

This command copies configuration from a source pipeline including: - Pipeline steps (YAML configuration) - Repository settings - Branch configuration - Build skipping/cancellation rules - Provider settings (trigger mode, PR builds, commit statuses, etc.) - Environment variables - Tags and visibility

Team assignments are not copied automatically. Use --team SLUG=ACCESS_LEVEL or --team UUID=ACCESS_LEVEL to assign destination teams explicitly; repeat the flag for multiple teams. Slugs must match exactly in the destination organization and require read_teams API access to resolve; UUIDs are passed through without a lookup. Access levels are read_only, build_and_read, and manage_build_and_read. Without --team, no team assignments are sent, even when the source has teams. Non-admin users in Teams-enabled organizations may receive a 422 from the API if they do not assign a team.

When copying to a different organization, the cluster is not copied because it is organization-specific. Use --team with destination team slugs or UUIDs.

bk pipeline copy [<pipeline>] [flags]

Arguments

Argument Description
[<pipeline>] Source pipeline to copy (slug or org/slug). Uses current pipeline if not specified.

Flags

Flag Description
-o, --output="" Output format. One of: json, yaml, text
-t, --target=STRING Name for the new pipeline, or org/name to copy to a different organization
--cluster-name=STRING Cluster name for the new pipeline (resolved to UUID)
--cluster-uuid=STRING Cluster UUID for the new pipeline
--debug Log HTTP API traffic to stderr; bodies may contain sensitive data
--dry-run Show what would be copied without creating the pipeline
--json Output as JSON
--org=STRING Organization slug for this invocation (overrides environment and configuration)
--team=KEY=VALUE;... Assign a destination team as SLUG=ACCESS_LEVEL or UUID=ACCESS_LEVEL (repeatable); access: read_only, build_and_read, manage_build_and_read
--text Output as text
--yaml Output as YAML

Examples

Copy the current pipeline to a new pipeline:

bk pipeline cp --target "my-pipeline-v2"

Copy a specific pipeline:

bk pipeline cp my-existing-pipeline --target "my-new-pipeline"

Copy with explicit team access by slug:

bk pipeline cp my-pipeline --target "my-copy" --team platform-engineering=build_and_read

Copy with explicit team access by UUID (skips the slug lookup):

bk pipeline cp my-pipeline --target "my-copy" --team 14e9501c-69fe-4cda-ae07-daea9ca3afd3=build_and_read

Copy a pipeline from another org (if you have access):

bk pipeline cp other-org/their-pipeline --target "my-copy"

Copy to a different organization:

bk pipeline cp my-pipeline --target "other-org/my-pipeline" --cluster-uuid "8302f0b-9b99-4663-23f3-2d64f88s693e"

Copy to a different organization using cluster name:

bk pipeline cp my-pipeline --target "other-org/my-pipeline" --cluster-name "my-cluster"

Interactive mode - prompts for source and target:

bk pipeline cp

Preview what would be copied without creating:

bk pipeline cp my-pipeline --target "copy" --dry-run

Output the new pipeline details as JSON:

bk pipeline cp my-pipeline -t "new-pipeline" -o json

Create a pipeline

Create a new pipeline.

Creates a new pipeline in the current org and outputs the URL to the pipeline.

The repository URL and default name are inferred from Git origin. Without a name, interactive use offers a project-aware local starter if no pipeline file exists. Named invocations and --no-input never add prompts or local files unless --template is supplied. Local files must be reviewed, committed and pushed before building.

Guided creation defaults to concise text on stdout, with file status and starter prompts on stderr. Explicit format flags and configured preferences take priority; named and scripted invocations retain their output defaults.

You can specify a --dry-run flag to see the pipeline that would be created without actually creating it or writing local files. This outputs a JSON representation of the pipeline to be created by default.

Use --cluster-uuid to assign a pipeline to a cluster by UUID, or --cluster-name to assign by name (the name will be resolved to the corresponding UUID).

Use --team SLUG=ACCESS_LEVEL or --team UUID=ACCESS_LEVEL for each team assignment. Slugs must match exactly in the destination organization and require read_teams API access to resolve; UUIDs are passed through without a lookup. Access levels are read_only, build_and_read, and manage_build_and_read. Without --team, no team assignments are sent or inferred. Non-admin users in organizations with Teams enabled must assign a team when creating a pipeline.

bk pipeline create [<name>] [flags]

Arguments

Argument Description
[<name>] Name of the pipeline (defaults to Git origin or directory name)

Flags

Flag Description
-W, --create-webhook Create an SCM webhook for the pipeline (GitHub and GitHub Enterprise only)
-d, --description=STRING Description of the pipeline
-o, --output="" Output format. One of: json, yaml, text
-r, --repository=STRING Repository URL
--cluster-name=STRING Cluster name to assign the pipeline to (resolved to UUID)
--cluster-uuid=STRING Cluster UUID to assign the pipeline to
--debug Log HTTP API traffic to stderr; bodies may contain sensitive data
--dry-run Simulate pipeline creation without actually creating it
--json Output as JSON
--org=STRING Organization slug for this invocation (overrides environment and configuration)
--team=KEY=VALUE;... Team assignment as SLUG=ACCESS_LEVEL or UUID=ACCESS_LEVEL (repeatable); access: read_only, build_and_read, manage_build_and_read
--template="" Create a local starter: go, node, pipenv, ruby or empty (never overwrites existing files)
--text Output as text
--yaml Output as YAML

Examples

Create a new pipeline:

bk pipeline create "My Pipeline" --description "My pipeline description" --repository "git@github.com:org/repo.git"

Create a new pipeline and view the created pipeline in JSON format:

bk pipeline create "My Pipeline" --description "My pipeline description" --repository "git@github.com:org/repo.git" --output json

Create a pipeline with team access (by slug):

bk pipeline create "My Pipeline" -r "git@github.com:org/repo.git" --team platform-engineering=build_and_read

Create a pipeline with team access (by UUID, skips the slug lookup):

bk pipeline create "My Pipeline" -r "git@github.com:org/repo.git" --team 14e9501c-69fe-4cda-ae07-daea9ca3afd3=build_and_read

Create a pipeline with a cluster (by UUID):

bk pipeline create "My Pipeline" -d "Description" -r "git@github.com:org/repo.git" --cluster-uuid "cluster-uuid-123"

Create a pipeline with a cluster (by name):

bk pipeline create "My Pipeline" -d "Description" -r "git@github.com:org/repo.git" --cluster-name "my-cluster"

Create a pipeline and set up a GitHub webhook:

bk pipeline create "My Pipeline" -d "Description" -r "git@github.com:org/repo.git" --create-webhook

Simulate creating a pipeline and view the output in yaml format:

bk pipeline create "My Pipeline" -d "Description" -r "git@github.com:org/repo.git" --dry-run --output yaml

List pipelines

List pipelines.

List pipelines with optional filtering.

This command lists all pipelines in the current organization that match the specified criteria. You can filter by pipeline name or repository URL.

bk pipeline list [flags]

Flags

Flag Description
-l, --limit=100 Maximum number of pipelines to return (max: 3000)
-n, --name=STRING Filter pipelines by name (supports partial matches, case insensitive)
-o, --output="" Output format. One of: json, yaml, text
-r, --repository=STRING Filter pipelines by repository URL (supports partial matches, case insensitive)
--debug Log HTTP API traffic to stderr; bodies may contain sensitive data
--json Output as JSON
--org=STRING Organization slug for this invocation (overrides environment and configuration)
--text Output as text
--yaml Output as YAML

Examples

List all pipelines (default limit: 100):

bk pipeline list

List pipelines matching a name pattern:

bk pipeline list --name pipeline

List pipelines by repository:

bk pipeline list --repository my-repo

Get more pipelines (automatically paginates):

bk pipeline list --limit 500

Output as JSON:

bk pipeline list --name pipeline -o json

Use with other commands (e.g., get longest builds from matching pipelines):

bk pipeline list --name pipeline --json | jq -r '.[].slug' | xargs -I {} bk build list --pipeline {} --since 48h --duration '>1h'

Convert pipeline

Convert a CI/CD pipeline configuration to Buildkite format.

Supported vendors: - github (GitHub Actions) - bitbucket (Bitbucket Pipelines) - circleci (CircleCI) - jenkins (Jenkins) - gitlab (GitLab CI) (beta) - harness (Harness CI) (beta) - bitrise (Bitrise) (beta)

The command will automatically detect the vendor based on the file path and name if not specified.

When using --file, the converted pipeline is saved to .buildkite/pipeline..yml by default. When reading from stdin, output goes to stdout by default. Use the --output flag to specify a custom output path in either case.

Note: This command does not require an API token since it uses a public conversion API.

bk pipeline convert --file=STRING [flags]

Flags

Flag Description
-F, --file=STRING Path to the pipeline file to convert (required)
-o, --output=STRING Custom path to save the converted pipeline (default: .buildkite/pipeline..yml)
-v, --vendor=STRING CI/CD vendor (auto-detected if the file name matches vendor path and name - otherwise, needs to be specified)
--debug Log HTTP API traffic to stderr; bodies may contain sensitive data
--org=STRING Organization slug for this invocation (overrides environment and configuration)
--timeout=300 The time (in seconds) after which a conversion should be cancelled

Examples

Convert a GitHub Actions workflow:

bk pipeline convert -F .github/workflows/ci.yml

Convert with explicit vendor specification:

bk pipeline convert -F pipeline.yml --vendor circleci

Save output to a file:

bk pipeline convert -F .github/workflows/ci.yml -o .buildkite/pipeline.yml

Read from stdin:

cat .github/workflows/ci.yml | bk pipeline convert --vendor github
bk pipeline convert --vendor github < .github/workflows/ci.yml

Validate a pipeline

Validate a pipeline YAML file.

Validate a pipeline YAML file against the Buildkite pipeline schema.

By default, this command looks for a file at .buildkite/pipeline.yaml or .buildkite/pipeline.yml in the current directory. You can specify different files using the --file flag.

Note: This command does not require an API token since validation is done locally.

bk pipeline validate [flags]

Flags

Flag Description
-f, --file=FILE,... Path to the pipeline YAML file(s) to validate
--debug Log HTTP API traffic to stderr; bodies may contain sensitive data
--org=STRING Organization slug for this invocation (overrides environment and configuration)

Examples

Validate the default pipeline file:

bk pipeline validate

Validate a specific pipeline file:

bk pipeline validate --file path/to/pipeline.yaml

Validate multiple pipeline files:

bk pipeline validate --file path/to/pipeline1.yaml --file path/to/pipeline2.yaml

View a pipeline

View a pipeline.

View information about a pipeline.

bk pipeline view [<pipeline>] [flags]

Arguments

Argument Description
[<pipeline>] The pipeline to view. This can be a {pipeline slug} or in the format {org slug}/{pipeline slug}.

Flags

Flag Description
-o, --output="" Output format. One of: json, yaml, text
-p, --pipeline=STRING The pipeline to view. This can be a {pipeline slug} or in the format {org slug}/{pipeline slug}.
-w, --web Open the pipeline in a web browser.
--debug Log HTTP API traffic to stderr; bodies may contain sensitive data
--json Output as JSON
--org=STRING Organization slug for this invocation (overrides environment and configuration)
--text Output as text
--yaml Output as YAML

Examples

View a pipeline:

bk pipeline view my-pipeline

View a pipeline using flags:

bk pipeline view --org my-org --pipeline my-pipeline

View a pipeline in a specific organization:

bk pipeline view my-org/my-pipeline

Open pipeline in browser:

bk pipeline view my-pipeline --web

Output as JSON:

bk pipeline view my-pipeline -o json