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

# CLI Reference

> Every enagrams command

## Install

```bash theme={null}
npm install -g enagrams
```

Or invoke via `npx enagrams <command>` — no install required. `enagrams init` will offer to install globally after first auth.

## Environment

| Variable             | Purpose                                                        | Default                 |
| -------------------- | -------------------------------------------------------------- | ----------------------- |
| `ENAGRAMS_API_KEY`   | Your API key (also stored in `~/.config/enagrams/config.json`) | —                       |
| `ENAGRAMS_WORKSPACE` | Workspace slug or ID (usually set in `.env` by `init`)         | —                       |
| `ENAGRAMS_API_URL`   | API server                                                     | `http://localhost:3001` |
| `ENAGRAMS_WEB_URL`   | Web dashboard                                                  | `http://localhost:3000` |

The API key is written once to `~/.config/enagrams/config.json` and reused across every repo. The workspace slug lives in each repo's `.env`.

## Commands

### `enagrams init`

Bootstrap the current repo. Runs browser-based device auth, creates or resumes a workspace, writes all config files, and optionally installs the CLI globally.

```bash theme={null}
npx enagrams init
```

What gets written:

```
~/.config/enagrams/config.json   API key (global)
.env                              ENAGRAMS_WORKSPACE=<slug>
.cursor/mcp.json                  MCP server config for Cursor
.cursor/hooks.json                Cursor hook wiring
.cursor/hooks/enagrams-hooks.mjs  Shared hook script (all IDEs)
.mcp.json                         MCP server config for Claude Code
.claude/settings.json             Claude Code hooks
.codex/hooks.json                 Codex hooks
```

Re-running `init` is safe — existing files are updated in place.

### `enagrams login`

Re-authenticate without touching the workspace. Writes `~/.config/enagrams/config.json`.

```bash theme={null}
enagrams login
```

### `enagrams join`

Join an existing workspace in the current repo. Lists the workspaces you're a member of (or have been invited to) and writes the same config files as `init`.

```bash theme={null}
npx enagrams join
```

### `enagrams status`

Show live team status: active agents, current file reservations, recent decisions and learnings.

```bash theme={null}
enagrams status
```

### `enagrams watch`

Full-screen live dashboard that auto-refreshes every second. Same content as `status` but persistent.

```bash theme={null}
enagrams watch
```

`Ctrl+C` to exit. Also available as `enagrams status --watch`.

### `enagrams learn <text>`

Record a learning for the team. Calls the `learn` MCP tool directly so the insight is available to every agent on their next `sync`.

```bash theme={null}
enagrams learn "Rate limiter resets at UTC midnight, not wall-clock"
```

With no text, prompts interactively.

### `enagrams compile-rules`

Pulls recent learnings from your workspace and compiles them into `.cursor/rules/team-learnings.mdc`. Cursor will load them as project rules so every agent session starts with the team's accumulated wisdom.

```bash theme={null}
enagrams compile-rules
```

### `enagrams help`

Usage summary. Aliases: `--help`, `-h`.

## Flags

### `--mcp`

Launch the MCP server over stdio. Used by your IDE's MCP configuration — you should not normally invoke this by hand. `init` writes the right command into `.cursor/mcp.json` and `.mcp.json` automatically.

```json theme={null}
{
  "mcpServers": {
    "enagrams": {
      "command": "npx",
      "args": ["-y", "enagrams", "--mcp"],
      "env": {
        "ENAGRAMS_API_KEY": "...",
        "ENAGRAMS_WORKSPACE": "..."
      }
    }
  }
}
```
