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

# Devin sandbox CLI

> Give the Sazabi agent the Devin CLI (devin) in its sandbox to start and manage AI coding sessions.

[All Devin integration capabilities](https://docs.sazabi.com/catalogs/integrations/devin)

## About

This CLI connection makes the Devin (Cognition) CLI (`devin`) available in the Sazabi agent's sandbox, so the agent can start and manage AI coding sessions. The CLI is already in the sandbox. Connecting a key lets it act on your Devin account without an interactive browser sign-in.

## Prerequisites

* A Sazabi project.
* A Devin API key (`DEVIN_API_KEY`). The key starts with `cog_` and is either a service user's key or a personal access token. Mint it in Devin under [**Settings > Devin API**](https://app.devin.ai/settings/devin-api): provision a service user on the **Service users** tab, or create a personal access token on the **PATs** tab.
* Or the Devin integration connected under [**Settings > Integrations**](https://app.sazabi.com/settings/integrations). The CLI then uses that connection's key and asks for none of its own. Disconnecting the integration brings the key field back.

## Set up in the dashboard

Configure the sandbox in the dashboard under [**Settings > Sandbox CLIs**](https://app.sazabi.com/settings/sandbox-clis).

**Step 1**

### Find Devin in the catalog

In [**Settings > Sandbox CLIs**](https://app.sazabi.com/settings/sandbox-clis), find Devin under **Browse sandbox CLIs** and choose to connect it.

**Step 2**

### Provide credentials

Paste your key into **Devin API key** and save. Sazabi validates the key with the Devin API before saving, exactly as the Devin integration does, and a rejected key saves nothing. If the Devin integration is connected, this field doesn't appear.

## Set up with the CLI

You can also configure the Devin CLI connection with the [Sazabi CLI](https://docs.sazabi.com/reference/cli.md) (installed and authenticated; see [CLI reference](https://docs.sazabi.com/reference/cli/sandbox-clis.md)).

```bash theme={"system"}
sazabi sandbox-clis connect devin --env DEVIN_API_KEY=<your-devin-key>
```

`connect` tests the key first, and a failed test saves nothing. To validate the key without saving, run the same command with `test` in place of `connect` (the test command also requires the `--env` flags). To keep the key out of your shell history, pass `--env-file <path>` instead of `--env`.

## Verify

In a thread, ask the agent to use the `devin` CLI to show your recent Devin sessions. The check passes when the sessions in the thread match the ones in your [Devin account](https://app.devin.ai). An authentication error means the key wasn't accepted; see Troubleshooting.

## Troubleshooting

**Command not found**: Confirm the Devin CLI connection is enabled for the project under [**Settings > Sandbox CLIs**](https://app.sazabi.com/settings/sandbox-clis).

**Connect or test fails**: Check that the key starts with `cog_` and hasn't been revoked. Sazabi refuses a token that names no organization, so mint the key from your organization's [**Settings > Devin API**](https://app.devin.ai/settings/devin-api) page.

**Authentication fails after it worked before**: The key was probably rotated or revoked. Re-enter a new key under [**Settings > Sandbox CLIs**](https://app.sazabi.com/settings/sandbox-clis) or run `sazabi sandbox-clis connect devin` again. If the Devin integration is connected, the CLI uses that connection's key, so reconnect it under [**Settings > Integrations**](https://app.sazabi.com/settings/integrations) instead.

## Further reading

> [card] [Working with the agent](https://docs.sazabi.com/ask/better-answers.md)
>
> Put the connected CLI to work in an investigation thread.

> [card] [Set up the sandbox](https://docs.sazabi.com/ask/sandbox.md)
>
> How the sandbox works and its security model.

> [card] [Sandbox CLIs](https://docs.sazabi.com/catalogs/integrations.md#sandbox-clis)
>
> Browse the catalog and connect more tools.


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