# Sourcegraph for Raycast

URL: https://www.raycast.com/bobheadxi/sourcegraph

> Search code on Sourcegraph instances and public repositories, ask Deep Search in natural language and manage Batch Changes.

- Install: raycast://extensions/bobheadxi/sourcegraph
- Author: [Robert Lin](https://www.raycast.com/bobheadxi)
- Installs: 2,805
- Platforms: macOS
- Categories: Developer Tools, Productivity, Documentation, Web
- Updated: 2026-11-18
- Source: https://github.com/raycast/extensions/tree/eb711e05870440e012d06bfeb43fea8c0319b9c4/extensions/sourcegraph/

## Commands

- **Ask Deep Search**: Agentic, natural language code search.
- **Deep Search Conversations**: List and manage Deep Search conversations.
- **Search Code**: Search code on a Sourcegraph instance or workspace.
- **Code Search History**: Browse and launch recent code searches.
- **Search Public Code**: Search public repositories on Sourcegraph.com
- **Search Public Code History**: Browse and launch recent code searches.

## README

<br />

<p align="center">
  <img src="https://github.com/bobheadxi/raycast-sourcegraph/blob/main/assets/command-icon.png?raw=true" alt="sourcegraph" width="52px" />
</p>

<h1 align="center">
  Sourcegraph for Raycast
</h1>

<p align="center">
  Deep Search, Code Search, and Batch Changes on <a href="https://about.sourcegraph.com">Sourcegraph</a> with <a href="https://www.raycast.com">Raycast</a>.
</p>

<p align="center">
  <a href="#install"><strong>Install</strong></a> · 
  <a href="#setup"><strong>Setup</strong></a> · 
  <a href="#commands"><strong>Commands</strong></a> · 
  <a href="https://github.com/bobheadxi/raycast-sourcegraph/issues"><strong>Issues</strong></a> · 
  <a href="#changelog"><strong>Changelog</strong></a> · 
  <a href="#contributing"><strong>Contributing</strong></a>
</p>

![deepsearch demo](https://github.com/raycast/extensions/raw/eb711e05870440e012d06bfeb43fea8c0319b9c4/extensions/sourcegraph//metadata/0-deepsearch.png)

<br />

#### Install

To get started, [install Raycast](https://www.raycast.com/) and [install the Sourcegraph extension from the Raycast extensions store](https://www.raycast.com/bobheadxi/sourcegraph).

<a id="install-extension-button" title="Install Sourcegraph Raycast Extension" href="https://www.raycast.com/bobheadxi/sourcegraph#install">
  <img style="height: 64px" src="https://assets.raycast.com/bobheadxi/sourcegraph/install_button@2x.png" height="64"/>
</a>

Alternatively, you can [install this extension from source](https://github.com/bobheadxi/raycast-sourcegraph/blob/main/CONTRIBUTING.md).

<br />

#### Setup

This extension adds a [variety of commands](#commands) for interacting with [Sourcegraph](https://about.sourcegraph.com).
Some configuration is required to use certain features, most notably the [variants of each command for custom Sourcegraph Instances](#sourcegraph-instance-or-workspace), though you can get started with [Sourcegraph.com commands](#sourcegraphcom) without any additional setup.

##### Sourcegraph instance or workspace

To start searching code on your own Sourcegraph instance or workspace:

- [Sourcegraph workspace](https://workspaces.sourcegraph.com/)
- [Sourcegraph Cloud](https://sourcegraph.com/docs/cloud)
- [Self-Hosted Sourcegraph](https://sourcegraph.com/docs/admin/deploy)

You can set up access through the 'Sourcegraph' variants of this extensions's commands by configuring the "Sourcegraph: URL" in the Sourcegraph Raycast extension preferences, as well as one of the following:

- **Access token**: You can create an access token (`sgp_...`) under the "Access tokens" tab in your user settings in Sourcegraph, and set it in the "Sourcegraph Instance: Access token" field in the extension preferences.
  - For example, you can configure `example.sourcegraph.app` as a URL and go to `https://example.sourcegraph.app/user/settings/tokens/new` to create an access token for use in this extension.
- **OAuth**: If your Sourcegraph version supports it (any version newer than v6.10.0), you can authenticate via OAuth without additional configuration by omitting the "Sourcegraph Instance: Access token" field in the extension preferences.

##### Sourcegraph.com

No setup is required to connect to [Sourcegraph.com](https://sourcegraph.com/search) through the 'Sourcegraph.com' variants of this extensions's commands.
To configure your own [search contexts](#search-contexts), [sign up for a Sourcegraph.com account](https://sourcegraph.com/sign-up)!

Once you have an account, you can create an access token under the ["Access tokens" tab in your user settings on Sourcegraph.com](https://sourcegraph.com/user/settings/tokens/new).
Copy that access token to the "Sourcegraph.com: Access token" field in the Sourcegraph Raycast extension preferences to authenticate your search queries.

To search your private code, please reach out [get a demo of the single-tenant solution](https://sourcegraph.com/contact/request-info) or [try out a self-hosted installation of Sourcegraph](https://about.sourcegraph.com/get-started/self-hosted).

<br />

#### Commands

##### Search Code

![search demo](https://github.com/raycast/extensions/raw/eb711e05870440e012d06bfeb43fea8c0319b9c4/extensions/sourcegraph//metadata/1-search.png)

Get results as you type on [code search](https://about.sourcegraph.com/code-search) over your code and many public repositories.

###### Search contexts

[Search contexts](https://sourcegraph.com/docs/code-search/features#search-contexts) allow you to narrow down your search to code you care about.

The Sourcegraph Raycast extension allows you to set a default context for your searches in the "Search Code" command preferences.

##### Code Search History

Browse, manage, and run recent [code searches](#search-code). New searches can also easily be launched from the Code Search History command.

Recent searches are persisted [locally through a native Raycast API](https://developers.raycast.com/api-reference/storage).

![search history demo](https://github.com/raycast/extensions/raw/eb711e05870440e012d06bfeb43fea8c0319b9c4/extensions/sourcegraph//metadata/2a-search-history.png)

##### Ask Deep Search

![deepsearch demo](https://github.com/raycast/extensions/raw/eb711e05870440e012d06bfeb43fea8c0319b9c4/extensions/sourcegraph//metadata/0-deepsearch.png)

Get answers to natural language questions about your code with [Deep Search](https://sourcegraph.com/deep-search), Sourcegraph's agentic code search.

##### Deep Search Conversations

Browse, view, and manage your recent [Deep Search](#ask-deep-search) conversations.

##### Manage Batch Changes

Browse, view, publish, and merge changesets for [batch changes](https://about.sourcegraph.com/batch-changes) straight from Raycast.
Batch Changes automate large-scale code changes to keep your code up to date, fix critical security issues, and pay down tech debt across all of your repositories.

> [!NOTE]
> Batch Changes are currently only supported when connected to a [self-hosted Sourcegraph instance](https://sourcegraph.com/docs/admin/deploy)
or [Sourcegraph Cloud instance](https://sourcegraph.com/docs/cloud).
> To use this command, you must also enable it in the Raycast Sourcegraph extension preferences.

![batch changes](https://github.com/raycast/extensions/raw/eb711e05870440e012d06bfeb43fea8c0319b9c4/extensions/sourcegraph//metadata/3-batch-change-manage.png)

<br />

#### Changelog

The [changelog](https://github.com/raycast/extensions/raw/eb711e05870440e012d06bfeb43fea8c0319b9c4/extensions/sourcegraph//CHANGELOG.md) documents all notable updates to the extension.

Updates will be regularly published to the [Raycast Extensions repository](https://github.com/raycast/extensions) from the [`bobheadxi/raycast-sourcegraph` repository](https://github.com/bobheadxi/raycast-sourcegraph).
To try out yet-to-be-published changes, you can [install this extension from source](https://github.com/raycast/extensions/raw/eb711e05870440e012d06bfeb43fea8c0319b9c4/extensions/sourcegraph//CHANGELOG.md).

<br />

#### Contributing

See [CONTRIBUTING.md](https://github.com/raycast/extensions/raw/eb711e05870440e012d06bfeb43fea8c0319b9c4/extensions/sourcegraph//CONTRIBUTING.md) if you're interested in contributing to this extension!

Have ideas or suggestions? Please feel free to [open an issue with feedback](https://github.com/bobheadxi/raycast-sourcegraph/issues)!

<br />
