Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,16 +73,6 @@ Point `src` to your instance and access token using environment variables:
SRC_ENDPOINT=https://sourcegraph.example.com SRC_ACCESS_TOKEN="secret" src search 'foobar'
```

### Via global configuration file

Create a `$HOME/src-config.json` with:

```sh
{"endpoint": "https://sourcegraph.example.com", "accessToken": "secret"}
```

Then `src search 'foobar'` and other commands will automatically use that configuration!

### Where to get an access token

Visit your Sourcegraph instance (or https://sourcegraph.com), click your username in the top right to open the user menu, select **Settings**, and then select **Access tokens** in the left hand menu.
Expand Down
7 changes: 5 additions & 2 deletions cmd/src/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,13 @@ Usage:

src [options] command [command options]

Environment variables
SRC_ACCESS_TOKEN Sourcegraph access token
SRC_ENDPOINT endpoint to use, if unset will default to "https://sourcegraph.com"

The options are:

-config=$HOME/src-config.json specifies a file containing {"accessToken": "<secret>", "endpoint": "https://sourcegraph.com"}
-endpoint= specifies the endpoint to use e.g. "https://sourcegraph.com" (overrides -config, if any)
-endpoint= specifies the endpoint to use e.g. "https://sourcegraph.com" (overrides SRC_ENDPOINT if set)
-v print verbose output

The commands are:
Expand Down