|
1 | 1 | ---
|
2 |
| -display_name: Cursor |
3 |
| -description: Run Cursor IDE and CLI in your workspace |
| 2 | +display_name: Cursor IDE |
| 3 | +description: Add a one-click button to launch Cursor IDE |
4 | 4 | icon: ../../../../.icons/cursor.svg
|
5 | 5 | verified: true
|
6 |
| -tags: [ide, cursor, ai, cli, agent] |
| 6 | +tags: [ide, cursor, ai] |
7 | 7 | ---
|
8 | 8 |
|
9 |
| -# Cursor |
| 9 | +# Cursor IDE |
10 | 10 |
|
11 |
| -Run [Cursor IDE](https://cursor.com) and [Cursor CLI](https://docs.cursor.com/en/cli/overview) in your workspace. Provides both desktop IDE integration and terminal-based AI coding assistance. |
| 11 | +Add a button to open any workspace with a single click in Cursor IDE. |
| 12 | + |
| 13 | +Uses the [Coder Remote VS Code Extension](https://github.com/coder/vscode-coder). |
12 | 14 |
|
13 | 15 | ```tf
|
14 | 16 | module "cursor" {
|
15 | 17 | count = data.coder_workspace.me.start_count
|
16 | 18 | source = "registry.coder.com/coder/cursor/coder"
|
17 |
| - version = "2.0.0" |
| 19 | + version = "1.2.1" |
18 | 20 | agent_id = coder_agent.example.id
|
19 |
| - folder = "/home/coder" |
20 | 21 | }
|
21 | 22 | ```
|
22 | 23 |
|
23 |
| -## Prerequisites |
24 |
| - |
25 |
| -- You must add the [Coder Login](https://registry.coder.com/modules/coder-login) module to your template |
26 |
| - |
27 |
| -## Features |
28 |
| - |
29 |
| -- **Desktop IDE**: One-click button to launch Cursor IDE (uses the [Coder Remote VS Code Extension](https://github.com/coder/vscode-coder)) |
30 |
| -- **CLI Agent**: Terminal-based AI coding assistant with interactive and non-interactive modes |
31 |
| -- **AgentAPI Integration**: Web interface for CLI interactions |
32 |
| -- **Interactive Mode**: Conversational sessions with text output |
33 |
| -- **Non-Interactive Mode**: Automation-friendly for scripts and CI pipelines |
34 |
| - |
35 | 24 | ## Examples
|
36 | 25 |
|
37 |
| -### Basic setup with CLI enabled |
38 |
| - |
39 |
| -```tf |
40 |
| -module "coder-login" { |
41 |
| - count = data.coder_workspace.me.start_count |
42 |
| - source = "registry.coder.com/coder/coder-login/coder" |
43 |
| - version = "1.0.15" |
44 |
| - agent_id = coder_agent.example.id |
45 |
| -} |
46 |
| -
|
47 |
| -module "cursor" { |
48 |
| - count = data.coder_workspace.me.start_count |
49 |
| - source = "registry.coder.com/coder/cursor/coder" |
50 |
| - version = "2.0.0" |
51 |
| - agent_id = coder_agent.example.id |
52 |
| - folder = "/home/coder/project" |
53 |
| - install_cursor_cli = true |
54 |
| - install_agentapi = true |
55 |
| -} |
56 |
| -``` |
57 |
| - |
58 |
| -### Desktop IDE only (legacy mode) |
59 |
| - |
60 |
| -```tf |
61 |
| -module "cursor" { |
62 |
| - count = data.coder_workspace.me.start_count |
63 |
| - source = "registry.coder.com/coder/cursor/coder" |
64 |
| - version = "2.0.0" |
65 |
| - agent_id = coder_agent.example.id |
66 |
| - folder = "/home/coder/project" |
67 |
| - install_cursor_cli = false |
68 |
| - install_agentapi = false |
69 |
| -} |
70 |
| -``` |
71 |
| - |
72 |
| -### With custom pre-install script |
| 26 | +### Open in a specific directory |
73 | 27 |
|
74 | 28 | ```tf
|
75 | 29 | module "cursor" {
|
76 | 30 | count = data.coder_workspace.me.start_count
|
77 | 31 | source = "registry.coder.com/coder/cursor/coder"
|
78 |
| - version = "2.0.0" |
| 32 | + version = "1.2.1" |
79 | 33 | agent_id = coder_agent.example.id
|
80 |
| - |
81 |
| - pre_install_script = <<-EOT |
82 |
| - # Install additional dependencies |
83 |
| - npm install -g typescript |
84 |
| - EOT |
| 34 | + folder = "/home/coder/project" |
85 | 35 | }
|
86 | 36 | ```
|
87 |
| - |
88 |
| -## Usage |
89 |
| - |
90 |
| -### Desktop IDE |
91 |
| - |
92 |
| -Click the "Cursor Desktop" button in your workspace to launch Cursor IDE. |
93 |
| - |
94 |
| -### CLI Agent |
95 |
| - |
96 |
| -#### Web Interface |
97 |
| - |
98 |
| -1. Click the "Cursor" button to access the web interface |
99 |
| -2. Start interactive sessions with text output |
100 |
| - |
101 |
| -#### Terminal Usage |
102 |
| - |
103 |
| -```bash |
104 |
| -# Interactive mode (default) |
105 |
| -cursor-agent |
106 |
| - |
107 |
| -# Interactive mode with initial prompt |
108 |
| -cursor-agent "refactor the auth module to use JWT tokens" |
109 |
| - |
110 |
| -# Non-interactive mode with text output |
111 |
| -cursor-agent -p "find and fix performance issues" --output-format text |
112 |
| - |
113 |
| -# Use specific model |
114 |
| -cursor-agent -p "add error handling" --model "gpt-5" |
115 |
| - |
116 |
| -# Session management |
117 |
| -cursor-agent ls # List all previous chats |
118 |
| -cursor-agent resume # Resume latest conversation |
119 |
| -cursor-agent --resume="chat-id" # Resume specific conversation |
120 |
| -``` |
121 |
| - |
122 |
| -#### Interactive Mode Features |
123 |
| - |
124 |
| -- Conversational sessions with the agent |
125 |
| -- Review proposed changes before applying |
126 |
| -- Real-time guidance and steering |
127 |
| -- Text-based output optimized for terminal use |
128 |
| -- Session persistence and resumption |
129 |
| - |
130 |
| -#### Non-Interactive Mode Features |
131 |
| - |
132 |
| -- Automation-friendly for scripts and CI pipelines |
133 |
| -- Direct prompt execution with text output |
134 |
| -- Model selection support |
135 |
| -- Git integration for change reviews |
136 |
| - |
137 |
| -## Configuration |
138 |
| - |
139 |
| -The module supports the same configuration options as the Cursor CLI: |
140 |
| - |
141 |
| -- **MCP (Model Context Protocol)**: Automatically detects `mcp.json` configuration |
142 |
| -- **Rules System**: Supports `.cursor/rules` directory for custom agent behavior |
143 |
| -- **Environment Variables**: Respects Cursor CLI environment settings |
144 |
| - |
145 |
| -## Troubleshooting |
146 |
| - |
147 |
| -The module creates log files in the workspace's `~/.cursor-module` directory. Check these files if you encounter issues: |
148 |
| - |
149 |
| -```bash |
150 |
| -# Check installation logs |
151 |
| -cat ~/.cursor-module/install.log |
152 |
| - |
153 |
| -# Check runtime logs |
154 |
| -cat ~/.cursor-module/runtime.log |
155 |
| - |
156 |
| -# Verify Cursor CLI installation |
157 |
| -cursor-agent --help |
158 |
| -``` |
159 |
| - |
160 |
| -### Common Issues |
161 |
| - |
162 |
| -1. **Cursor CLI not found**: Ensure `install_cursor_cli = true` or install manually: |
163 |
| - |
164 |
| - ```bash |
165 |
| - curl https://cursor.com/install -fsS | bash |
166 |
| - ``` |
167 |
| - |
168 |
| -2. **Permission issues**: Check that the installation script has proper permissions |
169 |
| - |
170 |
| -3. **Path issues**: The module automatically adds Cursor CLI to PATH, but you may need to restart your shell |
0 commit comments