diff --git a/docs/cli/explanations/env.mdx b/docs/cli/explanations/env.mdx index 9449c40c4..982754ae7 100644 --- a/docs/cli/explanations/env.mdx +++ b/docs/cli/explanations/env.mdx @@ -2,7 +2,12 @@ ## Overview -`src` requires two environment variables to be set to authenticate against your Sourcegraph instance. +`src` supports two authentication methods: + +- Interactive OAuth via `src login` +- Access token authentication via `SRC_ACCESS_TOKEN` + +Use OAuth for local interactive use, or set the environment variables below for non-interactive workflows such as scripts and CI. ## `SRC_ENDPOINT` @@ -18,7 +23,7 @@ If the environment variable is not set, it'll default to "https://sourcegraph.co ## `SRC_ACCESS_TOKEN` -`src` uses an access token to authenticate as you to your Sourcegraph instance. This token needs to be in the `SRC_ACCESS_TOKEN` environment variable. +`src` can use an access token to authenticate as you to your Sourcegraph instance. Set it in the `SRC_ACCESS_TOKEN` environment variable. Note, `src` will use the `SRC_ACCESS_TOKEN` over the OAuth token if it is set in the environment. To create an access token, please refer to "[Creating an access token](/cli/how-tos/creating-an-access-token)". diff --git a/docs/cli/quickstart.mdx b/docs/cli/quickstart.mdx index 7e71c5757..59958140f 100644 --- a/docs/cli/quickstart.mdx +++ b/docs/cli/quickstart.mdx @@ -51,7 +51,11 @@ For other options, please refer to [the Windows specific `src` documentation](/c ![Output from src login showing success](https://sourcegraphstatic.com/docs/images/batch_changes/src_login_success.png) -Once complete, you should have two new environment variables set: `SRC_ENDPOINT` and `SRC_ACCESS_TOKEN`. +### OAuth login + +`src login` supports interactive OAuth login, so you can sign in without creating or exporting a `SRC_ACCESS_TOKEN`. + +If you need non-interactive authentication, such as in CI or scripts, you can still use `SRC_ENDPOINT` and `SRC_ACCESS_TOKEN`. ## Run a code search