Getting started

Install a prebuilt binary

To install the srclib program, download one of the prebuilt binaries or build it from source (see next section).

srclib binary downloads:

After downloading the file, unzip it and place the srclib program in your $PATH. Run srclib --help to verify that it's installed.

Building from source

First, install install Go (version 1.5 or newer).

Then:

go get -u -v sourcegraph.com/sourcegraph/srclib/cmd/srclib


Language Toolchains

To install the language analysis toolchains for (Go, Ruby, JavaScript, and Python), run:

srclib toolchain install go ruby javascript python

If this command fails, please file an issue or skip one of the languages if you don't need it.

srclib toolchain list helps to verify the currently installed language toolchains like the following example

$ srclib toolchain list
sourcegraph.com/sourcegraph/srclib-python
sourcegraph.com/sourcegraph/srclib-go


Testing srclib

In order to test srclib we can use it to analyze the already fetched source code for the Go toolchain srclib-go.

First, you need to initialize the git submodules in the root directory of srclib-go

cd src/sourcegraph.com/sourcegraph/srclib-go
git submodule update --init

Now you can test the srclib-go toolchain with:

srclib config && srclib make

You should have a .srclib-cache directory inside srclib-go that has all of the build data for the repository.