---
title: CLI Reference
description: Complete command reference
icon: Terminal
---

## `earl call`

Execute a template command.

```bash
earl call '<provider>.<command>(...)' [--yes] [--json]
```

| Flag     | Description                         |
| -------- | ----------------------------------- |
| `--yes`  | Skip confirmation for write-mode commands. |
| `--json` | Output raw JSON response.           |

```bash
earl call 'github.search_issues(query="repo:rust-lang/rust is:issue E-easy", per_page=5)'
```

## `earl templates`

Manage template files. `--json` is available on all subcommands.

```bash
earl templates list [--category <cat>] [--mode read|write] [--json]
earl templates search '<query>' [--limit <n>] [--json]
earl templates validate [--json]
earl templates install <source> [--scope local|global] [--json]
earl templates generate -- <cli> [args...]
```

| Subcommand | Description |
| ---------- | ----------- |
| `list`     | List all template commands. Filter by `--category` or `--mode`. |
| `search`   | Semantic search over template descriptions. |
| `validate` | Validate all loaded template files. |
| `install`  | Install a template from a local `.hcl` path or HTTP(S) URL. |
| `generate` | Delegate template authoring to a coding CLI (e.g., `-- claude`). |

## `earl secrets`

Manage secrets in the OS keychain.

```bash
earl secrets set <key> [--stdin]
earl secrets get <key>
earl secrets list
earl secrets delete <key>
```

<Callout type="info">
  `earl secrets get` returns metadata only — never the plaintext value.
</Callout>

## `earl auth`

Manage OAuth2 authentication profiles.

```bash
earl auth login <profile>
earl auth status <profile>
earl auth refresh <profile>
earl auth logout <profile>
```

`<profile>` must match a `[auth.profiles.<profile>]` entry in `config.toml`.

## `earl mcp`

Run an MCP server for AI agent integration.

```bash
earl mcp [stdio|http] [--listen <addr>] [--mode full|discovery] [--yes]
```

| Flag              | Default             | Description                                          |
| ----------------- | ------------------- | ---------------------------------------------------- |
| `stdio` / `http`  | `stdio`            | Transport protocol.                                  |
| `--listen <addr>` | `127.0.0.1:8977`   | Bind address (HTTP transport only).                  |
| `--mode <mode>`   | `full`              | `full` = one tool per template; `discovery` = search + call. |
| `--yes`           | off                 | Allow write-mode tool calls.                         |

## `earl doctor`

Diagnose configuration and setup issues.

```bash
earl doctor [--json]
```

Checks: config validity, network allowlist, template files, and secret index integrity.

## `earl web`

Launch the local web documentation + playground for loaded template tools.

```bash
earl web [--listen <addr>] [--no-open]
```

| Flag               | Default       | Description |
| ------------------ | ------------- | ----------- |
| `--listen <addr>`  | `127.0.0.1:0` | Bind address (`:0` = choose a random free port). |
| `--no-open`        | off           | Do not auto-open the browser. |

## `earl completion`

Generate shell completion scripts.

```bash
earl completion bash
earl completion zsh
earl completion fish
earl completion powershell
earl completion elvish
```
