buoy ci

Run Buoy in CI mode with exit codes and optional GitHub PR comments. Designed for continuous integration pipelines.

Usage

buoy ci [options]

Options

Option Description
--strict Exit with code 1 if any drift detected
--threshold <n> Minimum health score to pass (0-100)
--github-comment Post results as PR comment
--json Output as JSON

Exit Codes

Code Meaning
0 Pass — No drift or within threshold
1 Fail — Drift detected (with --strict) or below threshold

Example Output

$ buoy ci --threshold 70

Design System CI Check
──────────────────────

Health Score: 67/100 (Fair)
Threshold: 70

Status: FAIL ✗

Summary:
  • 23 hardcoded color values
  • 14 non-standard spacing values
  • 3 possible typos detected

Worst files:
  src/pages/Dashboard.tsx     47 issues
  src/components/Card.tsx     23 issues

Exit code: 1

GitHub Actions Example

name: Design System Check

on: [pull_request]

jobs:
  buoy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - uses: actions/setup-node@v4
        with:
          node-version: '20'

      - name: Install dependencies
        run: npm ci

      - name: Run Buoy
        run: npx @buoy-design/cli ci --threshold 60
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

PR Comments

With --github-comment, Buoy posts a summary to your PR:

buoy ci --github-comment

The comment includes:

  • Health score with visual indicator
  • Top issues found
  • Files with the most drift
  • Comparison to base branch (if available)

See GitHub Actions for detailed setup.

Threshold Examples

# Must score at least 80 to pass
buoy ci --threshold 80

# Fail on any drift (zero tolerance)
buoy ci --strict

# Just report, never fail
buoy ci --threshold 0

JSON Output

buoy ci --json
{
  "score": 67,
  "threshold": 70,
  "passed": false,
  "summary": {
    "hardcodedValues": 23,
    "spacingIssues": 14,
    "possibleTypos": 3
  },
  "worstFiles": [
    { "file": "src/pages/Dashboard.tsx", "issues": 47 }
  ]
}

Related Commands