cookbook README

The project's README from github.com/cursor/cookbook. As one markdown file: README.md.

Cursor Cookbook

This repo contains small examples for building with Cursor.

Cursor Hooks

Cursor Hooks let you run custom checks and workflows around agent events such as prompt submission, shell commands, file edits, and agent completion.

Hooks examples

A guided project hook setup for audit logging, sensitive prompt guards, and follow-up checks that keep Cursor skills aligned with code changes.

Cloud Agents

Self-hosted Cloud Agents lab

Run Cursor Cloud Agent workers on customer-managed AWS infrastructure with examples for EC2 + Docker and ECS/Fargate.

Cursor SDK

The Cursor SDK is the TypeScript API for running Cursor's coding agent from your own apps, scripts, and workflows. It supports the same agent across local workspaces and cloud runtimes, streams agent events as runs progress, and lets you manage prompts, models, cancellation, artifacts, and conversation state from code.

To run the SDK examples, create a Cursor API key from the Cursor integrations dashboard, then set it as CURSOR_API_KEY.

Quickstart

A minimal Node.js example that creates a local agent, sends one prompt, and streams the response.

Prototyping tool

A web app for spinning up agents to scaffold new projects and iterate on ideas in a sandboxed cloud environment.

Kanban board

A kanban board for viewing Cursor Cloud Agents, grouping them by status or repository, previewing artifacts, and creating new cloud agents from a repository and prompt.

Coding agent CLI

A minimal command-line interface that lets you spawn Cursor agents from your terminal.

DAG task runner

Decompose a task into a JSON DAG, fan it out across local subagents, and stream live status into a Cursor Canvas that hot-reloads on every state change. Ships as both a runnable example and a copyable Cursor skill at .cursor/skills/dag-task-runner.

Perl bridge adapter

A miniature Cursor SDK in Perl on the open sdk.v1 bridge. Shows how to spawn cursor-sdk-bridge, speak Connect JSON, and run one local agent turn without a first-party SDK.

Learn more in the Cursor SDK TypeScript docs and the SDK Bridge docs.

xAI API

Grok Coding Agent CLI

An educational Python coding-agent loop that uses an xAI Console API key, defaults to grok-4.6, and provides workspace-scoped file and shell tools.

Grok Voice Patient Intake

A LiveKit voice agent that uses xAI's native realtime speech-to-speech model for a fictional family-medicine intake and appointment workflow.

cookbook (cursor/cookbook)

Searching Database…

这是什么?这是一组小型独立示例,用于在 Cursor 的智能体平台上进行开发,涵盖 Cursor Hooks、自托管的 Cloud Agents、Cursor SDK、一个编码智能体 CLI,甚至还有与 xAI 的 Grok 的第三方集成。
这是一个应用,还是一堆相互独立的示例?它是一本示例手册(cookbook):每个文件夹都是一个独立、自包含的示例(一个 CLI、一个 Web 应用、一个 SDK 脚本或一份 hook 配置),而不是一个统一的应用。
怎么运行 Cursor SDK 示例?在 Cursor 集成面板中创建一个 Cursor API 密钥,把它设置为 CURSORAPIKEY,然后运行一个示例,比如 Node.js 快速入门,它会创建一个本地智能体、发送提示词并以流式方式返回响应。
运行 Grok 示例需要 xAI API 密钥吗?需要。Grok Coding Agent CLI 使用 xAI Console 的 API 密钥,默认模型为 grok-4.6;语音录入示例还依赖 xAI 的实时语音模型以及 LiveKit。
有没有一套设置能覆盖整个仓库?没有单一的安装步骤:每个示例(hooks、SDK、CLI、Perl bridge、云端智能体)都有自己的运行环境和凭据,你只需配置想尝试的那一部分。
这本示例集是写给谁的?适合想把 Cursor 的编码智能体扩展或嵌入到自己应用、CLI、云基础设施或非 TypeScript 技术栈中的开发者。
Cursor Hooks 示例展示了什么?它们演示了审计日志、敏感提示词防护和后续检查,这些功能会在提示词提交、文件编辑等智能体事件前后运行,让 Cursor skills 与代码变更保持同步。
DAG 任务运行器示例是做什么的?它把一个任务分解成 JSON DAG,分发到多个本地子智能体并行执行,并把实时状态以流的方式推送到一个 Cursor Canvas,后者在每次状态变化时都会热更新;它还以可复制的 Cursor skill 形式提供。
Perl bridge 适配器是干什么用的?它展示如何用 Perl 驱动一轮本地 Cursor 智能体对话,方式是通过 cursor-sdk-bridge 使用开放的 sdk.v1 Connect JSON 协议进行通信,不需要任何官方 Perl SDK。
为什么 Cursor 示例集里会有 xAI Grok 的示例?它把一个极简的 grok-4.6 编码智能体 CLI 与一个 LiveKit 语音智能体结合在一起,使用 xAI 的实时语音对语音模型实现一个虚构的患者接诊流程,展示同样的智能体模式如何扩展到其他模型提供商。
Creator
cursor
Size
3.3 MB
Stars
4.1K
Updated
CommitSep 02
Age
5mo
Commits · 90 Days