Cursor Cookbook: The IDE Becomes an API

A tour of the official SDK examples that turn Cursor’s agent brain into a CLI, a live sandbox, and a workflow engine.

8 to 10 min read View on GitHub More from cursor

A wide control-room scene with one editor-shaped console on a white desk and three output channels branching outward. A terminal, a browser preview, and a cloud node all receive the same stream from the center, showing that the same agent can move across surfaces without changing its core logic.
Cursor’s cookbook is less about recipes than about runtime shape. The same agent can surface in the terminal, a web preview, or cloud execution, which is the real headline here.
Key Takeaways

cursor/cookbook is easy to misread. The name sounds like a pile of examples. The repo is actually a public interface to Cursor’s agent runtime.

The IDE is no longer a destination. It is an interface.

That is the useful shock here. Cursor is not just showing how to prompt an agent inside the editor. It is showing how to treat the editor as infrastructure: local agents, cloud agents, terminal UIs, live sandboxes, and orchestration graphs all sit on the same SDK foundation.

To accelerate adoption, Cursor has published a public cookbook repository on GitHub with four starter projects: a minimal quickstart (a Node.js example that creates a local agent, sends one prompt, and streams the response), a web-based prototyping tool for scaffolding new projects in a sandboxed cloud environment, an agent-powered kanban board that automatically opens PRs when engineers drag a card, and a lightweight coding agent CLI for spawning Cursor agents from the terminal.

Roshan Sadanani, Cursor Team · Build programmatic agents with the Cursor SDK

What the cookbook actually contains

The repo splits into two obvious layers. .cursor/skills is the editorial brain, a place for reusable patterns that shape how Cursor behaves inside the editor. sdk/ is the systems layer, where the examples show how to program against that behavior.

The core abstraction is not a recipe. It is a stateful session that can be routed into different execution planes while keeping the same event stream and agent logic.

AreaWhat it showsWhy it matters
.cursor/skillsReusable behavior patterns inside the editorShows Cursor as a programmable environment, not only an app
sdk/quickstartA minimal local agent that streams outputEstablishes the base agent lifecycle
sdk/coding-agent-cliA terminal-first interfaceMakes the terminal a control surface
sdk/app-builderA sandboxed app that evolves liveProves agent edits can drive a running preview
sdk/dag-task-runnerParallel sub-agents with dependenciesMoves from single-agent prompting to orchestration

One SDK, three execution planes

The deepest idea in the repo is parity. The same agent abstraction can run against a local working directory, a cloud execution environment, or a live preview workflow. That matters because it means the orchestration layer does not have to be rewritten every time the surface changes.

class CodingAgentSession {
  async ensureAgentFresh() {
    if (this.modeChanged || this.modelChanged) {
      this.agent = new Agent({ mode: this.mode, model: this.model });
    }
  }

  async *run(prompt: string) {
    await this.ensureAgentFresh();
    for await (const event of this.agent.stream(prompt)) {
      yield event;
    }
  }
}

That pattern is the tell. The session is not a single prompt-response exchange. It is a live object that preserves state, rehydrates when mode or model changes, and emits structured events as the work unfolds.

Why the terminal is a first-class agent surface

The coding-agent-cli example makes a strong point: the terminal is not a fallback UI. It is a serious control room. Progress updates, tool calls, and streaming status all fit naturally there, which makes the CLI feel closer to an operations console than a chat box.

A close-up of a terminal interface surrounded by status panes, progress indicators, and a narrow command rail. The terminal sits at the center like a command desk, showing how a rich CLI can act as a first-class surface for agent control and feedback.
The CLI example treats structured feedback as the product. That is what makes the terminal feel alive instead of merely text-based.

The point is not that a terminal can render text. The point is that the agent can communicate its state in a way a developer can act on immediately.

The live sandbox is where the SDK becomes tangible

If the CLI proves the interface, app-builder proves the loop. A Vite app spins up in a temporary workspace, the agent edits files, and the preview reflects the change as the session continues. This is the fastest way to understand why Cursor’s SDK feels different from generic automation.

Conventional coding assistantCursor app-builder
Edits happen in a chat-driven flowEdits land in a running sandbox with a live preview
The user checks changes manuallyThe preview responds as the session evolves
Context is mostly conversationalContext includes the app, the files, and the running dev server

The live sandbox makes the editing loop visible. You are not asking an assistant to describe a result. You are watching the result form inside an executable environment.

DAGs are the real power move

The most advanced example in the repo is dag-task-runner. It stops thinking in lines and starts thinking in dependencies. One task fans out into sub-agents, some run in parallel, others wait on prerequisites, and the final output is assembled after the graph resolves.

Generating illustration...

Once tasks become graphs, the unit of work changes. The interesting object is no longer the prompt, but the dependency structure around it.

That is the conceptual leap. Cursor is not just helping a single agent think harder. It is teaching developers how to coordinate many smaller agents with explicit dependencies.

Single-agent prompt chainDAG orchestration
One long context windowMultiple bounded sub-tasks
Linear executionParallel and dependent execution
Hard to inspectEasy to reason about as a graph
Best for small changesBetter for multi-step feature work

How Cursor differs from generic agent frameworks

This repo sits in a different category from generic agent frameworks. Those frameworks are powerful, but they usually start from abstraction. Cursor starts from a real editor, a real file system, and a real mutation loop. The SDK examples are optimized for that environment, not for an abstract agent in the cloud.

CategorySurfaceControlBest use case
Conventional AI coding assistantsChat box or editor sidebarLow to moderateFast help on isolated tasks
Generic agent frameworksApplication-level runtimeHighCustom products and research prototypes
Cursor Cookbook and SDKCursor-native editor runtimeHigh, but opinionatedEmbedded coding agents, sandboxes, and orchestration

That is the business story too. Cursor is not selling a toolkit that happens to work with an editor. It is publishing official patterns for its own runtime, which is a much stronger signal.

What this means for developers

The practical implication is larger than one repo. Teams can build in-house agents that review PRs, scaffold apps, migrate code, or run task-specific workflows without building a generic agent stack from scratch. The SDK examples show what happens when an IDE stops being a place where work appears and becomes the system that coordinates the work.

build custom agents with the cursor sdk! here's a kanban board for your agents, more examples in our cookbook repo: https://t.co/wopZIJmiyv https://t.co/DzyrUTbres https://t.co/J2j1jAIXWN

eric zakariasson, Developer · @ericzakariasson on X

Cursor Cookbook matters because it shows the editor becoming infrastructure. That shift is subtle in the repo, but obvious in the pattern it points to: agents are no longer only answering questions. They are running inside systems you can shape.