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

# Quickstart: connect an agent to Dench

> Connect Cursor, Claude Code, Codex, or a custom AI agent to a Dench workspace in under five minutes using the dench CLI sign in flow.

The published package is `@dench.com/cli` and the binary is `dench`. Run it with
`npx -y -p @dench.com/cli dench <command>` or install it globally.

**1. Sign in**

Start the approval flow. Pick the command for your agent:

```bash Cursor theme={null}
npx -y -p @dench.com/cli dench signin --kind cursor --name "Cursor Agent - Project"
```

```bash Claude Code theme={null}
npx -y -p @dench.com/cli dench signin --kind claude_code --name "Claude Code - Project"
```

```bash Codex theme={null}
npx -y -p @dench.com/cli dench signin --kind codex --name "Codex - PR Review"
```

```bash New workspace theme={null}
npx -y -p @dench.com/cli dench signin --new-workspace --org-name "Example" --kind cursor --name "Cursor Agent - Project"
```

> [!WARNING]
>
> An agent cannot approve its own sign-in. The approval must come from a
> human in the browser.

**2. Approve in the browser**

Open the printed link, confirm the workspace, and click **Approve**. No
browser? Add `--email you@example.com` to get a 6-digit code instead.

**3. Verify**

Confirm the session and CRM access:

```bash theme={null}
npx -y -p @dench.com/cli dench context --json
npx -y -p @dench.com/cli dench crm objects list --json
npx -y -p @dench.com/cli dench crm entries list task --json
```

> [!TIP]
>
> Setup is complete once approval succeeds and these commands return data.

## Stable identity

For a long-lived agent, set a stable session key before signing in:

```bash theme={null}
DENCH_SESSION_KEY=project-agent \
  npx -y -p @dench.com/cli dench signin --kind cursor --name "Cursor Agent - Project"
```

> [!TIP]
>
> Do not set `DENCH_SESSION_KEY` to internal `auto:` or `explicit:` values.
> Switch between existing sessions with `dench use <key-or-slug>`.

## Headless and CI

Skip the browser flow with a workspace API key from your settings:

```bash theme={null}
export DENCH_API_KEY="<workspace key>"
npx -y -p @dench.com/cli dench crm entries list people --json
```

## Troubleshooting

> [accordion] dench: command not found
>
> Use `npx -y -p @dench.com/cli dench <command>`. A bare
> `npx -y @dench.com/cli …` fails because npx can't find a bin matching the
> package name.

> [accordion] status says no session
>
> Run `dench signin` once and ask the human to approve it.

> [accordion] Multiple sessions exist
>
> Run `dench sessions --json`, ask which to use, then `dench use <key-or-slug>`.

> [accordion] 402 upgrade\_required
>
> Chat, files, enrichment, and image-gen are paid. Run `dench upgrade --tier max`
> and share the link. See [Billing](https://dench.com/docs/billing.md).

## Next

> [card] [CRM playbook](https://dench.com/docs/crm.md)
>
> Model people, companies, tasks, and custom objects.

> [card] [API playground](https://dench.com/docs/api/overview.md)
>
> Try every endpoint live with your bearer token.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.