feat(cli): add --token option to self update command (#7279)
<!-- Thank you for contributing to uv! To help us out with reviewing, please consider the following: - Does this pull request include a summary of the change? (See below.) - Does this pull request include a descriptive title? - Does this pull request include references to any relevant issues? --> ## Summary It often reaches the GitHub API rate limit and shows error like `error: HTTP status client error (403 Forbidden) for url (https://api.github.com/repos/astral-sh/uv/releases)` when running `uv self update`. To bypass this rate limit issue, allow user to pass a GitHub token via `--token` or `UV_GITHUB_TOKEN` env. ## Test Plan <!-- How was it tested? --> --------- Signed-off-by: Frost Ming <me@frostming.com>
This commit is contained in:
@@ -427,6 +427,11 @@ pub enum SelfCommand {
|
||||
pub struct SelfUpdateArgs {
|
||||
/// Update to the specified version. If not provided, uv will update to the latest version.
|
||||
pub target_version: Option<String>,
|
||||
|
||||
/// A GitHub token for authentication.
|
||||
/// A token is not required but can be used to reduce the chance of encountering rate limits.
|
||||
#[arg(long, env = "UV_GITHUB_TOKEN")]
|
||||
pub token: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Args)]
|
||||
|
||||
Reference in New Issue
Block a user