Skip to content

feat(admin): one-click Cursor worker install - #263

Merged
bobdivx merged 1 commit into
mainfrom
feat/cursor-worker-one-click
Oct 21, 2026
Merged

bobdivx merged 1 commit into
mainfrom
feat/cursor-worker-one-click

Conversation

@bobdivx

@bobdivx bobdivx commented Oct 21, 2026

Copy link
Copy Markdown
Owner

Why

The Worker Cursor admin tab asked for 4 fields (machine name, Cursor API key, agent binary path, extra directories) plus an auto-start switch, and told the admin to run curl https://cursor.com/install -fsS | bash on the host before anything worked. Only the personal Cursor API key truly needs the user.

What

One button: « Installer le worker Cursor » → confirm modal → DevForge does the rest:

Before (asked to the user) Now
Run the CLI install command on the host Installed automatically into <data>/cursor-worker/home (persistent volume) on the chosen node
Machine name Defaults to the node name (slug), editable in « Avancé »
Agent binary path Found on PATH or in the managed install, editable in « Avancé »
Extra directories Optional, in « Avancé »; projects are detected automatically; empty fallback workspace if nothing is cloned yet
Auto-start switch Enabled by the install; single switch on the worker tile
Start / Restart buttons Install = install + (re)start + verify; restart / stop (with confirmation) in the status modal
Cursor API key Still asked, only if none is stored (single masked field in the modal). A server-side CURSOR_API_KEY env var is also accepted, so nothing has to be typed
  • POST /api/v1/cursor-worker/install returns per-step results (settings, CLI, start, verify). Verification = process alive + /readyz probe on the worker's local management address.
  • Node: leader by default (child process, as before); any online worker node via the existing cluster executor (/internal/exec). Choice behind « Changer » in the modal; the previous node's worker is stopped when moving.
  • The key is passed via CURSOR_API_KEY in the process environment, no longer as --api-key (visible in ps). It is never echoed by the scripts (tested).
  • Start/stop/restart and boot auto-start are node-aware.
  • UI follows the tile rule: worker tile (status + auto-start switch), repos tile, advanced tile; details in modals; mobile full-screen sheets.

Tests

  • Rust: arg building (no key in argv, 20-dir cap), shell quoting, key validation, name slug, script content, output parsing, node ordering/selection, verify step, and an end-to-end run of install/start/status/stop scripts with a fake agent binary.
  • Web: workerSummary / installNeeds helpers.

Nothing was installed on real nodes; not deployed.

The Cursor worker tab asked for a machine name, an API key, a binary path
and extra directories, and told the admin to run a curl | bash command on
the host. Everything except the personal Cursor API key can be derived.

- POST /api/v1/cursor-worker/install: saves the key if given, picks the
  node (leader by default, any online worker node via the cluster
  executor), installs the Cursor CLI into <data>/cursor-worker/home when
  missing, (re)starts `agent worker start` on every cloned project, then
  verifies the process and its /readyz probe. Returns per-step results.
- Name defaults to the node name; binary is found on PATH or in the
  managed install; repos come from projects; empty fallback workspace
  when nothing is cloned yet; auto-start is enabled by the install.
- API key is passed via CURSOR_API_KEY (never argv / logs); also accepts
  a server-side CURSOR_API_KEY so nothing has to be typed at all.
- Start/stop/restart and boot auto-start work on remote nodes too.
- UI: one primary button, a confirm modal that only asks for the key when
  none is stored (node choice behind "Changer"), status tiles (worker +
  auto-start switch, repos, advanced), details and settings in modals.
- Tests: arg building, scripts (incl. end-to-end with a fake agent),
  parsing, node selection, UI summary helpers.
@bobdivx
bobdivx merged commit ba1b0b8 into main Oct 21, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant