Sourcegraph docs Sourcegraph docs

Sections

  • Home
  • Getting started
  • Tutorials
  • Code search
    • Tutorials
    • How-to guides
    • Explanations
    • Reference
  • Code navigation
    • How-to guides
    • Explanations
    • Reference
  • Batch Changes
    • Quickstart
    • Explanations
    • Tutorials
    • How-to guides
    • References
  • Code Insights
    • Quickstart
    • Explanations
    • How-to guides
    • References
  • Notebooks
    • Quickstart
  • Code monitoring
    • Quickstart
    • Explanations
    • How-to guides
  • Integrations
    • Browser extension
    • Editors
    • Browser search engine
  • CLI
    • Quickstart
    • Explanations
    • How-to guides
    • References
  • Cloud
  • Administration
    • Deploy
    • Upgrade
    • Configuration
    • Code hosts
    • User authentication
    • Access control
    • Repository permissions
    • Observability
    • Analytics
    • Executors
    • FAQ
    • Troubleshooting
    • How-to guides
    • Enterprise getting started guide
    • Pricing
  • Development
    • Setup
    • How-to guides
    • Background information
    • Contributing
  • Dotcom
  • App (experimental)
  • Cody (experimental)
  • Own (experimental)

  • ★ Search query syntax
  • ★ Sourcegraph API
  • ★ Changelog

External

  • About Sourcegraph
  • Sourcegraph.com

CLI

On this page:

  • Getting started
  • Explanations
  • How-tos
  • References
Edit this page
Home / cli

CLI

Interact with Sourcegraph from the command line

src is a command line interface to Sourcegraph that allows you to search code from your terminal, create and apply batch changes, and manage and administrate repositories, users, and more.

★ Quickstart

Getting started

New to src?
Run through the quickstart guide and set up src in minutes.
Command reference
Check the commands available in src and their flags.
Create a batch change
src is the gateway to Sourcegraph's batch change functionality: find out how to create a batch change with it in less than 10 minutes.

Explanations

  • Environment variables
  • Windows support

How-tos

  • Creating an access token
  • Use 1Password to securely authenticate the Sourcegraph CLI

References

  • Command reference
  • About Sourcegraph
  • Sourcegraph.com
  • Code (GitHub)
  • Terms
  • Security
  • Privacy