import { Agent } from "@cursor/sdk"; const agent = await Agent.create({ apiKey: process.env.CURSOR_API_KEY!, model: { id: "composer-2" }, local: { cwd: process.cwd() }, }); const run = await agent.send("Summarize what this repository does"); for await (const event of run.stream()) { console.log(event); }
Build programmatic agents with the Cursor SDK · Cursor
Launch, steer, and compose custom agents with the Cursor SDK.
https://cursor.com/blog/typescript-sdk


Seonglae Cho