GeezerVison is showing github.com — docs/auth: clarify OAuth and access token setup by eugenio-sanchez-sg · Pull Request #1356 · sourcegraph/src-cli
Conversation
What changed
Updated the README to clearly explain how to connect and authenticate to a Sourcegraph instance.
Added
- Instructions for setting SRC_ENDPOINT on macOS, Linux, and Windows.
- A note that src defaults to https://sourcegraph.com when SRC_ENDPOINT is not set.
- A dedicated OAuth section explaining:
- Run src login to authenticate interactively.
- OAuth does not require SRC_ACCESS_TOKEN.
- OAuth credentials are stored in the operating system’s native keyring.
- SRC_ENDPOINT must remain set so future commands can find the correct OAuth credential.
- Passing a URL to src login only selects the endpoint for that login command.
- Documentation for:
- src auth token, which prints the active token.
- src auth token --header, which prints a complete Authorization header.
- A dedicated personal access token section explaining:
- Access tokens are recommended for CI, scripts, and other non-interactive environments.
- Both SRC_ENDPOINT and SRC_ACCESS_TOKEN must be set.
- SRC_ACCESS_TOKEN takes precedence over an OAuth credential.
- Running src login is unnecessary when SRC_ACCESS_TOKEN is set.
- Shell and PowerShell examples for both endpoint and access-token configuration.
- src auth to the README’s list of available commands.
- The previous section anchor so existing links to the old heading continue to work.
Removed
- The outdated introduction that instructed users to run src login SOURCEGRAPH-URL.
- The implication that passing a URL to src login configures future commands.
- The old combined instructions that treated SRC_ENDPOINT and SRC_ACCESS_TOKEN as required together for every login.
- The duplicated macOS, Linux, and Windows configuration sections.
This is a documentation-only change.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Reviewers
burmudar
burmudar approved these changes
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.