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

# CLI

> Use the TapKit CLI from any agent that can run shell commands

Not every agent loop supports MCP. If your agent can call CLI commands, it can use TapKit. The CLI gives you the same gestures, screenshots, and device controls — just as shell commands instead of tool calls.

## Install

<Tabs>
  <Tab title="npm">
    ```bash theme={null}
    npm install -g tapkit
    ```
  </Tab>

  <Tab title="Native Installer">
    ```bash theme={null}
    curl -fsSL https://tapkit.ai/install.sh | bash
    ```
  </Tab>

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

## Authenticate

<Tabs>
  <Tab title="OAuth">
    ```bash theme={null}
    tapkit auth login
    ```

    This opens your browser to sign in. The token is cached locally for future sessions.
  </Tab>

  <Tab title="API Key">
    ```bash theme={null}
    tapkit auth login --api-key your-api-key
    ```

    Generate an API key from the [TapKit dashboard](https://tapkit.ai/dashboard). The key is cached locally just like the OAuth token.
  </Tab>
</Tabs>

## Quick check

```bash theme={null}
tapkit status      # verify auth + phone connection
tapkit phones      # list connected phones
tapkit screenshot  # grab the current screen
```

## Available commands

### Gestures

| Command                           | Description              |
| --------------------------------- | ------------------------ |
| `tapkit tap <x> <y>`              | Tap at coordinates       |
| `tapkit double-tap <x> <y>`       | Double tap               |
| `tapkit hold <x> <y>`             | Long press               |
| `tapkit swipe <direction>`        | Swipe up/down/left/right |
| `tapkit drag <x1> <y1> <x2> <y2>` | Drag between points      |

### Input

| Command              | Description               |
| -------------------- | ------------------------- |
| `tapkit type <text>` | Type into focused field   |
| `tapkit escape`      | Dismiss keyboard or alert |

### Device

| Command                     | Description           |
| --------------------------- | --------------------- |
| `tapkit home`               | Press home button     |
| `tapkit open <app>`         | Launch app by name    |
| `tapkit spotlight [query]`  | Open Spotlight search |
| `tapkit siri`               | Activate Siri         |
| `tapkit lock` / `unlock`    | Lock or unlock device |
| `tapkit volume up` / `down` | Volume control        |
| `tapkit shortcut <name>`    | Run a Shortcut        |

### Screenshots

| Command                      | Description                          |
| ---------------------------- | ------------------------------------ |
| `tapkit screenshot`          | Capture phone screen                 |
| `tapkit screenshot --open`   | Capture and open in Preview          |
| `tapkit screenshot --base64` | Output as base64 (for LLMs)          |
| `tapkit screenshot --llm`    | Output optimized for LLM consumption |

### Phone management

| Command                   | Description                |
| ------------------------- | -------------------------- |
| `tapkit phones`           | List connected phones      |
| `tapkit phone set <name>` | Set active phone           |
| `tapkit phone`            | Show active phone + status |

## How it works

The CLI talks to the [TapKit Mac app](/setup/mac-app) running on your machine. The Mac app executes commands on the connected iPhone. You don't need a server — everything runs locally.

For the full CLI reference including configuration and setup, see the [CLI tab](/cli/introduction).
