LoopCLI

Cursor + LoopCLI

Cursor blends AI pair programming with a focused IDE experience. This guide shows how to connect LoopCLI so you can scaffold, run, and deploy automation loops from the Cursor workflow builder.

1. Install LoopCLI & expose it to Cursor

  1. Verify LoopCLI is installed (loopcli version).
  2. Ensure the binary is discoverable by Cursor:
    • macOS/Linux: add export PATH="$HOME/.local/bin:$PATH" (or wherever loopcli lives) to .zshrc / .bashrc.
    • Windows: add %USERPROFILE%\.loopcli to your PATH and restart Cursor.
  3. Open Cursor’s terminal (Ctrl+``) and confirm loopcli version` works.

2. Create workflow builder actions

Cursor’s workflow builder lets you define reusable commands. Add two actions:

  • Run Active Loop
    • Command: loopcli loop run ${relativeFile}
    • Set “Working directory” to your repo root.
  • Deploy Active Loop
    • Command: loopcli loop deploy ${relativeFileBasename} --activate

Now you can trigger loops directly from the AI side panel or command palette.

3. Boost AI understanding of LoopCLI YAML

Cursor’s strength is AI-assisted editing. Feed it the LoopCLI schema so completions are accurate:

  1. Create a file .cursor/rules/loopcli.yaml with snippets for common steps (HTTP, CLI, schedule, secrets).
  2. Add a short README explaining how loops pass data between steps.
  3. Use the “Teach Cursor” feature to highlight a working loop and label it “LoopCLI example.”

This context keeps the model from hallucinating invalid keys.

4. Terminal automation & secrets

  • Use Cursor tasks (Tasks tab) to run scripts such as loopcli secret add or loopcli loop list.
  • Keep secrets in the LoopCLI Vault—never commit .env files. When the AI suggests environment variables, remind it to reference loopcli secret instead.

5. Suggested workflow builder recipes

Action Result
loopcli loop run onboarding --watch Stream live output in the integrated terminal.
loopcli loop deploy onboarding --schedule "0 12 * * *" --activate Deploy a daily lunch-and-learn summary loop.
loopcli loop run --prompt Let Cursor generate a loop name and pass it into an interactive run.

Save these actions so the AI can reference them in future plans.

6. Troubleshooting

Issue Fix
AI suggests invalid YAML keys Re-teach Cursor using a fresh loop example; pin the schema in .cursor/rules.
Command not found inside actions Re-open Cursor after updating PATH; Windows users may need to launch Cursor from a shell once.
Secrets missing in terminal Check that Cursor respects your shell init files (Preferences → Terminal → Default shell).

Next steps

  • Pair this setup with Starter Recipes for quick automation wins.
  • Explore Connectors to wire SaaS APIs into Cursor-driven loops.
  • Want tighter AI integration? Request features in Discord—we maintain a Cursor-focused backlog.

Related Documentation

Continue learning with these related topics