Files
uv/docs/concepts/authentication/cli.md
T
Zanie Blue 709e0ba238 Remove the native system store from the keyring providers (#15612)
We're not sure what the best way to expose the native store to users is
yet and it's a bit weird that you can use this in the `uv auth` commands
but can't use any of the other keyring provider options. The simplest
path forward is to just not expose it to users as a keyring provider,
and instead frame it as a preview alternative to the plaintext uv
credentials store. We can revisit the best way to expose configuration
before stabilization.

Note this pull request retains the _internal_ keyring provider
implementation — we can refactor it out later but I wanted to avoid a
bunch of churn here.
2025-09-02 13:16:52 -05:00

59 lines
1.6 KiB
Markdown

# The `uv auth` CLI
uv provides a high-level interface for storing and retrieving credentials from services.
## Logging in to a service
To add credentials for service, use the `uv auth login` command:
```console
$ uv auth login example.com
```
This will prompt for the credentials.
The credentials can also be provided using the `--username` and `--password` options, or the
`--token` option for services which use a `__token__` or arbitrary username.
Once credentials are added, uv will use them for packaging operations that require fetching content
from the given service. At this time, only HTTPS Basic authentication is supported. The credentials
will not yet be used for Git requests.
!!! note
The credentials will not be validated, i.e., incorrect credentials will not fail.
## Logging out of a service
To remove credentials, use the `uv auth logout` command:
```console
$ uv auth logout example.com
```
!!! note
The credentials will not be invalidated with the remote server, i.e., they will only be removed
from local storage not rendered unusable.
## Showing credentials for a service
To show the credential stored for a given URL, use the `uv auth token` command:
```console
$ uv auth token example.com
```
If a username was used to log in, it will need to be provided as well, e.g.:
```console
$ uv auth token --username foo example.com
```
## Configuring the storage backend
Credentials are persisted to the uv [credentials store](./http.md#the-uv-credentials-store).
By default, credentials are written to a plaintext file. An encrypted system-native storage backend
can be enabled with `UV_PREVIEW_FEATURES=native-auth`.