Skip to content

Conversation

@toolmantim
Copy link
Collaborator

@toolmantim toolmantim commented Jun 13, 2024

Updates the Hello World provider with an example of how to do mentions, and adds a simple JSON API example too

Fixes https://linear.app/sourcegraph/issue/CODY-2438/update-the-examples-on-openctxorg-to-show-mentions

toolmantim and others added 5 commits June 13, 2024 20:31
Co-authored-by: Kosta Ilinov <konstantin.ilyinov@gmail.com>
Co-authored-by: Kosta Ilinov <konstantin.ilyinov@gmail.com>
Co-authored-by: Kosta Ilinov <konstantin.ilyinov@gmail.com>
@toolmantim toolmantim requested review from a team and kilyinov June 13, 2024 10:39
@toolmantim
Copy link
Collaborator Author

Ah, will update tests…

Copy link
Member

@keegancsmith keegancsmith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

1. `pnpm install`
1. `pnpm -C provider/hello-world bundle --watch` to automatically recompile on changes
1. Run `echo file://$(pwd)/provider/hello-world/dist/bundle.js` and use that URL in your OpenCtx instead of `"https://openctx.org/npm/@openctx/provider-hello-world"`
1. Reload your OpenCtx client
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we mention testing with the cli as well?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah that's a good idea, will do. It's pretty hard to develop a provider without the cli tbh

@PriNova
Copy link

PriNova commented Jun 20, 2024

I would love to see a working example for a provider implemented as a standalone vs code extension (or similar) communicating with Cody over http.
I wrote a vs code extension where I implemented a http server over localhost:1234 as endpoint and used that in the Cody settings as OpenCTX provider.
Then I implemented the server.on('request', ...) function and as response the custom implemented Provider from the @openctx/provider npm (similar to your example above). In Cody the handshake works, but Cody does not show this custom provider. Badly, all other providers disappear (except 'Repository' and 'Current File')

Thank you.

@toolmantim toolmantim closed this May 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants