Sourcegraph Powers Up Your Code Repository
Written by Nikos Vaggalis   
Wednesday, 17 October 2018

Sourcegraph is a code navigation engine that non-destructively rearranges your repository's structure to organize it, as well as powering it up with code intelligence and advanced search capabilities.

Best of all Sourcegraph has just gone open source which means that you can deploy it on your own servers to power up your private repositories.

With Docker already set up, deployment is as easy as :

docker run
--publish 7080:7080 --rm
--volume ~/.sourcegraph/config:/etc/sourcegraph
--volume ~/.sourcegraph/data:/var/opt/sourcegraph
--volume /var/run/docker.sock:/var/run/docker.sock sourcegraph/server:2.11.2

making Sourcegraph accessible by default at http://localhost:7080

The next step is to configure it to point at your repositories. IOn addition to Github, Sourcegraph supports repositories from other popular code hosts such as Gitlab, Bitbucket, AWS CodeCommit or even those already cloned to disk.

As for repositories available on the public web, powering them up doesn't require much more than having to install the Sourcegraph bookmarklet/browser plugin available for Chrome and Firefox, which when clicked transforms the UI in a snap. Alternatively, you can get the same functionality by appending your repo's path to, for example turning


The magic here is that either by the bookmarklet or by the special Sourcegraph url, the scheme works for all repo's big and small, even for my own little personal one:

Code intelligence
Just like Android Studio, say, you can find the definitions, implementations and references to functions, hover tooltips that reveal documentation and type signatures, and search by symbol, an action that brings up a left-side menu alike JetBrains Dotpeek's de-obfuscator bearing all classes, interfaces, methods and such comprising the entire application.Code intelligence is however enabled only for the languages supported which are :
Go, Javascript, Typescript, Python, Java, PHP, Swift and experimentally Bash, Clojure, C++, C#, CSS, Dockerfile, Elixir, HTML, Lua, OCaml, R, Ruby, and Rust.

Repos in languages not supported

can still take advantage of the code organizing, symbols tab, and the advanced Code search capabilities, which include:

  • type:diff to check how your codebase has changed over time

  • type:commit to search in commit messages as in looking for a commit with the keyword "hook" inside
    repo:^github\.com/PerlDancer/Dancer2$ type:commit hook

  • type:symbol to filter to search for symbol results

which support the use of regular expressions and exact queries for full-text searches.



More Information


Related Articles - Code Intelligence on GitHub

Grimoire Lab-GitHub - Stats On Steroids

To be informed about new articles on I Programmer, sign up for our weekly newsletter, subscribe to the RSS feed and follow us on Twitter, Facebook or Linkedin.



Apache Arrow 16 Adds Azure Blob Support

Apache Arrow 16 has been released with improvements to the C data interface and to Arrow Flight RPC, and the addition of support for Azure Blob data format.

A Swarming Bee From Festo

The latest addition to the Festo Bionic Learning Network menagerie of bionic robots inspired by the natural world is a bee. Like the Bionic Ant from a decade ago, it has been designed n [ ... ]

More News


raspberry pi books



or email your comment to:

Last Updated ( Wednesday, 17 October 2018 )