Skip to content
Back to skills

Buildkite Cli

ASecurity

CLI scripts for common Buildkite operations. Rebuild failed builds, retry jobs, get logs, trigger builds - all by passing URLs directly. Supports both Buildkite build URLs and GitHub PR URLs.

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added September 27, 2026
toolsbashgitapi

Works with

  • cli
  • api

Security analysis

A96/100
  • mediumInstalls packages at runtime which could introduce malicious dependencies

Pro scans all 11 files and shows the line behind each finding

Scanned September 27, 2026

npx -y skills add David-Li0406/meta-skill-evloving --skill buildkite-cli --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Buildkite Cli?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Buildkite Cli
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/david-li0406-buildkite-cli/badge)](https://www.skillsdirectory.com/skills/david-li0406-buildkite-cli)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: buildkite-cli
description: CLI scripts for common Buildkite operations. Rebuild failed builds, retry jobs, get logs, trigger builds - all by passing URLs directly. Supports both Buildkite build URLs and GitHub PR URLs.
---

# Buildkite CLI

Simple `pnpm tsx` scripts for common Buildkite operations. Pass URLs directly - supports both Buildkite build URLs and GitHub PR URLs.

## Setup

```bash
# Install deps
pnpm install

# Required env vars
export BUILDKITE_TOKEN="bkua_xxx"  # API token with read/write builds

# Optional - for default org/pipeline
export BUILDKITE_ORG="my-org"
export BUILDKITE_PIPELINE="my-pipeline"

# Optional - for GitHub PR URL support
export GITHUB_TOKEN="ghp_xxx"
```

## Commands

### Rebuild a Failed Build

```bash
# From Buildkite URL
pnpm rebuild https://buildkite.com/org/pipeline/builds/123

# From GitHub PR URL (requires --pipeline or BUILDKITE_PIPELINE)
pnpm rebuild https://github.com/org/repo/pull/456 --pipeline my-pipeline
```

### Retry Failed Jobs Only

```bash
pnpm retry-failed https://buildkite.com/org/pipeline/builds/123
```

### Get Build Status

```bash
pnpm status https://buildkite.com/org/pipeline/builds/123
```

### Get Job Logs

```bash
# First failed job (default)
pnpm logs https://buildkite.com/org/pipeline/builds/123

# Specific job by index
pnpm logs <url> --job 2

# Specific job by name match
pnpm logs <url> --job "playwright"

# Last N lines
pnpm logs <url> --tail 50
```

### Cancel Build

```bash
pnpm cancel https://buildkite.com/org/pipeline/builds/123
```

### Unblock Blocked Step

```bash
pnpm unblock https://buildkite.com/org/pipeline/builds/123

# With field values for block step
pnpm unblock <url> --fields env=production,confirm=yes
```

### Trigger New Build

```bash
pnpm trigger --pipeline my-pipeline
pnpm trigger --pipeline my-pipeline --branch feature/x --message "Deploy fix"
```

### List Recent Failed Builds

```bash
pnpm list-failed --pipeline my-pipeline
pnpm list-failed --pipeline my-pipeline --limit 20
```

## URL Formats Supported

**Buildkite URLs:**
- `https://buildkite.com/org/pipeline/builds/123`
- `https://buildkite.com/org/pipeline/builds/123#job-uuid`

**GitHub PR URLs:**
- `https://github.com/owner/repo/pull/123`
- Requires `--pipeline` flag or `BUILDKITE_PIPELINE` env var
- Looks up PR head commit and finds corresponding Buildkite build

## File Structure

```
buildkite-cli/
├── package.json
├── src/
│   ├── api.ts         # Core API helpers, URL parsing
│   ├── rebuild.ts     # Rebuild entire build
│   ├── retry-failed.ts # Retry only failed jobs
│   ├── cancel.ts      # Cancel running build
│   ├── status.ts      # Get build status
│   ├── logs.ts        # Get job logs
│   ├── list-failed.ts # List recent failures
│   ├── trigger.ts     # Trigger new build
│   └── unblock.ts     # Unblock blocked steps
└── SKILL.md
```

Files in this skill

  • SKILL.md2.9 KB
  • package.json471 B
  • src/api.ts6 KB
  • src/cancel.ts422 B
  • src/list-failed.ts1.4 KB
  • src/logs.ts1.8 KB
  • src/rebuild.ts535 B
  • src/retry-failed.ts1.4 KB
  • src/status.ts1.6 KB
  • src/trigger.ts1.2 KB
  • src/unblock.ts1.5 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…