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

# CLI

> Manage Larm from your terminal with the official CLI

The Larm CLI lets you manage monitors, alerts, status pages, disruptions, and webhooks from your terminal. Open source at [github.com/larmhq/larm-cli](https://github.com/larmhq/larm-cli).

## Install

<Tabs>
  <Tab title="Homebrew">
    ```bash theme={null}
    brew install larmhq/tap/larm
    ```
  </Tab>

  <Tab title="Binary">
    Download from [GitHub Releases](https://github.com/larmhq/larm-cli/releases).
  </Tab>

  <Tab title="Go">
    ```bash theme={null}
    go install github.com/larmhq/larm-cli@latest
    ```
  </Tab>
</Tabs>

## Authenticate

### Browser login (recommended)

```bash theme={null}
larm auth login
```

Opens your browser for OAuth. Enter the code shown in your terminal, pick your organization, and approve.

### API key

```bash theme={null}
larm auth login --with-token
```

Paste an API key from [Settings > API Keys](https://app.larm.dev/settings/api-keys). Or set the `LARM_API_KEY` environment variable.

## Usage

### Monitors

```bash theme={null}
larm monitors list
larm monitors show <id>
larm monitors create --name "API" --url https://example.com
larm monitors update <id> --name "New Name"
larm monitors delete <id>
```

### Monitor stats

```bash theme={null}
larm monitors state <id>
larm monitors uptime <id> --range 7d
larm monitors response-times <id>
larm monitors cert <id>
```

### Alert channels

```bash theme={null}
larm alerts list
larm alerts show <id>
larm alerts create --name "Slack" --type slack --config '{"webhook_url":"..."}'
```

### Status pages

```bash theme={null}
larm status-pages list
larm status-pages show <id>             # renders the components tree
larm status-pages create --name "Acme Status" --slug acme-status
```

### Components and groups

```bash theme={null}
larm components create --status-page-id <id> --name "API"
larm components create --status-page-id <id> --name "Database" --group <group-id>
larm components update <id> --group <group-id>

larm component-groups create --status-page-id <id> --name "Backend"
larm component-groups show <id>
larm component-groups update <id> --name "Backend services"
larm component-groups delete <id>
```

### Disruptions

```bash theme={null}
larm disruptions list
larm disruptions show <id>
larm disruptions create --title "API outage" --impact critical --message "Investigating"
larm disruptions update <id> --status resolved
```

### Webhooks

```bash theme={null}
larm webhooks list
larm webhooks create --url https://example.com/hook --events monitor.state_changed
```

### Raw API access

```bash theme={null}
larm api GET /monitors
larm api GET /monitors --field check_type=http
larm api POST /monitors --field name=Test --field check_type=http
```

## Output formats

Table output in a terminal, JSON when piped.

```bash theme={null}
larm monitors list                              # table
larm monitors list --output json                # JSON
larm monitors list --output json --jq '.[].name'  # JQ filter
larm monitors list --fields name,check_type     # select columns
```

## Other flags

| Flag            | Description                            |
| --------------- | -------------------------------------- |
| `--quiet`       | Suppress output on success             |
| `--dry-run`     | Print request without sending          |
| `--yes`         | Skip delete confirmation prompts       |
| `--output json` | Force JSON output                      |
| `--fields`      | Select columns for table output        |
| `--jq`          | Filter JSON output with JQ expressions |

## For LLM agents

The CLI has a `describe` command for machine discovery:

```bash theme={null}
larm describe                    # full command schema as JSON
larm describe monitors.list      # single command schema
```

Always use `--output json` for machine-readable output.

## Source

The CLI is open source: [github.com/larmhq/larm-cli](https://github.com/larmhq/larm-cli)
