Cursor's New CLI: AI Coding Power Unleashed in Your Terminal

Cursor has been making huge strides, and in a truly unexpected move, they have now introduced the Cursor CLI tool. This new update lets you interact with AI agents directly from your terminal to write, review, and modify code.

Whether you need an interactive terminal interface for real-time collaboration or print automation for scripts and CI/CD pipelines, the CLI places powerful AI coding assistance exactly where you work. While currently in beta, it already boasts incredible features.

Core Features Explained in 2 Minutes

The Cursor CLI brings a number of powerful capabilities directly to your development workflow:

  • Headless & Integrated Agents: You can use the Cursor agent from the CLI or run it headlessly in any environment. Work with the agent directly within the Cursor editor, or run multiple agents in parallel right in the terminal or remotely. This is perfect for automation, collaborative development, and AI-assisted code generation without leaving your workflow.
  • Interactive Code Reviews: The CLI allows you to review agent edits directly in your terminal. You can access diffs, approve changes, tweak suggestions, or reject AI modifications on the fly.
  • Real-Time Steering: Direct the agent's next move while it's actively coding. This granular control ensures the AI stays on the right track.
  • Custom Rule-Sets: Define exactly how the agent works by setting custom rules through agent.md or with custom rule configurations, tailoring the AI's behavior to your project's specific needs.
  • Seamless Integration: If you have a Cursor subscription, you can access all the state-of-the-art models it provides directly within the CLI at no extra cost. It also works with your preferred IDE.
  • Powerful Scripting: Write powerful scripts and automations directly within the terminal, leveraging the AI to streamline complex tasks.

Head-to-Head: Cursor CLI vs. The Competition

A test was conducted to build a Next.js app with Tailwind CSS for collecting and showcasing customer feedback. Three AI agents were tasked with this, each given approximately 30 minutes.

1. Claude Code (Opus 4.1)

  • Result: Delivered a working demo fairly quickly.
  • Process: Required several prompts to guide the interaction. The final product was a simple, basic application.
  • Tokens Used: Approximately 33k tokens.

2. Codeex (GPT-5)

  • Result: Failed to produce a working app after 30 minutes.
  • Process: Shockingly, even using GPT-5, the agent got stuck setting up Tailwind and ended up with compiling errors.
  • Tokens Used: Over 100k tokens.

3. Cursor CLI (GPT-5)

  • Result: Delivered a functional, interactive app with a minimal, clean design that looked less AI-generated.
  • Process: The generation was slower, but the quality of the output was significantly higher than the others.
  • Tokens Used: A staggering 188k tokens.

The Takeaway: While Opus 4.1 is a capable model, combining a powerful model like GPT-5 with the intelligent framework of Cursor CLI can produce superior results. This showcases the immense potential of Cursor CLI due to its unmatched output quality, though it highlights a need for optimizing token usage.

Getting Started with Cursor CLI

Getting started is simple. First, you need to install the CLI tool. Open your terminal and run the following command:

# Example installation command (refer to official documentation for the exact command)
npm install -g cursor-cli

After the installation, you will need to add the executable to your system's PATH. Once that is configured, you can start the Cursor CLI by typing the cursor-agent command in your terminal.

cursor-agent

This will prompt you to sign in with your browser. If you don't have a Cursor account, you can get started with their free tier, which allows you to use the CLI tool. For the free tier, you will need to bring your own API key. After authenticating, you can begin working with the agent directly in your terminal.

Using the CLI: A Quick Guide

Once you're in the agent interface, you can type / to see the available commands.

  • /model: Set the AI model you want to use (e.g., GPT models, Sonnet 4, Claude 4.1 Opus).
  • /autorun: Enable this to have the agent autonomously work on generating code based on your tasks.
  • /new: Start a new chat session.
  • /rules & /mcp: Configure the rules.json and mcp.json files to define custom behaviors and direct the agent's approach.

Putting It to the Test: Building a Note-Taking App

To see it in action, the agent was tasked with creating a note-taking app with a functional drag-and-drop UI that could also track schedules. The prompt also requested the agent to be creative and add as many features as possible.

With auto-run enabled, the agent immediately began working. It deployed planning agents to build the application's skeleton and then assigned other agents to work on different components. The terminal provided a live preview of the tokens being used as it scaffolded a self-contained, browser-based app.

The agent generated the index.html file and other necessary assets. In a non-autorun mode, you could see the diff changes live and even write in the terminal to edit individual files.

The result was a functional note and schedule-taking app. The output quality was impressive for a single-shot generation. It included a section for adding new notes and a built-in calendar. While some of the formatting was slightly off and not all features were fully coded, the core drag-and-drop functionality was present, and the overall application was a decent-looking and usable prototype.

Overall, Cursor's CLI tool is a fantastic new addition for developers. Its ability to generate high-quality code and integrate directly into the terminal workflow makes it a powerful asset. As it is still in beta, we can expect it to be continuously improved and refined over the coming weeks.