Authenticating the uv client
pyx is supported as a first-class package registry in the uv client as of uv v0.8.15. You can install uv with our standalone installers, or with your package manager of choice:If you’re running in a headless environment, e.g., when SSH’d into a remote
server, you’ll be prompted to open a browser window to authenticate.
PYX_API_KEY
environment variable:
Authenticating external tools
pyx uses JWT-based authentication. When authenticating via theuv auth login
command, uv will store a JWT token on your machine, alongside a refresh token.
When making API requests, uv will include the JWT token in the Authorization
header. If the JWT token is expired, uv will automatically refresh it using the
refresh token. When authenticating via PYX_API_KEY
, uv will perform a similar
process, but without the need for a refresh token.
If necessary, you can use uv auth token pyx.dev
to generate a JWT token for
use with the pyx API:
ruff
with:
__token__
and the password to the JWT token, e.g.:
PYX_AUTH_TOKEN
environment variable:
Authenticating with Docker
In Docker builds, we recommend using Docker’s built-in support for build secrets. When invokingdocker buildx build
, you can pass an API key as a build secret.
For example, assuming that your API key is stored in the PYX_API_KEY
environment variable, you can pass it as a build secret with:
pyx_api_key
build secret as
follows:
uv auth token pyx.dev
and pass
it to Docker as a build secret:
pyx_auth_token
build secret as
follows:
Build secrets do not persist across builds, and do not invalidate layer
caches. As such, re-running a Docker build with a regenerated access token
will retain the cached layers from the previous build.
docker/build-push-action
GitHub Action, you can pass the
API key as a build secret to the action directly:
Migrating off the uv alpha
Prior to v0.8.15, pyx support shipped in a separate, pyx-enabled alpha build of uv. If you’re migrating off the uv alpha (e.g., v0.8.12-alpha.3), note the following changes to the authentication interface:uv auth login
is nowuv auth login pyx.dev
uv auth logout
is nowuv auth logout pyx.dev
uv auth token
is nowuv auth token pyx.dev
UV_API_KEY
is nowPYX_API_KEY
(UV_API_KEY
will continue to be supported temporarily for backwards-compatibility)UV_AUTH_TOKEN
is nowPYX_AUTH_TOKEN
(UV_AUTH_TOKEN
will continue to be supported temporarily for backwards-compatibility)