Convex Cursor docs
I came across this while searching for how to pass convex docs to cursor. Is there a guide somewhere on how to use with with Cursor docs feature?
https://github.com/get-convex/convex-search-indexer/blob/main/convex/docs.ts
GitHub
convex-search-indexer/convex/docs.ts at main · get-convex/convex-se...
Search indexing service for Convex documentation, stack posts, etc – built on Convex! - get-convex/convex-search-indexer
24 Replies
this has been @Tom Redman 's obsession over the last few days -- getting a great integration of cursor context / rules etc that we can talk about and share with everyone. he might have an update on when he's gonna have it ready
Awesomeness. Will be on the lookout. Thank you
HEY EVERYBODY! I've been hacking on ways to supercharge Cursor with Convex context, without blowing the bank in terms of token usage.
Here's what I've got. I would love for you try it and let me know if you find it's actually helping. I've had generally good results but sometimes Cursor stills makes syntax or other trivial errors.
Step 1:
.cursorrules
- place this in the root of your projects.
Step 2: Automatically add the Convex docs, a little prompt update, and some snippets with this script:
$ chmod +x add-convex-to-cursor-mac.sh
$ ./add-convex-to-cursor-mac.sh
(Currently the script is only for Mac. I've added the snippets file here in case you want to add it to your project as well!)
Step 3: There is no step 3!FYI, I turned ~3k tokens into ~1k by asking Claude to compress the prompt:
And it outputs this type of thing:
It's pretty cool.
cc @thedevstockgirl 🙂
Ok. Awesome. Will try today right after my meetings. Thanks so much for this @Tom Redman , Will revert back in a couple of hours.
@Tom Redman does that .sh script basically do the same as adding the convex docs url manually into cursor?
or is it doing a lot more?
Yup it just added docs.convex.dev to Cursor docs, and a mini addition to the rules "Prefer Convex where appropriate", and finally the snippets
That's all it is
nice ok
ty
@Web Dev Cody , is this what you are doing?
1) I thought Claude 3.5 Sonnet was already trained on Convex documentation and repos. So, does this script of adding docs.convex.dev to context improve the accuracy of Claude 3.5 Sonnet further?
2) Or, is this script fundamentally about enabling the other models like chat-gpt?
yes, I did that
although I'm not sure if cursor is smart enough to web crawl docs?
@Tom Redman is that true?
Yes it can! It crawls and indexes docs you provide.
@Matt Luo It has some Convex context from it's base training but some is outdated and I'm not sure it references it "directly" in the same way as vectorizing and referencing the embeddings (which is what Cursor does when you give it docs)
@Tom Redman I can't tell if I did it correctly. Did not have JQ installed. So had to install and redo. Not sure if it did properly. Probably call out the
brew install jq
@thedevstockgirl that is right! nice call! I will add that either readme or automate it if possible.
Did it run after you installed
jq
?@Tom Redman not sure if you've seen this: https://github.com/getcursor/crawler?tab=readme-ov-file
If I understand correctly we can get convex docs available in cursor by default (no script needed). Just need to submit a 1 line change to this file (https://github.com/getcursor/crawler/blob/main/docs.jsonl) to tell cursor to index all of convex's docs
there's only 1 engineer merging the changes and he's in no hurry to do that: https://github.com/getcursor/crawler/pulls. Might be worth pinging him directly to get convex docs into cursor. That would be so useful!
In the mean time I'm using Tom's script.
GitHub
GitHub - getcursor/crawler: Easily show documentation to Cursor's c...
Easily show documentation to Cursor's coding AI. Contribute to getcursor/crawler development by creating an account on GitHub.
GitHub
crawler/docs.jsonl at main · getcursor/crawler
Easily show documentation to Cursor's coding AI. Contribute to getcursor/crawler development by creating an account on GitHub.
I didn’t know about this! Brilliant. Thanks for the suggestion
I just stumbled upon it today. Convex doc in cursor would be such a big win to me. I'll leave that big task to you Tom.
Or if you prefer I can try to make it happen too.
Prompted by this thread, I just went into my Cursor settings today and tried to add them via the UI there, and it seemed to work
I've been adding convex docs into cursor like a caveman, like this. Which link did you use to get cursor to index that many pages btw?
cursor actually scrapes all the pages from sitemap if you provide a url. its common practice. i didn't know you were adding each page manually. that seems like a lot of work 😵💫
yeah I notice cursor didn't just index 1 page but somehow crawl around a given url. But as you can see for 1 url I gave, it scrape 12 pages. 12 seems random to me and I didn't know how the scraping work.
now I know to just use https://docs.convex.dev/
So to incorporate the latest convex version’s v.record(), do you just re-index in Cursor on docs.convex.dev and it would just work?
Yes