⚠️You're viewing our legacy docs, which we no longer maintain. For all the new updates, read our Latest Docs »

⚠️You're viewing our dev docs, which are in the process of being migrated. Last sync done on April 16th, for up to date content please read them fromhere   for the time being.

Sourcegraph docs Sourcegraph docs Sourcegraph Docs

Sections

  • Getting Started
  • Tutorials

Cody

  • Overview
    • Cody for VS Code
    • Cody for JetBrains
    • Cody for Neovim
    • Cody for Web
    • Cody Enterprise
    • Feature Parity Reference
  • Quickstart
  • Capabilities
    • Chat
    • Autocomplete
    • Commands
    • Debug Code
  • Core Concepts
  • Cody Use Cases
    • Generate Unit Tests
  • Usage and Pricing
  • Troubleshooting
  • FAQ

Code Search

  • Overview
  • Tutorials
  • How-to guides
  • Explanations
  • Reference

Code navigation

  • Overview
  • How-to guides
  • Explanations
  • Reference

Batch Changes

  • Overview
  • Quickstart
  • Explanations
  • Tutorials
  • How-to guides
  • References

Code Insights

  • Overview
  • Quickstart
  • Explanations
  • How-to guides
  • References

Notebooks

  • Overview
  • Quickstart

Code monitoring

  • Overview
  • Quickstart
  • Explanations
  • How-to guides

Integrations

  • Overview
  • Browser extension
  • Editors
  • Browser search engine

CLI

  • Overview
  • Quickstart
  • Explanations
  • How-to guides
  • References

Administration

  • Overview
  • Deploy
  • Upgrade
  • Configuration
  • Licensing
  • Code hosts
  • User authentication
  • Access control
  • Repository permissions
  • Observability
  • Analytics
  • Executors
  • FAQ
  • Troubleshooting
  • How-to guides
  • Enterprise getting started guide
  • Pricing

Development

  • Overview
    • Setup
  • How-to guides
  • Contributing

Code Ownership

  • Overview
  • The CODEOWNERS format
  • CODEOWNERS ingestion
  • Configuration reference
  • Assigned ownership

  • Cloud
  • Dotcom
  • ★ Search query syntax
  • ★ Sourcegraph API
  • ★ SLAs and Premium Support
  • ★ Changelog

External

  • Sourcegraph.com
Theme

On this page

  • Getting started
  • Explanations
  • How-tos
  • References
Edit this page on GitHub
Docs 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
  • Revoking an access token
  • Use 1Password to securely authenticate the Sourcegraph CLI

References

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