# CLI and agent skills

The **Guardix CLI** (`guardix`) connects your terminal — or a coding agent — to the same audits and findings you see in the web app. Guardix also ships **agent skills** that teach tools like Claude Code how to read results, start audits, and compare reports from multiple providers.

## Install the CLI

### macOS and Linux (recommended)

```bash
curl -fsSL https://github.com/guardixdev/guardix/releases/latest/download/install.sh | sh
```

The installer picks the right binary, verifies checksums, and places `guardix` on your `PATH` (typically `/usr/local/bin` or `~/.local/bin`).

Pin a version or custom install directory:

```bash
curl -fsSL https://github.com/guardixdev/guardix/releases/latest/download/install.sh | GUARDIX_VERSION=v0.3.4 sh
curl -fsSL https://github.com/guardixdev/guardix/releases/latest/download/install.sh | GUARDIX_INSTALL_DIR="$HOME/bin" sh
```

### Manual download

Download a release archive from [github.com/guardixdev/guardix/releases](https://github.com/guardixdev/guardix/releases), extract, and add the `guardix` binary to your `PATH`.

### Verify

```bash
guardix --version
guardix doctor
```

## Authenticate

### Browser pairing (interactive)

```bash
guardix auth login
```

The CLI prints a URL (for example `https://guardix.io/cli/auth?s=…`) and opens your browser. Sign in with **GitHub** or **Google** if needed, approve the pairing, and the CLI stores a key locally. The approval page also has a **Deny** button if the request isn't yours. Revoke CLI keys anytime under **User menu → API keys** in the app.

### Sign in from an agent

Coding agents and remote shells can't open a browser. From CLI **0.3.4** onward:

```bash
guardix auth login --no-browser --json
```

`--no-browser` prints the verification URL instead of opening a browser, and `--json` emits machine-readable status lines:

```json
{"status":"awaiting_approval","verification_url":"https://guardix.io/cli/auth?s=…","user_code":"…"}
{"status":"authenticated"}
```

The agent relays the `verification_url` to you; open it in any browser, confirm the code matches, and **Approve** (or **Deny**) the pairing. When approved, the CLI emits `{"status":"authenticated"}` and stores the key. `--json` also implies `--non-interactive`, so the command never prompts.

### API key (automation / CI)

```bash
guardix auth login --api-key gdx_ak_...
```

Or set `GUARDIX_API_KEY` in the environment. See [API keys](/docs/guides/api-keys/) for creating keys in the dashboard.

Check status:

```bash
guardix auth status
```

## Everyday commands

Inside a **connected** git checkout, many commands infer the repository from `git remote`:

```bash
guardix status                    # latest audit summary + open findings
guardix finding list              # findings for the latest audit
guardix finding get VAU-3         # one finding by short code
guardix audit start --ref main    # start a full audit
guardix audit wait --audit '#2'   # block until completion (CI-friendly)
```

Add `--json` for machine-readable output (it also implies `--non-interactive`, so commands never prompt). Run `guardix manifest --quiet` for the full command surface — do not guess flag names.

Useful audit flags mirror the web wizard: `--contract` (repeatable scope), `--doc-url`, `--doc-text`, `--doc-file`, and `--include-repo-docs`.

## Billing

The CLI never handles card data. Paying for a **full audit** is:

```bash
guardix audit start            # opens Stripe checkout if needed and waits until you pay
guardix audit start --wait    # then keep watching until the audit finishes
guardix billing portal --open # invoices and saved payment methods after the first payment
guardix quota                 # free-audit remaining + per-audit price
```

`billing portal` is available after the first payment (Stripe returns 409 until then). **Release Audits** that need payment or intake action exit `wait` with code `3` and print the checkout URL instead of holding.

## Agent skills (Claude Code plugin)

The Guardix CLI plugin bundles three skills for coding agents:

| Skill | Use when |
|-------|----------|
| **`guardix`** | Reading audit results — status, findings, finding codes like `VAU-3`, review state. |
| **`running-audits`** | Starting and monitoring audits (`audit start`, `wait`, `get`, `logs`). |
| **`cross-audit-triage`** | Comparing findings from **multiple sources** (Guardix + external firm reports or tool output), correlating duplicates, and adjudicating true vs false positives locally. |

### Install the plugin

From inside Claude Code:

```bash
/plugin marketplace add guardixdev/guardix
/plugin install guardix-cli@guardix
```

Or from a regular shell (scripts, CI):

```bash
claude plugin marketplace add guardixdev/guardix
claude plugin install guardix-cli@guardix
```

Skills live in the plugin package; each skill file describes when the agent should invoke it and which CLI commands to run. Agents should prefer `guardix manifest` over inventing flags. The same three skills also work in **Cursor**, which auto-loads agent skills from its skills directories (`.cursor/skills/`, `~/.cursor/skills/`) as well as compatibility paths like `~/.claude/skills`.

### Cross-audit triage

The **cross-audit-triage** skill expects report files plus a **checkout of the audited commit** on disk so findings can be validated against real source. It produces a comparison matrix and optional `cross-audit-triage.json` artifact. You can sync adjudications back with `guardix finding review` when ready.

## Team context

```bash
guardix team list
guardix team switch <team-slug>
```

The active team filters which repositories and audits are visible — match the workspace you use in the browser.

## Related

- [API keys](/docs/guides/api-keys/) — Bearer tokens for HTTP and CI  
- [Authentication](/docs/getting-started/authentication/) — web sign-in  
- [Your first audit](/docs/guides/first-audit/) — browser-first walkthrough
