Skip to content

sourcegraph-community/sourcegraph-gemini

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sourcegraph

Gemini CLI extension for Sourcegraph — search, navigate, and understand any codebase without leaving your terminal.

What is Sourcegraph?

Sourcegraph is a code intelligence platform that lets you search and navigate across all your repositories at scale. It understands code structure (definitions, references, symbols) and provides powerful search across your entire codebase — including open source and private code.

This extension connects Gemini CLI to your Sourcegraph instance via the official MCP server, giving Gemini's AI direct access to your code.

Installation

Sourcegraph.com users: No installation needed — Sourcegraph's MCP endpoint is already available at your instance.

Enterprise users: Connect to your own instance at sourcegraph.com/enterprise.

To install locally, run:

gemini extensions install https://github.com/erclm/sourcegraph-gemini

Or link a local clone for development:

gemini extensions link .

Then restart Gemini CLI.

Configuration

On install, Gemini CLI will prompt you for:

  • SOURCEGRAPH_ENDPOINT — your Sourcegraph instance URL (e.g. https://sourcegraph.example.com)
  • SOURCEGRAPH_ACCESS_TOKEN — a personal access token from your Sourcegraph account

Sourcegraph MCP is supported on Enterprise plans. If your instance supports OAuth dynamic client registration, you may not need a token.

Features

  • MCP tools (available to the AI automatically):
    • nls_search, keyword_search — natural language and keyword search across repos
    • read_file, list_files, list_repos — explore repositories and files
    • go_to_definition, find_references — code navigation and symbol lookup
  • Slash commands (use directly in your prompt):
    • /sg:search <query> — run a Sourcegraph search
    • /sg:file <repo> [rev] <path> — open a specific file
  • Bundled agent skill: searching-sourcegraph

Example Prompts

Once installed, you can ask Gemini things like:

Understand a codebase fast

"How does authentication work in github.com/my-org/api? Find the login flow and trace it through to token issuance."

Cross-repo impact analysis

"Find all callers of UserService.Delete across my org's repos and tell me which ones don't handle the error."

Onboard to an unfamiliar service

"I'm new to the payments-service repo. Walk me through the main request lifecycle and point me to the key files."

Find real-world usage examples

"Show me examples of how @sourcegraph/codeintellify is used in open source projects."

Audit and security review

"Search for any usage of eval( or exec( in the backend repo and summarize the risk."

About

Gemini-CLI extension for Sourcegraph

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors