Sourcegraph extensions lets you add features and show new kinds of information alongside your code on Sourcegraph.com, GitHub, and other code hosts.
This guide shows you how to create a simple Sourcegraph extension that:
Follow the instructions for setting up your development environment so you can build and publish the extension.
Use the Sourcegraph extension creator to get started:
mkdir hello-world-extension cd hello-world-extension npm init sourcegraph-extension
Follow the prompts and once complete, view the code for the extension in the src
directory. That's all it takes to create a simple extension!
Now let's publish it so you (and other people) can use it.
Publish the extension by running:
src ext publish
Now that the extension is published let's use it.
Open the URL found in the output from the publish command. This is the extension's listing page on the Sourcegraph.com extension registry. Anyone can visit this page to see more information about the extension and to enable it.
Toggle the slider to enable the extension for your account. Now you can:
You've created your first Sourcegraph extension!
Now check out the Sourcegraph extensions authoring documentation to see how to build more powerful extensions.