This guide walks you through installing Loops, saving your Cursor API key, and running your first workflow.
- Node.js 20 or later
- A Cursor API key
npm install -g @dresnite/loopsVerify the install:
loops --helpHelp output includes the provider roadmap (cursor supported, claude-code planned).
Save your Cursor API key once. Loops stores it in ~/.loops/credentials.json (file mode 600).
loops key set cursor cursor_...Confirm it was saved:
loops key listService account keys from Cursor Team settings also work.
CURSOR_API_KEY still works as an override, but the recommended flow is loops key set.
loops add structure-agent --description "Improve codebase structure"For interactive setup:
loops add structure-agent --interactiveDefinitions are stored globally in ~/.loops/definitions/.
Start a continuous run against a repository:
loops run structure-agent \
--repo ./my-app \
--prompt "improve structure" \
--budget 10 \
--tasks 25The command prints a run id and returns immediately. The worker keeps running in the background.
| Flag | Meaning |
|---|---|
--budget <usd> |
Stop when estimated model spend reaches this dollar amount |
--tasks <n> |
Stop after this many completed agent turns |
Both are optional. Examples:
--budget 10only — spend cap, no turn limit--tasks 25only — stop after 25 turns, no spend cap--budget 10 --tasks 25— stop when either limit is hit first- neither — run continuously until you stop it with
loops stop
Budget is estimated from token usage reported by the Cursor SDK. See Configuration for details.
For a single execution:
loops run structure-agent --repo ./my-app --onceloops lsExample output:
structure-agent → running (run-id: a1b2, budget used: 30%, tasks: 7/25)
Active runs disappear from loops ls when they finish or error. Use:
loops ls --all
loops logs structure-agentFailed runs show status: error with an error snippet. loops logs prints the full activity log.
loops logs structure-agent --followloops prompt show structure-agent
loops prompt set structure-agent --prompt "focus on error handling"On a continuous run, prompt changes apply on the next agent task.
loops model show structure-agent
loops model set structure-agent --model composer-2.5On a continuous run, model changes apply on the next agent task.
Stop by loop name or run id:
loops stop structure-agent
loops stop a1b2loops rm structure-agentYou cannot remove a definition while a run for that loop is still active.
- Read Concepts to understand definitions vs runs
- See Commands for the full flag reference
- Configure storage and limits in Configuration