This repository has been archived by the owner. It is now read-only.
srclib is a polyglot code analysis library, built for hackability. It consists of language analysis toolchains (currently for Go and Java, with Python, JavaScript, and Ruby in beta) with a common output format, and a CLI tool for running the analysis.
Failed to load latest commit information.
ann add more informative error descriptions Jun 23, 2016
buildstore replace with… Jul 8, 2016
cli replace with… Jul 8, 2016
cmd/srclib report error value on failure May 30, 2016
config replace with… Jul 8, 2016
contrib/completion contrib: add zsh completion; update invocation Mar 16, 2016
cvg Coverage stats improvements Apr 27, 2016
dep simplify source unit data structures May 25, 2016
docs fixing srclib sourcegraph link on homepage Mar 17, 2016
flagutil Updated Oct 22, 2015
gendata replace with… Jul 8, 2016
graph Improved coverage calculation & URL without pass May 12, 2016
grapher offsets emitted by both srclib-bash and srclib-man are in bytes Jun 14, 2016
plan simplify source unit data structures May 25, 2016
scan replace with… Jul 8, 2016
store replace with… Jul 8, 2016
toolchain improve error messages involving toolchain executables May 26, 2016
unit log instead of warn again Jun 30, 2016
util remove unused May 12, 2016
vendor replace with… Jul 8, 2016
.dockerignore src Dockerfile Jul 30, 2014
.gitignore Using govendor Mar 29, 2016
.goxc.json fix goxc config file bug Feb 2, 2016
.travis.yml CSS toolchain support and Python toolchain fixes May 26, 2016 remove mention of IRC channel for now, as it's not actively used Jan 1, 2015
DCO initial commit from template Jul 19, 2014
LICENSE various performance improvements Jan 27, 2015
Makefile `make test` target May 25, 2016
NOTICE initial commit from template Jul 19, 2014 README: Fix typo in goxc import path. (#304) Aug 30, 2016 remove remnants of remote build data support Aug 2, 2015 add TODO notes file Jan 6, 2016
env.go Fix srclib installation directory Oct 12, 2015
src-make-build-process.svg add diagram of src make Jul 28, 2014
toolref.go move util package and ToolRef to reduce dependencies on go-dockerclie… Dec 15, 2014

srclib Build Status

Note: srclib is alpha. Post an issue if you have any questions or difficulties running and hacking on it.

srclib is a source code analysis library. It provides standardized tools, interfaces and data formats for generating, representing and querying information about source code in software projects.

Why? Right now, most people write code in editors that don't give them as much programming assistance as is possible. That's because creating an editor plugin and language analyzer for your favorite language and editor combo is a lot of work. And when you're done, your plugin only supports a single language and editor, and maybe only half the features you wanted (such as doc lookups and "find usages"). Because there are no standard cross-language and cross-editor APIs and formats, it is difficult to reuse your plugin for other languages or editors.

We call this the M-by-N problem: given M editors and N languages, we need to write (on the order of) M×N plugins to get good tooling in every case. That number gets large quickly, and it's why we suffer from poor developer tools.

srclib solves this problem in 2 ways by:

  • Publishing standard formats and APIs for source analyzers and editor plugins to use. This means that improvements in a srclib language analyzer benefit users in any editor, and improvements in a srclib editor plugin benefit everyone who uses that editor on any language.

  • Providing high-quality language analyzers that implement this standard. These power

Step 1 is to build the language analyzers. Next up, we will build the editor plugins!

See for more information.

Currently, srclib supports:

  • Languages: Go, JavaScript, and Ruby (coming very soon: Python, Java, and Bash)

  • Features: jump-to-definition, find usages, type inference, documentation generation, and dependency resolution

Want to extend srclib to support more languages, features, or editors? We'll help! Post an issue to let us know what you're building to get started.


See Getting started for installation instructions.


  • bash completion for srclib: run source contrib/completion/srclib-completion.bash or copy that file to /etc/bash_completion.d/srclib (path may be different on your system)


srclib binary release process

Contributors with deploy privileges can update the official binaries via these instructions:

  1. go get -u
  2. Ensure you have the AWS credentials set so that the AWS CLI (aws) can write to the srclib-release S3 bucket.
  3. Run make release V=1.2.3, where 1.2.3 is the version you want to release (which can be arbitrarily chosen but should be the next sequential git release tag for official releases).


srclib is licensed under the MIT License. More information in the LICENSE file.


If you want to start hacking on srclib or write your own srclib toolchain, join the srclib Slack and then access it on Don't forget to introduce yourself on the #General channel. We are more than happy to meet new contributors and to help people to get started.