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

# CLI

> Run TinyFish automations directly from your terminal

The TinyFish CLI lets you run browser automations, check results, and manage runs from your terminal — no code required.

## Installation

```bash theme={null}
npm install -g @tiny-fish/cli@latest
```

**Verify:**

```bash theme={null}
tinyfish --version
```

## Authentication

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

Opens the API keys page in your browser. Paste your key when prompted. The key is saved to `~/.tinyfish/config.json`.

**For CI/CD:**

```bash theme={null}
echo $TINYFISH_API_KEY | tinyfish auth set
```

**Check status:**

```bash theme={null}
tinyfish auth status
```

Returns JSON with `source` (`env`, `config`, or `none`), `key_preview` (first/last chars of the key, or `null`), and `authenticated` (`true`/`false`). Exit code 1 when not authenticated.

## Quick Start

```bash theme={null}
npm install -g @tiny-fish/cli@latest
export TINYFISH_API_KEY="sk-tinyfish-..."
tinyfish agent run --url "https://example.com" "Extract product data. Return JSON."
```

## Environment variables

| Variable                         | Description                                                |
| -------------------------------- | ---------------------------------------------------------- |
| `TINYFISH_API_KEY`               | API key — takes priority over saved config                 |
| `TINYFISH_VAULT_TOKEN`           | 1Password service account token for `vault connection add` |
| `TINYFISH_VAULT_CLIENT_SECRET`   | Bitwarden client secret for `vault connection add`         |
| `TINYFISH_VAULT_MASTER_PASSWORD` | Bitwarden master password for `vault connection add`       |
| `TINYFISH_DEBUG`                 | Set to `1` to enable debug output                          |

## Output

By default all commands output JSON to stdout. Errors go to stderr as JSON. Exit code 1 on failure.

Add `--pretty` to any command for human-readable output.
