Skip to content

Cursor Agent

HAPI supports Cursor Agent CLI for running Cursor's AI coding agent with remote control via web and phone.

Prerequisites

Install Cursor Agent CLI:

  • macOS/Linux: curl https://cursor.com/install -fsS | bash
  • Windows: irm 'https://cursor.com/install?win32=true' | iex

Verify installation:

bash
agent --version

Usage

bash
hapi cursor                    # Start Cursor Agent session
hapi cursor resume <chatId>    # Resume a specific chat
hapi cursor --continue         # Resume the most recent chat
hapi cursor --mode plan        # Start in Plan mode
hapi cursor --mode ask         # Start in Ask mode
hapi cursor --yolo             # Bypass approval prompts (--force)
hapi cursor --model <model>    # Specify model

Permission Modes

ModeDescription
defaultStandard agent behavior
planPlan mode - design approach before coding
askAsk mode - explore code without edits
yoloBypass approval prompts

Set mode via --mode flag or change from the web UI during a session.

Modes

  • Local mode - Run hapi cursor from terminal. Full interactive experience.
  • Remote mode - Spawn from web/phone when no terminal. Uses agent -p with --output-format stream-json and --trust. Each user message spawns one agent process; session continues via --resume.

Limitations

  • Tool approval - In remote mode, --trust is used; tools run without per-request approval. Use --yolo for full bypass.
  • Session resume - Pass --resume <chatId> or --continue to resume. Use agent ls to list previous chats and get chat IDs.

Integration

Once running, your Cursor session appears in the HAPI web app and Telegram Mini App. You can:

  • Monitor session activity
  • Approve permissions from your phone
  • Send messages when in local mode (messages queue for when you switch)

Released under the LGPL-3.0 License.