Skip to content

Commit b96a281

Browse files
[Blog] Accessing dev environments with Cursor (#2456)
1 parent d5bd85b commit b96a281

File tree

1 file changed

+86
-0
lines changed

1 file changed

+86
-0
lines changed

docs/blog/posts/cursor.md

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
---
2+
title: "Accessing dev environments with Cursor"
3+
date: 2025-03-31
4+
description: "TBA"
5+
slug: cursor
6+
image: https://github.com/dstackai/static-assets/blob/main/static-assets/images/dstack-cursor-v2.png?raw=true
7+
categories:
8+
- Dev environments
9+
---
10+
11+
# Accessing dev environments with Cursor
12+
13+
Dev environments enable seamless provisioning of remote instances with the necessary GPU resources,
14+
automatic repository fetching, and streamlined access via SSH or a preferred desktop IDE.
15+
16+
Previously, support was limited to VS Code. However, as developers rely on a variety of desktop IDEs,
17+
we’ve expanded compatibility. With this update, dev environments now offer effortless access for users of
18+
[Cursor :material-arrow-top-right-thin:{ .external }](https://www.cursor.com/){:target="_blank"}.
19+
20+
<img src="https://github.com/dstackai/static-assets/blob/main/static-assets/images/dstack-cursor-v2.png?raw=true" width="630"/>
21+
22+
<!-- more -->
23+
24+
To access a dev environment via Cursor, set the `ide` property in your configuration to `cursor`.
25+
26+
<div editor-title=".dstack.yml">
27+
28+
```yaml
29+
type: dev-environment
30+
# The name is optional, if not specified, generated randomly
31+
name: vscode
32+
33+
python: "3.11"
34+
# Uncomment to use a custom Docker image
35+
#image: dstackai/base:py3.13-0.7-cuda-12.1
36+
37+
ide: cursor
38+
39+
# Use either spot or on-demand instances
40+
#spot_policy: auto
41+
42+
resources:
43+
gpu: 24GB
44+
```
45+
46+
</div>
47+
48+
Once you’ve configured the environment, invoke the [`dstack apply`](../../docs/reference/cli/dstack/apply.md) command.
49+
When the dev environment is ready, dstack will provide a URL that you can click to open the environment in your desktop
50+
Cursor IDE.
51+
52+
<div class="termy">
53+
54+
```shell
55+
$ dstack apply -f examples/.dstack.yml
56+
57+
# BACKEND REGION RESOURCES SPOT PRICE
58+
1 runpod CA-MTL-1 9xCPU, 48GB, A5000:24GB yes $0.11
59+
2 runpod EU-SE-1 9xCPU, 43GB, A5000:24GB yes $0.11
60+
3 gcp us-west4 4xCPU, 16GB, L4:24GB yes $0.21
61+
62+
Submit the run vscode? [y/n]: y
63+
64+
Launching `vscode`...
65+
---> 100%
66+
67+
To open in Cursor, use this link:
68+
cursor://vscode-remote/ssh-remote+vscode/workflow
69+
```
70+
71+
</div>
72+
73+
Clicking the provided URL will prompt your desktop Cursor IDE to automatically connect to the remote machine via the SSH
74+
tunnel created by the `dstack apply` command, allowing you to securely work with your dev environment.
75+
76+
<img src="https://github.com/dstackai/static-assets/blob/main/static-assets/images/dstack-cursor-ide.png?raw=true" width="800"/>
77+
78+
Using Cursor over VS Code offers multiple benefits, particularly when it comes to integrated AI coding assistance and
79+
enhanced developer experience.
80+
81+
!!! info "What's next?"
82+
1. [Download :material-arrow-top-right-thin:{ .external }](https://www.cursor.com/){:target="_blank"} and install Cursor
83+
2. Learn more about [dev environments](../../docs/concepts/dev-environments.md),
84+
[tasks](../../docs/concepts/tasks.md), [services](../../docs/concepts/services.md),
85+
and [fleets](../../docs/concepts/fleets.md)
86+
2. Join [Discord :material-arrow-top-right-thin:{ .external }](https://discord.gg/u8SmfwPpMd){:target="_blank"}

0 commit comments

Comments
 (0)