Buildkite CLI job command
The bk job command allows you to manage jobs within builds from the command line.
Commands
| Command | Description |
|---|---|
bk job cancel |
Cancel a job. |
bk job list |
List jobs. |
bk job retry |
Retry a job. |
bk job unblock |
Unblock a job. |
Cancel a job
Cancel a job.
bk job cancel <job-id> [flags]
Arguments
| Argument | Description |
|---|---|
<job-id> |
Job ID to cancel |
Flags
| Flag | Description |
|---|---|
-w, --web
|
Open the job in a web browser after it has been cancelled |
--debug |
Enable debug output for REST API calls |
Examples
Cancel a job (with confirmation prompt):
bk job cancel 0190046e-e199-453b-a302-a21a4d649d31
Cancel a job without confirmation (useful for automation):
bk job --yes cancel 0190046e-e199-453b-a302-a21a4d649d31
Cancel a job and open it in browser:
bk job --yes cancel 0190046e-e199-453b-a302-a21a4d649d31 --web
List jobs
List jobs.
bk job list [flags]
Flags
| Flag | Description |
|---|---|
-o, --output="json"
|
Output format. One of: json, yaml, text |
-p, --pipeline=STRING
|
Filter by pipeline slug |
--debug |
Enable debug output for REST API calls |
--duration=STRING |
Filter by duration (e.g. >10m, <5m, 20m) - supports >, <, >=, <= operators |
--limit=100 |
Maximum number of jobs to return |
--no-limit |
Fetch all jobs (overrides --limit) |
--order-by=STRING |
Order results by field (start_time, duration) |
--queue=STRING |
Filter by queue name |
--since=STRING |
Filter jobs from builds created since this time (e.g. 1h, 30m) |
--state=STATE,... |
Filter by job state |
--until=STRING |
Filter jobs from builds created before this time (e.g. 1h, 30m) |
Examples
List recent jobs (100 by default):
bk job list
List jobs from a specific queue:
bk job list --queue test-queue
List running jobs:
bk job list --state running
List jobs that took longer than 10 minutes:
bk job list --duration ">10m"
List jobs from the last hour:
bk job list --since 1h
Combine filters:
bk job list --queue test-queue --state running --duration ">10m"
Fetch all jobs matching filters (no limit):
bk job list --duration ">10m" --no-limit
Order by duration (longest first):
bk job list --order-by duration
Get JSON output for bulk operations:
bk job list --queue test-queue -o json
Retry a job
Retry a job.
bk job retry <job-id>
Arguments
| Argument | Description |
|---|---|
<job-id> |
Job UUID to retry |
Flags
| Flag | Description |
|---|---|
--debug |
Enable debug output for REST API calls |
Examples
Retry a job by UUID:
bk job retry 0190046e-e199-453b-a302-a21a4d649d31
Unblock a job
Unblock a job.
bk job unblock <job-id> [flags]
Arguments
| Argument | Description |
|---|---|
<job-id> |
Job UUID to unblock |
Flags
| Flag | Description |
|---|---|
--data=STRING |
JSON formatted data to unblock the job |
--debug |
Enable debug output for REST API calls |
Examples
Unblock a job by UUID:
bk job unblock 0190046e-e199-453b-a302-a21a4d649d31
Unblock with JSON data:
bk job unblock 0190046e-e199-453b-a302-a21a4d649d31 --data '{"field": "value"}'
Unblock with data from stdin:
echo '{"field": "value"}' | bk job unblock 0190046e-e199-453b-a302-a21a4d649d31