> ## Documentation Index
> Fetch the complete documentation index at: https://docs.withgauge.com/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> For API and SDK launches, integration testing, and ongoing coding-agent checks, start with Gauge Agents:
> - [Gauge Agents overview](https://docs.withgauge.com/agents/index.md)
> - [Gauge Agents quickstart](https://docs.withgauge.com/agents/quickstart.md)
> - [Create and inspect an eval](https://docs.withgauge.com/agents/guides/create-an-eval-and-run-an-experiment.md)
> - [Agent Experience: diagnose integration failures](https://docs.withgauge.com/agents/concepts/agent-experience.md)
> - [Agent Preference: measure product selection](https://docs.withgauge.com/agents/concepts/agent-preference.md)
> - [GitHub PR checks](https://docs.withgauge.com/agents/guides/github-pr-checks.md)
> For AI search visibility and AEO, start with [Gauge Chat](https://docs.withgauge.com/introduction/welcome.md).

# Gauge CLI

> One command-line tool for Gauge Chat and Gauge Agents: install it, choose how to authenticate, and find the command reference.

The `gauge` CLI is built for people and coding agents alike: every command supports `--help`, and `-o json` returns machine-readable output for scripts.

| Product | Commands | Where it runs |
| - | - | - |
| Gauge Chat | `gauge chat …` | Reads and manages hosted Chat data. No Docker. |
| Gauge Agents | `gauge eval`, `gauge preference`, `gauge run`, and more | Locally in Docker with no Gauge account, or on hosted Gauge compute |

## Install

The CLI requires Node.js 22.13 or later.

```bash theme={null}
npm install -g @withgauge/cli
gauge --version
```

Update it with `gauge update`. To teach your coding agent how to use the CLI, run `gauge install-skill`.

## Authenticate

One sign-in covers both products.

| Situation | How to authenticate |
| - | - |
| Working interactively | `gauge auth login` opens your browser. |
| SSH or a machine without a browser | `gauge auth login --device`, then open the displayed link on any device. |
| Scripts and CI | Set `GAUGE_API_TOKEN` to an organization API key (`gauge_sk_…`). |
| Local Agents runs | No Gauge account needed. Agents use your own provider credentials. |

`GAUGE_API_TOKEN` takes precedence over a saved sign-in; unset it to go back to your login. `gauge auth logout` signs out the saved login but doesn't revoke an API key.

Create API keys in Gauge Chat under **Settings → Integrations → API Keys**. See [Authenticate with the API](https://docs.withgauge.com/chat/api/authentication.md) for access levels and revoking.

Check what you're using:

```bash theme={null}
gauge auth status   # credential source, permissions, and expiry
gauge whoami        # the account or API key, and the organizations it reaches
```

## Choose an organization

The organization you select applies to both products.

```bash theme={null}
gauge orgs                        # your organizations and the products each uses
gauge orgs use acme               # save a default
gauge orgs use acme --project     # save one for this repository, in gauge.json
gauge chat tags list --org acme   # or choose one for a single command
```

An API key always uses its own organization. An agency key can pass `--org` to choose a client.

## Gauge Chat commands

`gauge chat` reads categories, brands, sampled answers, cited pages, and reports, and manages tracked topics, prompts, and tags.

```bash theme={null}
gauge chat categories list
gauge chat topics create "Pricing" --if-exists
gauge chat prompts add --file prompts.txt --topic pricing --dry-run -o json
gauge chat query --dataset answers -d brand -m visibility,shareOfVoice --last-days 30
```

## Gauge Agents commands

Agents commands run on a local or hosted backend. Local sessions run in Docker, and your coding agent analyzes the results. Hosted sessions run on Gauge compute and are analyzed automatically.

```bash theme={null}
gauge init --local
gauge eval create --local --name "Release notes" --agent codex --samples 1 \
  --text "Write the release notes for version 1.2.0." \
  --criterion "RELEASE-NOTES.md lists the changes under Added and Fixed."
gauge run --eval <eval-id> --local
gauge run compare --local --baseline batch=<before-id> --candidate batch=<after-id>
```

## Command reference

> [card] [CLI guide](https://docs.withgauge.com/agents/guides/cli.md)
>
> Workspaces, backends, local runs, case files, results, JSON output, and exit codes.

> [card] [Gauge Chat commands](https://docs.withgauge.com/agents/guides/cli.md#read-gauge-chat-data)
>
> Categories, date ranges, paging, and limits for `gauge chat`.

Run `gauge --help`, or `--help` on any command, for every option in your installed version.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.