Skip to Content
GuideCommand line

Command line

The buckler CLI mirrors the app. It uses the same core library. Use it for scripts, CI, and headless environments.

Installation

Build the CLI from source:

swift build -c release

The binary is at .build/release/buckler. Copy it to your PATH:

cp .build/release/buckler /usr/local/bin/

Version

buckler --version prints the version, for example 0.1.0.

Commands

scan

Run a full inventory scan and match against intel.

buckler scan [--home <home>] [--root <root> ...] [--json]

Options:

  • --home <home>: home directory to scan (default: current user’s home)
  • --root <root>: additional scan roots (repeatable)
  • --json: output JSON instead of human-readable text

Example:

buckler scan buckler scan --root /opt/local --json > scan.json

The scan writes to ~/Library/Application Support/Buckler/buckler.sqlite by default. Pass --home to use a different database.

intel pull

Pull intel from all configured providers or one specific provider.

buckler intel pull [--home <home>] [--provider <id>]

Options:

  • --home <home>: home directory (default: current user’s home)
  • --provider <id>: pull only this provider ID

Example:

buckler intel pull buckler intel pull --provider osv

Providers read their configuration from ~/Library/Application Support/Buckler/providers.toml.

findings

List findings.

buckler findings [--home <home>] [--tier <tier>] [--all] [--json]

Options:

  • --home <home>: home directory (default: current user’s home)
  • --tier <tier>: filter by tier (compromised, exploited, vulnerable, host-change, advisory)
  • --all: include closed findings
  • --json: output JSON

Example:

buckler findings buckler findings --tier compromised --json buckler findings --all

Human-readable output shows one line per finding with tier, purl, path, and provider.

sbom

Export the inventory as an SBOM in CycloneDX or SPDX format.

buckler sbom [--format <format>] [--home <home>]

Options:

  • --format <format>: SBOM format (default: cyclonedx). Options: cyclonedx, spdx.
  • --home <home>: home directory (default: current user’s home)

Example:

buckler sbom > sbom.json buckler sbom --format spdx > sbom-spdx.json

The SBOM contains every inventory item with its purl, version, path, ecosystem, and scope (installed, declared, cache).

baseline reset

Clear the host-artifact baseline. The next scan writes a new baseline.

buckler baseline reset [--home <home>]

Example:

buckler baseline reset

Use this when you added an SSH key or a LaunchAgent yourself and want the baseline to include it.

dispatch

Dispatch an agent to harden affected projects for one finding.

buckler dispatch <finding-id> [--runner <runner>] [--dry-run] [--home <home>]

Arguments:

  • <finding-id>: the finding ID (e.g., f_abc123)

Options:

  • --runner <runner>: runner name from config.toml
  • --dry-run: write the task bundle and show the command without running it
  • --home <home>: home directory (default: current user’s home)

Example:

buckler dispatch f_abc123 buckler dispatch f_abc123 --runner codex --dry-run

The task bundle is written to ~/Library/Application Support/Buckler/dispatch/<finding-id>/task.json.

llm

LLM client operations: extract intel from an article, triage a finding, manage the API key, and view token usage.

buckler llm <subcommand>

Subcommands:

  • extract: extract intel from an article
  • triage: triage a finding
  • set-key: set the API key in the Keychain
  • ledger: show token usage ledger

llm extract

Extract indicators from an article.

buckler llm extract [--home <home>] < article.txt

The article text comes from stdin. The output is JSON: an array of Intel records.

llm triage

Triage a finding.

buckler llm triage <finding-id> [--home <home>]

Arguments:

  • <finding-id>: the finding ID

The output is three sentences: what happened, why it matters here, what to do.

llm set-key

Set the LLM API key in the Keychain.

buckler llm set-key

The command prompts for the key and writes it to buckler.llm.

llm ledger

Show token usage by prompt and day.

buckler llm ledger [--home <home>]

The output is a table with columns: date, prompt, tokens.

Worked examples

Scan and list compromised findings

buckler scan buckler findings --tier compromised

Pull intel and export the inventory

buckler intel pull buckler sbom --format cyclonedx > inventory.json

CI: fail when compromised findings exist

#!/bin/bash buckler scan count=$(buckler findings --tier compromised --json | jq 'length') if [ "$count" -gt 0 ]; then echo "FAIL: $count compromised findings" exit 1 fi

Headless: scan a different root

buckler scan --home /tmp/test-env --root /tmp/test-env buckler findings --home /tmp/test-env

Dispatch from a script

# Get the first compromised finding finding=$(buckler findings --tier compromised --json | jq -r '.[0].id') if [ -n "$finding" ]; then buckler dispatch "$finding" --runner codex fi

Next

Last updated on