A lightweight cli tool to interact with Sourcegraph.
go get github.com/beyang/sgbl
You can configure sgbl
to work with private Sourcegraph instances in addition to Sourcegraph.com.
To do this, save a JSON file like the following to ~/.sgbl-config
:
{
"sourcegraphs": [
{
"url": "https://sourcegraph.mycompany.com",
"repos": [
"github.com/mycompany/private-repo",
...
]
},
...
]
}
sgbl [options] path/to/file
sgbl main.go
sgbl --line=22 main.go
# or
sgbl --line=22 --col=6 main.go
# or
sgbl --pos=22:6 main.go
sgbl --search="repo:gorilla/mux ^func Test"
sgbl --search="^func main" .