refactor(coder-labs/cursor-cli): support terraform provider coder v2.12.0 (#491)

## Description

Updates the module to use the new version of the agentapi module for
Coder 2.28

## Type of Change

- [ ] New module
- [ ] New template
- [ ] Bug fix
- [x] Feature/enhancement
- [ ] Documentation
- [ ] Other

## Module Information

**Path:** `registry/coder-labs/modules/cursor-cli`  
**New version:** `v0.3.0`  
**Breaking change:** [x] Yes [ ] No

## Testing & Validation

- [x] Tests pass (`bun test`)
- [x] Code formatted (`bun fmt`)
- [ ] Changes tested locally

## Related Issues

- https://github.com/coder/internal/issues/1065

## Related PRs

- https://github.com/coder/registry/pull/485

---------

Co-authored-by: DevCats <christofer@coder.com>
This commit is contained in:
Danielle Maywood
2025-12-17 15:12:34 +00:00
committed by GitHub
parent 4b9da4036a
commit c551c4d84a
4 changed files with 10 additions and 6 deletions
@@ -13,7 +13,7 @@ Run the Cursor Agent CLI in your workspace for interactive coding assistance and
```tf ```tf
module "cursor_cli" { module "cursor_cli" {
source = "registry.coder.com/coder-labs/cursor-cli/coder" source = "registry.coder.com/coder-labs/cursor-cli/coder"
version = "0.2.2" version = "0.3.0"
agent_id = coder_agent.main.id agent_id = coder_agent.main.id
folder = "/home/coder/project" folder = "/home/coder/project"
} }
@@ -42,7 +42,7 @@ module "coder-login" {
module "cursor_cli" { module "cursor_cli" {
source = "registry.coder.com/coder-labs/cursor-cli/coder" source = "registry.coder.com/coder-labs/cursor-cli/coder"
version = "0.2.2" version = "0.3.0"
agent_id = coder_agent.main.id agent_id = coder_agent.main.id
folder = "/home/coder/project" folder = "/home/coder/project"
@@ -159,7 +159,7 @@ describe("cursor-cli", async () => {
"-c", "-c",
"cat /home/coder/.cursor-cli-module/agentapi-start.log || cat /home/coder/.cursor-cli-module/start.log || true", "cat /home/coder/.cursor-cli-module/agentapi-start.log || cat /home/coder/.cursor-cli-module/start.log || true",
]); ]);
expect(startLog.stdout).toContain(`-m ${model}`); expect(startLog.stdout).toContain(`--model ${model}`);
expect(startLog.stdout).toContain("-f"); expect(startLog.stdout).toContain("-f");
expect(startLog.stdout).toContain("test prompt"); expect(startLog.stdout).toContain("test prompt");
}); });
@@ -4,7 +4,7 @@ terraform {
required_providers { required_providers {
coder = { coder = {
source = "coder/coder" source = "coder/coder"
version = ">= 2.7" version = ">= 2.12"
} }
} }
} }
@@ -132,7 +132,7 @@ resource "coder_env" "cursor_api_key" {
module "agentapi" { module "agentapi" {
source = "registry.coder.com/coder/agentapi/coder" source = "registry.coder.com/coder/agentapi/coder"
version = "1.2.0" version = "2.0.0"
agent_id = var.agent_id agent_id = var.agent_id
folder = local.folder folder = local.folder
@@ -179,3 +179,7 @@ module "agentapi" {
/tmp/install.sh /tmp/install.sh
EOT EOT
} }
output "task_app_id" {
value = module.agentapi.task_app_id
}
@@ -50,7 +50,7 @@ ARGS=()
# global flags # global flags
if [ -n "$ARG_MODEL" ]; then if [ -n "$ARG_MODEL" ]; then
ARGS+=("-m" "$ARG_MODEL") ARGS+=("--model" "$ARG_MODEL")
fi fi
if [ "$ARG_FORCE" = "true" ]; then if [ "$ARG_FORCE" = "true" ]; then
ARGS+=("-f") ARGS+=("-f")