Skip to content

Commit f4743f2

Browse files
authored
remove endpoint command line and expand on SRC_ENDPOINT and SRC_ACCES_TOKEN (#1742)
We're still figuring out how to expand `src login` with OAuth; made some (hopefully clarifying) changes to the CLI quickstart docs.
1 parent 9b03cf7 commit f4743f2

2 files changed

Lines changed: 6 additions & 14 deletions

File tree

docs/batch-changes/quickstart.mdx

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,7 @@ curl -L https://<YOUR-SOURCEGRAPH-INSTANCE-URL>/.api/src-cli/src_linux_amd64 -o
3131
chmod +x /usr/local/bin/src
3232
```
3333

34-
Authenticate `src` with your Sourcegraph instance by running `src login` and following the instructions:
35-
36-
```bash
37-
src login https://<YOUR-SOURCEGRAPH-INSTANCE-URL>
38-
```
39-
40-
![src-login-success](https://sourcegraphstatic.com/docs/images/batch_changes/src_login_success.png)
41-
42-
Once `src login` reports that you're authenticated, you're ready for the next step.
34+
Authenticate `src` with your Sourcegraph instance by following the [CLI quickstart](/cli/quickstart) and you'll be ready for the next step.
4335

4436
## Write a batch spec
4537

docs/cli/quickstart.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,17 +47,17 @@ For other options, please refer to [the Windows specific `src` documentation](/c
4747

4848
## Connect to Sourcegraph
4949

50-
`src` needs to be authenticated against your Sourcegraph instance. The quickest way to do this is to run `src login https://YOUR-SOURCEGRAPH-INSTANCE` and follow the instructions:
51-
52-
![Output from src login showing success](https://sourcegraphstatic.com/docs/images/batch_changes/src_login_success.png)
50+
`src` needs to be authenticated against your Sourcegraph instance. The quickest way to do this is to add `SRC_ENDPOINT=https://YOUR-SOURCEGRAPH-INSTANCE` to your shell environment, then run `src login` to launch OAuth authentication against your Sourcegraph instance.
5351

5452
### OAuth login
5553

56-
`src login` supports interactive OAuth login, so you can sign in without creating or exporting a `SRC_ACCESS_TOKEN`.
54+
`src login` supports interactive OAuth login, so you can sign in without creating or exporting `SRC_ACCESS_TOKEN`.
5755

5856
If you need to reuse the current `src` credential in another command, `src auth token` prints the raw token and `src auth token --header` prints a complete `Authorization` header for the active authentication mode.
5957

60-
If you need non-interactive authentication, such as in CI or scripts, you can still use `SRC_ENDPOINT` and `SRC_ACCESS_TOKEN`.
58+
### PAT login
59+
60+
If you need non-interactive authentication, such as in CI or scripts, you can still [create an access token](/cli/how-tos/creating-an-access-token) in your Sourcegraph instance, then use `SRC_ACCESS_TOKEN` in the shell environment, along with `SRC_ENDPOINT`. In this case, `src login` is not necessary: `src` will use the PAT from the environment to authenticate against your Sourcegraph instance.
6161

6262
## Run a code search
6363

0 commit comments

Comments
 (0)