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

# Synap CLI

> Provision and operate Synap from your terminal with maximem-synap — the command-line counterpart to the Dashboard.

The **`maximem-synap` CLI** lets you provision and operate Synap from your terminal: log in, create and manage instances, mint API keys, manage your team, and inspect requests and memories — the same operations as the [Dashboard](/dashboard/overview), scriptable.

<Info>
  **CLI vs SDK.** The [SDK](/setup/installation) is the *runtime* surface — your agents import it to read and write memory (`recall`, `save`, `context`). The CLI is the *control plane* — you use it to set Synap up and operate it. They are separate tools for separate jobs.
</Info>

## Install and log in

The CLI ships on npm as a small bootstrapper that installs the tool onto your `PATH`. The fastest start is a single command:

```bash theme={null}
npx @maximem/synap-cli@latest auth login
```

This installs the CLI (if it isn't already) and starts the browser login. After the first run, the `maximem-synap` command is on your `PATH`:

```bash theme={null}
maximem-synap auth login
maximem-synap whoami
```

<Note>
  Requires **Node.js 18+** and **Python 3.10+** on the host. The CLI is dependency-light and stores its config under `~/.config/synap/config.json` (mode `0600`).
</Note>

## Logging in

Authentication is a browser device-pairing flow — like `gcloud auth login`. You never paste a key; your identity stays in the browser.

<Steps>
  <Step title="Run the login command">
    ```bash theme={null}
    maximem-synap auth login
    ```

    The CLI prints a short pairing code and opens your browser:

    ```
      Your pairing code is:  XYZA-BCDE
      Approve this login at: https://synap.maximem.ai/cli/pair?code=XYZA-BCDE

      Waiting for approval…
    ```
  </Step>

  <Step title="Approve in the browser">
    On the [Synap dashboard](https://synap.maximem.ai) pair page, confirm the code matches your terminal, pick the client to connect to, and click **Approve**. If you aren't signed in, you'll be prompted first.
  </Step>

  <Step title="You're in">
    The terminal confirms the login and stores the session under your active profile:

    ```
    Logged in to client "Acme" · profile "default"
    ```
  </Step>
</Steps>

The minted key is bound to one client and expires after 90 days. Re-run `maximem-synap auth login` to refresh it.

### Which account am I?

```bash theme={null}
maximem-synap whoami        # client, scopes, key expiry, profile
maximem-synap auth list     # all logged-in accounts (active one starred)
```

### Multiple accounts

Each profile holds one session bound to one client. Log into different clients under different profiles and switch between them:

```bash theme={null}
maximem-synap auth login --profile acme        # log into Acme
maximem-synap auth login --profile internal    # log into another client
maximem-synap auth use acme                     # switch the active profile
```

## A quick tour

```bash theme={null}
maximem-synap instances list                              # your memory instances
maximem-synap instances create --name "Support" --relationship b2c
maximem-synap api-keys create --instance <id> --label prod   # an SDK key, shown once
maximem-synap requests list --since 1h                    # what happened in the last hour
maximem-synap memories list --instance <id>               # inspect stored memories
maximem-synap client members list                         # your team
```

Add `--output json` to any command for scripting, and `--help` to any command for its options. Global flags (`--output`, `--profile`, `--env`, `--api-base`, `--verbose`) work before or after the command.

<Warning>
  An API key minted with `api-keys create` is shown **once** and never again. Copy it immediately. This is the key your agents put in the SDK (`SYNAP_API_KEY`).
</Warning>

## Logging out

```bash theme={null}
maximem-synap auth logout      # revokes the key server-side and removes it locally
```

## Next steps

<CardGroup cols={2}>
  <Card title="Command reference" icon="rectangle-terminal" href="/cli/commands">
    Every command and flag — auth, instances, api-keys, client, requests, memories, config.
  </Card>

  <Card title="Dashboard" icon="gauge" href="/dashboard/overview">
    The same operations in the web UI.
  </Card>
</CardGroup>
