Skip to content

Commit 4ac6ead

Browse files
committed
sbx: add docs for cursor-agent
Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
1 parent 8fe1459 commit 4ac6ead

3 files changed

Lines changed: 82 additions & 1 deletion

File tree

content/manuals/ai/sandboxes/agents/_index.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Supported agents
33
linkTitle: Agents
44
weight: 30
55
description: AI coding agents supported by Docker Sandboxes.
6-
keywords: docker sandboxes, ai agents, claude code, codex, gemini
6+
keywords: docker sandboxes, ai agents, claude code, codex, cursor, gemini
77
---
88

99
{{< summary-bar feature_name="Docker Sandboxes sbx" >}}
@@ -13,6 +13,7 @@ Docker Sandboxes runs the following agents out of the box:
1313
- [Claude Code](claude-code/)
1414
- [Codex](codex/)
1515
- [Copilot](copilot/)
16+
- [Cursor](cursor/)
1617
- [Droid](droid/)
1718
- [Gemini](gemini/)
1819
- [Kiro](kiro/)
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
---
2+
title: Cursor
3+
weight: 33
4+
description: |
5+
Use Cursor in Docker Sandboxes with API key or proxy-managed OAuth
6+
authentication.
7+
keywords: docker sandboxes, cursor, cursor agent, ai agent, sbx
8+
---
9+
10+
{{< summary-bar feature_name="Docker Sandboxes sbx" >}}
11+
12+
This guide covers authentication, configuration, and usage of Cursor in a
13+
sandboxed environment.
14+
15+
Official documentation: [Cursor CLI](https://cursor.com/cli)
16+
17+
## Quick start
18+
19+
Create a sandbox and run Cursor for a project directory:
20+
21+
```console
22+
$ sbx run cursor ~/my-project
23+
```
24+
25+
The workspace parameter is optional and defaults to the current directory:
26+
27+
```console
28+
$ cd ~/my-project
29+
$ sbx run cursor
30+
```
31+
32+
## Authentication
33+
34+
Cursor supports two authentication methods: an API key or OAuth.
35+
36+
**API key**: Store your Cursor API key using
37+
[stored secrets](../security/credentials.md#stored-secrets):
38+
39+
```console
40+
$ sbx secret set -g cursor
41+
```
42+
43+
Alternatively, export the `CURSOR_API_KEY` environment variable in your shell
44+
before running the sandbox. See
45+
[Credentials](../security/credentials.md) for details on both methods.
46+
47+
**OAuth**: If no API key is set, Cursor prompts you to sign in interactively
48+
on first run. The proxy intercepts the token exchange with
49+
`api2.cursor.sh/auth/poll`, so credentials are managed by the host and aren't
50+
stored inside the sandbox.
51+
52+
## Configuration
53+
54+
Sandboxes don't pick up user-level configuration from your host, such as
55+
`~/.cursor`. Only project-level configuration in the working directory is
56+
available inside the sandbox. See
57+
[Why doesn't the sandbox use my user-level agent configuration?](../faq.md#why-doesnt-the-sandbox-use-my-user-level-agent-configuration)
58+
for workarounds.
59+
60+
Cursor reads `AGENTS.md` from the workspace for agent-specific instructions.
61+
62+
The sandbox runs Cursor in YOLO mode by default, which executes commands
63+
without approval prompts. Pass additional `cursor-agent` CLI options after
64+
`--`:
65+
66+
```console
67+
$ sbx run cursor --name <sandbox-name> -- <cursor-options>
68+
```
69+
70+
## Base image
71+
72+
Template: `docker/sandbox-templates:cursor-agent-docker`
73+
74+
Preconfigured to run in YOLO mode with HTTP/1.1 and server-sent events for
75+
agent traffic so requests flow through the host proxy. Authentication state
76+
is persisted across sandbox restarts.
77+
78+
See [Customize](../customize/) to pre-install tools or customize this
79+
environment.

content/manuals/ai/sandboxes/customize/templates.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ CLI, and common development tools like Node.js, Python, Go, and Java.
4444
| `claude-code-minimal` | Claude Code with a minimal toolset (no Node.js, Python, Go, or Java) |
4545
| `codex` | [OpenAI Codex](https://github.com/openai/codex) |
4646
| `copilot` | [GitHub Copilot](https://github.com/github/copilot-cli) |
47+
| `cursor-agent` | [Cursor](https://cursor.com/cli) |
4748
| `docker-agent` | [Docker Agent](https://github.com/docker/docker-agent) |
4849
| `droid` | [Droid](https://www.factory.ai) |
4950
| `gemini` | [Gemini CLI](https://github.com/google-gemini/gemini-cli) |

0 commit comments

Comments
 (0)