๊ฐ€์ž… ํ›„ ์ดˆ๋Œ€ ๋งํฌ๋ฅผ ๊ณต์œ ํ•˜๋ฉด ๋™์˜์ƒ ์žฌ์ƒ ๋ฐ ์ดˆ๋Œ€ ๋ณด์ƒ์„ ๋ฐ›์„ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

cv usk
@cv_usk
AI / Software Research Notes AI Agent, LLMOps, MLOps, Software Architecture ๆŠ•็จฟใฏๅ€‹ไบบใฎๆ„่ฆ‹ใงใ™ใ€‚
๊ฐ€์ž… May 2026
286 ํŒ”๋กœ์ž‰ ์ค‘    470 ํŒฌ
# Cursor Features and Practical Usage ๐Ÿงฉ What if you could call Cursor's AI agent from inside your own scripts and CI checks? The `@cursor/sdk` package grants that wish with a scriptable TypeScript interface to the agent. ๐Ÿท๏ธ Title: @cursor/sdk (TypeScript) ๐Ÿ”— URL: ๐Ÿ“˜ Overview `@cursor/sdk` exposes the same Cursor agent that powers the IDE, CLI, and web app as a scriptable TypeScript interface. It's built for CI automation, embedded products, and orchestrating custom workflows. It's Node-first, and local agent code loads lazily so cloud-only consumers don't pay the startup cost. โš™๏ธ How It Works The core concepts are Agent (a stateful container holding conversation context and workspace config), Run (a single prompt submission with its own stream, status, and result), and SDKMessage (normalized stream events emitted during a run). ใƒป`Agent.create()`: validates options and returns a handle immediately; you send prompts via `agent.send()`. ใƒปlocal / cloud keys: choose where execution happens. `local` runs the agent loop inline in your Node process, while `cloud` runs it in a Cursor-hosted isolated VM with the repo cloned in (a self-hosted VM pool is also supported). ใƒป"Local" only describes where the agent loop runs; model inference goes through Cursor's backend in both modes. ใƒป`local.customTools` lets you expose your own functions as tools (local only). `Agent.prompt()` is a one-shot shortcut. ๐Ÿ› ๏ธ Practical Usage Install with the exact, scoped package name via `npm install @cursor/sdk`. For a CI check against your local working tree, call `Agent.create()` with your `apiKey`, a `model` id, and a `local` cwd, then `agent.send()` a prompt, `await run.wait()`, and check `result.status === "finished"`. To run in the cloud, use the `cloud` key and set `autoCreatePR: true` to open a PR on finish. Authenticate via the `CURSOR_API_KEY` env var or an explicit `apiKey`, using either a user key or a service account key. ๐Ÿ’ก Use Cases Run `Agent.prompt()` in PR CI to automate a security audit; use the `cloud` key to spin up many parallel agents that open PRs on separate branches for a large refactor; or wire an internal deployment-check API into the agent via `local.customTools` to embed it in your own workflow. โš ๏ธ Caveats In local mode, the agent runs shell commands and file edits without approval unless you configure sandboxing or hooks, so consider `local.sandboxOptions: { enabled: true }` in CI. There is no Python SDK; for other languages use the SDK Bridge, or call the Cloud Agents REST API directly. `Agent.resume()` drops inline `mcpServers`, so re-pass them, and model IDs can change, so confirm via `Cursor.models.list()`. #Cursor# #SDK#
๋” ๋ณด๊ธฐ