stax
Command reference

stax login

Authenticate with an OCI registry

Authenticate with an OCI-compatible registry. Credentials are stored using the same credential store as Docker or ORAS, so existing Docker logins may work automatically.

Usage

# Interactive login (prompts for username and password)
stax login ghcr.io

# Non-interactive login (for CI/CD)
stax login --username user --password-stdin ghcr.io

# With a personal access token
echo $GITHUB_TOKEN | stax login --username USERNAME --password-stdin ghcr.io

Options

FlagDescription
--username <user>Registry username
--password-stdinRead password from stdin (for non-interactive use)

Credential storage

stax uses the same credential store as Docker and ORAS:

  • macOS — Keychain Access
  • Linux~/.docker/config.json or a configured credential helper
  • Windows — Windows Credential Manager

If you're already authenticated with Docker for the same registry, stax will use those credentials automatically.

Registry-specific setup

GitHub Container Registry (ghcr.io)

Create a personal access token with read:packages and write:packages scopes:

echo $GITHUB_TOKEN | stax login --username YOUR_USERNAME --password-stdin ghcr.io

Docker Hub

stax login docker.io

Private registries

Any OCI-compatible registry works:

stax login registry.example.com

CI/CD usage

In CI environments, pass credentials via environment variables and stdin:

# GitHub Actions
- name: Login to registry
  run: echo "${{ secrets.REGISTRY_TOKEN }}" | stax login --username ${{ github.actor }} --password-stdin ghcr.io
  • stax push — Push requires authentication
  • stax pull — Pull from private registries requires authentication

On this page