Installation & versioning
Binary downloads are available on the releases tab, and through Sourcegraph.com. If the latest version does not work for you, consider using the version compatible with your Sourcegraph instance instead.
Installation: Mac OS
Latest version
curl -L https://sourcegraph.com/.api/src-cli/src_darwin_amd64 -o /usr/local/bin/src chmod +x /usr/local/bin/srcBASH
or with Homebrew:
brew install sourcegraph/src-cli/src-cliBASH
or with npm:
npm install -g @sourcegraph/srcBASH
Version compatible with your Sourcegraph instance
Replace sourcegraph.example.com
with your Sourcegraph instance URL:
curl -L https://sourcegraph.example.com/.api/src-cli/src_darwin_amd64 -o /usr/local/bin/src chmod +x /usr/local/bin/srcBASH
or, if you know the specific version to target, for example 5.8.1579
:
brew install sourcegraph/src-cli/[email protected]BASH
or with npm/npx:
npx @sourcegraph/[email protected] versionBASH
Note: Versioned formulas are available on Homebrew for Sourcegraph versions 3.43.2 and later.
Installation: Linux
Latest version
curl -L https://sourcegraph.com/.api/src-cli/src_linux_amd64 -o /usr/local/bin/src chmod +x /usr/local/bin/srcBASH
or with npm:
npm install -g @sourcegraph/srcBASH
Version compatible with your Sourcegraph instance
Replace sourcegraph.example.com
with your Sourcegraph instance URL:
curl -L https://sourcegraph.example.com/.api/src-cli/src_linux_amd64 -o /usr/local/bin/src chmod +x /usr/local/bin/srcBASH
or, with npm/npx, if you know the specific version to target, for example 5.8.1579
:
npx @sourcegraph/[email protected] versionBASH
Installation: Windows
See Sourcegraph CLI for Windows.
Installation: Docker
sourcegraph/src-cli
is published to Docker Hub. You can use the latest
tag or a specific version such as 5.8.1579
. To see all versions view sourcegraph/src-cli tags.
docker run --rm=true sourcegraph/src-cli:latest search 'hello world'BASH