{"id":35041667,"url":"https://github.com/brooswit/node-cursor-agent","last_synced_at":"2026-05-20T17:36:33.559Z","repository":{"id":309089146,"uuid":"1034177185","full_name":"brooswit/node-cursor-agent","owner":"brooswit","description":null,"archived":false,"fork":false,"pushed_at":"2025-08-09T18:07:02.000Z","size":16,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-09T20:23:25.955Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/brooswit.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-08-08T01:25:11.000Z","updated_at":"2025-08-09T18:07:06.000Z","dependencies_parsed_at":"2025-08-09T20:23:38.874Z","dependency_job_id":"59c57886-e13d-4ff8-8fbc-a16246bd113c","html_url":"https://github.com/brooswit/node-cursor-agent","commit_stats":null,"previous_names":["brooswit/node-cursor-agent"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/brooswit/node-cursor-agent","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brooswit%2Fnode-cursor-agent","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brooswit%2Fnode-cursor-agent/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brooswit%2Fnode-cursor-agent/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brooswit%2Fnode-cursor-agent/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/brooswit","download_url":"https://codeload.github.com/brooswit/node-cursor-agent/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brooswit%2Fnode-cursor-agent/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33269230,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-20T15:12:43.734Z","status":"ssl_error","status_checked_at":"2026-05-20T15:12:42.300Z","response_time":356,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-12-27T08:19:00.484Z","updated_at":"2026-05-20T17:36:33.554Z","avatar_url":"https://github.com/brooswit.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## node-cursor-agent\n\nTypeScript SDK wrapper for the `cursor-agent` CLI with two modes:\n\n1. **Non-interactive mode**: Simple text-based prompts via `--print`\n2. **Interactive session mode**: Full PTY sessions supporting resume, conversation history, and real-time interaction\n\n### Install\n\n```bash\nbun install node-cursor-agent\n```\n\n### Prerequisites\n\nYou must be logged in to cursor-agent:\n\n```bash\ncursor-agent login\n```\n\n### Usage\n\n**Simple non-interactive prompts:**\n\n```ts\nimport { prompt, getVersion } from 'node-cursor-agent';\n\nconst response = await prompt('Return exactly: PONG');\nconsole.log(response); // \"PONG\"\n\nconst version = await getVersion();\n```\n\n**Interactive sessions:**\n\n```ts\nimport { CursorAgentSession } from 'node-cursor-agent';\n\n// Start new session\nconst session = await CursorAgentSession.start();\nsession.on('data', (chunk) =\u003e process.stdout.write(chunk));\n\nconst reply = await session.send('Return exactly: PONG');\nconsole.log('Reply:', reply);\n\nsession.close();\n```\n\n### API\n\n**Non-interactive:**\n- `prompt(text, options?)` - Send prompt and get text response\n- `getVersion()` - Get cursor-agent version\n\n**Interactive sessions:**\n- `CursorAgentSession.start(options?)` - Start new session\n\n**Session methods:**\n- `.send(prompt)` - Send message and wait for response\n- `.waitUntilDone(inactivityMs?)` - Wait for current generation to finish\n- `.on('data', callback)` - Stream raw TUI output\n- `.close()` - Exit session and clean up resources\n\n### Options\n\n- `model?: string` - AI model to use (e.g., 'gpt-5', 'sonnet-4')\n- `path?: string` - Directory to run in\n\n### Tests\n\nTests are under `specs/` and use `bun test`.\n\n```bash\nbun test\n```\n\n### REST API server (Bun)\n\nYou can run a minimal REST API to expose `cursor-agent` via HTTP.\n\nEndpoints:\n\n- `GET /health` → `ok`\n- `GET /version` → `{ version }`\n- `POST /prompt` → `{ output }` with JSON body `{ \"text\": string, \"model?\": string, \"path?\": string }`\n\nRun in dev:\n\n```bash\nbun run ./src/server.ts\n```\n\nBuild and start:\n\n```bash\nbun run build\nbun run start:server\n```\n\nExample request:\n\n```bash\ncurl -s http://localhost:3000/health\ncurl -s http://localhost:3000/version\ncurl -s -X POST http://localhost:3000/prompt \\\n  -H 'content-type: application/json' \\\n  -d '{\"text\":\"Return exactly: PONG\"}'\n```\n\n### Notes\n\n- Requires `cursor-agent` installed and available on PATH.\n- This SDK intentionally avoids interactive features (e.g., `--fullscreen`, `resume`, TUI). Use `--print` non-interactive modes only.\n  - Exception: optional PTY-based `ls` wrappers which simulate a TTY and parse visible text. Enable TUI tests with `RUN_TUI_TESTS=1`.\n\n### License\n\nMIT","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrooswit%2Fnode-cursor-agent","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrooswit%2Fnode-cursor-agent","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrooswit%2Fnode-cursor-agent/lists"}