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

# CLI Quickstart

> Install the MeepaChat CLI and start using it in minutes

The `meepachat` CLI lets you interact with your MeepaChat instance from the terminal: manage servers, send messages, create bots, and more.

## Installation

The CLI is a standalone binary, separate from the MeepaChat server.

<Tabs>
  <Tab title="curl">
    ```bash theme={null}
    curl -fsSL https://meepa.ai/install-meepachat-cli.sh | sh
    ```

    Detects your OS and architecture, downloads the latest release, verifies the checksum, and installs to `/usr/local/bin/meepachat`.
  </Tab>

  <Tab title="Homebrew">
    ```bash theme={null}
    brew install bogpad/tap/meepachat-cli
    ```

    Works on macOS and Linux. Updates via `brew upgrade`.
  </Tab>
</Tabs>

Verify the installation:

```bash theme={null}
meepachat version
```

## Log in

### Browser login (default)

Opens your browser for OAuth authentication. The token is saved automatically.

```bash theme={null}
meepachat --url https://chat.example.com login
```

### Email/password

For instances with direct login enabled. Interactive prompts:

```bash theme={null}
meepachat --url https://chat.example.com login --no-browser
```

Non-interactive (useful in scripts):

```bash theme={null}
meepachat --url https://chat.example.com login --email alice@example.com --password s3cr3t
```

### Token

Save a token directly (skips interactive login):

```bash theme={null}
# Session token
meepachat --url https://chat.example.com login --token YOUR_TOKEN

# Bot token (id.secret format)
meepachat --url https://chat.example.com login --token BOT_ID.SECRET --bot
```

After login, the URL and token are written to `~/.config/meepachat/config.json` — you won't need `--url` or `--token` on subsequent commands.

### Verify

```bash theme={null}
meepachat auth me
```

```
ID            42
Username      alice
Display Name  Alice
Bot           false
```

## Basic usage

### List your servers

```bash theme={null}
meepachat servers list
```

```
ID   Name          Role
1    Engineering   owner
2    Design        member
```

### List channels in a server

```bash theme={null}
meepachat channels list --server 1
```

```
ID   Name      Visibility   Topic
10   general   public       Welcome to Engineering
11   random    public
```

### Send a message

```bash theme={null}
meepachat messages send "Hello from the CLI!" --server 1 --channel 10
```

### Read recent messages

```bash theme={null}
meepachat messages list --server 1 --channel 10 --limit 5
```

### Search messages

```bash theme={null}
meepachat search "deploy" --server 1
```

### Get JSON output

Add `--json` to any command for machine-readable output, useful for scripting with `jq`:

```bash theme={null}
meepachat servers list --json | jq '.[].name'
```

## Log out

```bash theme={null}
meepachat logout
```

Clears the token from `~/.config/meepachat/config.json` while preserving the instance URL.

## Next steps

<CardGroup cols={2}>
  <Card title="Command Reference" icon="book" href="/meepachat/cli/commands">
    Every command, subcommand, and flag
  </Card>

  <Card title="Configuration" icon="gear" href="/meepachat/cli/configuration">
    Config file, environment variables, global flags
  </Card>
</CardGroup>
