All apps/Sourcegraph CLI

Sourcegraph CLI

src

src is a command line interface to Sourcegraph: code search, GraphQL API requests and batch changes from the terminal.

Runs as src|macOS, Linux, Windows|github.com

Command form

ai-draft · 1 task · 6 fields

Run a Sourcegraph code search from the terminal. Other src commands and credentials are left out.

Opens the form; the finished command lands at your prompt, unrun
otty gui src

src search

Code search

Run a search query against the configured Sourcegraph instance.

Code searchExample values, fixed in this page — nothing here reaches a terminal
Basic
Query*
string
JSON output
-json
Stream results
-stream
TasksEach one presets the form for one job
Search
queryjsonstream
ParametersOnly these flags are editable in the form
Query
The search query.
string · positional 0
JSON output
Output results as JSON.
boolean
-json
Stream results
Consume results as a stream.
boolean
-stream
Pipe to less
Pipe output to less -R when on a terminal.
boolean
-less
Log trace ID
Log the trace ID for requests.
boolean
-trace
Explain JSON schema
Explain the JSON output schema and exit.
boolean
-explain-json
SourcesEvery flag above is checked against these
fig
completion

github.com

fig
completion

github.com

Before it fills your prompt, Otty checks the installed src against its version. A form that does not match your version is not offered.