Sourcegraph extensions are written in TypeScript and are distributed as bundled JavaScript files that run on the client. Let’s install the software required.
Install Node.js for building and packaging your extension.
To publish your extension, you need a Sourcegraph.com account. Sourcegraph Enterprise supports a private extension registry.
Then install the Sourcegraph CLI (src
), making sure you configure src
with an access token.
Sourcegraph extensions allow you to extend code hosts like GitHub in the same way that editor extensions allow you to extend editors. This is possible because of the Sourcegraph browser extension.
Install Sourcegraph for Chrome or Sourcegraph for Firefox.
As extensions are currently in alpha, they are behind a feature flag which you need to manually enable in the browser extension.
Do this by clicking on the Sourcegraph icon to the right of the address bar, then tick the Use Sourcegraph extensions checkbox.