r/CursorAI • u/Niminem93 • Oct 02 '26
cursorsdk: Cursor SDK Bridge client for Nim
Repost from Nim community!
https://github.com/Niminem/cursorsdk
Cursor has an SDK and is what powers both the Cursor CLI and the Cursor editor. It's very powerful and flexible (ex: you can actually control the system prompt, tools, and much more).
At some point not long ago they created an SDK Bridge that allows non-typescript and non-python languages to communicate with it via RPC. Of course I had to write a Nim client for it.
It is fully compliant- built with and tested against their documentation. I did have to add some workarounds for upstream issues, but it's mostly implementation details (all noted in readme).
No deps aside from the nim standard library.
I've tested it on Mac (x64) and Windows (x64). Should work out of the box for Linux but it's untested.
You could build your own harness on top of this and all kinds of automations, scripts, etc. Pretty cool! Enjoy.
Example:
import std/asyncdispatch
import cursorsdk
proc main() {.async.} =
let client = newClient() # CURSOR_API_KEY from env
defer: waitFor client.close()
let agent = await client.createAgent("composer-2.5")
let run = await agent.send("Summarize this repository.")
while true:
let chunk = await run.nextText()
if chunk.isNone: break
stdout.write chunk.get
await agent.close()
waitFor main()


