Cursor CLI

Cursor CLI is a terminal-based autonomous coding agent developed by Anysphere, the team behind the Cursor editor. It brings Cursor's core multi-file editing, planning, and codebase navigation capabilities out of the IDE and directly into standalone terminal sessions, scripts, and automation pipelines. Day-to-day, developers invoke the agent via the `agent` command to launch an interactive terminal interface, or pass instructions non-interactively using the headless flag (`-p`). The interface provides structured planning steps, multi-file inspection, codebase search, and direct shell execution capabilities. It supports rapid switching between frontier models from providers such as OpenAI, Anthropic, Google Gemini, xAI (Grok), and Cursor's internal Composer models through interactive slash commands. Cursor CLI differentiates itself by bridging interactive terminal development with headless scripting and external integrations. It natively supports Model Context Protocol (MCP) servers, enabling agents to interface with external developer tools like Slack or issue trackers directly from CLI scripts or CI/CD pipelines such as GitHub Actions. The tool is packaged as a proprietary binary under the Cursor ecosystem, tied to Cursor user accounts and subscription plans (Free, Pro, Teams, and Enterprise). It is designed to work across any developer environment regardless of whether the Cursor graphical editor itself is installed.

Tags: ai agent, cli, code assistant, coding agent, terminal

Visit Cursor CLI

Key features

  • Interactive and Headless Modes — Run full interactive planning and coding sessions in the terminal with agent, or execute non-interactive script tasks via agent -p. - Multi-Model Support — Switch between OpenAI, Anthropic, Gemini, Grok, and Composer models dynamically using /model commands. - Context Referencing — Reference local files using @, invoke agent commands with /, and execute direct shell commands with !. - Model Context Protocol (MCP) Integration — Connect terminal agents to external services, APIs, and tools like Slack via standard MCP servers. - Safe Shell Mode — Execute shell commands directly from agent plans with inline safety checks and output rendering. - CI/CD and GitHub Actions Support — Embed agent-driven documentation updates, code reviews, and automated refactors into continuous integration workflows.

Use cases

Use Case: Automated Nightly Codebase Documentation Engineers can schedule headless Cursor CLI commands inside CI/CD workflows (such as GitHub Actions) to scan recent repository changes, generate updated markdown documentation, and commit the diff back to the repository.

Use Case: Interactive In-Terminal Feature Planning Developers working in standard terminals or lightweight IDE setups like Neovim can launch the agent command to parse multiple project files, review directory structures, and generate step-by-step implementation plans without switching windows.

Use Case: Automated Tooling Updates via MCP DevOps and platform engineers can combine Cursor CLI with MCP servers in automation scripts, allowing the agent to parse changes, summarize release notes, and push structured updates directly to team Slack channels or Linear boards.

Who it is for

Cursor CLI is built for developers, DevOps engineers, and platform teams who prefer working in terminal environments or want to script AI-assisted codebase operations into CI/CD pipelines. It is particularly valuable for existing Cursor subscribers who want consistent agent workflows outside the graphical editor. It is less suited for developers looking for open-source self-hosted agent engines that operate entirely offline without account authentication.

Install guide

Installation Install the Cursor CLI binary using the official installation script: bash curl https://cursor.com/install -fsS | bash

First Run Once installed, start an interactive agent session by running: bash agent Authenticate with your Cursor account when prompted. You can switch between active models at any time inside the interactive prompt: text /model Opus 5

Example Session To run a non-interactive headless task with a specific model directly from the command line: bash agent -p --model "GPT-5.6 Sol Extra High" "Update docs based on recent codebase changes" For interactive feature planning: bash agent > plan mission control interface

Part of CLI Coding Agents

Categories: AI Coding Agents, Code Assistants, Developer Tools

Related CLI agents

  • Claude Code — Claude Code is an official terminal-based agentic coding tool developed by Anthropic. Executed via the `claude` CLI command, it provides…
  • ZAP — ZAP is an open-source, terminal-based AI coding agent implemented in Rust by the zap-coding-agent project. It provides an autonomous command-line…
  • Junie — Junie is an autonomous terminal-based AI coding agent developed by JetBrains. Built on top of the IntelliJ IDEA engine, it…
  • Kolega Code — Kolega Code (kolega-code) is an open-source Python-based terminal coding agent developed by the Kolega AI team. It is built to…
  • FetchCoder — FetchCoder is a terminal-based AI coding assistant developed under the Fetch.ai organization. Built specifically for command-line workflows, the tool provides…
  • Keen Code — Keen Code is an open-source, terminal-based AI coding agent built in Go by developer mochow13. It runs directly inside shell…
  • AI Tools
  • Categories
  • Industries
  • CLI Coding Agents
  • MCP Servers
  • MCP Categories