Skip to content

About

CLI/TUI tool to integrate with artifact-keeper

Resources

Stars

11 stars

Watchers

0 watching

Forks

Repository files navigation

ak: Artifact Keeper CLI

Artifact Keeper

The official CLI/TUI for Artifact Keeper, an enterprise artifact registry supporting 45+ package formats. Browse repositories, upload and download artifacts, run security scans, configure package managers, and more, all from your terminal.

Installation

Quick Install (Linux/macOS)

curl -fsSL https://raw.githubusercontent.com/artifact-keeper/artifact-keeper-cli/main/install.sh | sh

The installer auto-detects your OS and architecture, downloads the latest release binary, verifies its SHA-256 checksum, and installs to /usr/local/bin (or ~/.local/bin if not writable).

To choose the release or the directory, pass --version or --install-dir:

curl -fsSL https://raw.githubusercontent.com/artifact-keeper/artifact-keeper-cli/main/install.sh | sh -s -- --version v1.12.0 --install-dir ~/bin

Linux binaries and .deb/.rpm packages are statically linked against musl and have no glibc requirement, so they also run on Alpine and in distroless containers. The trade-off is that they don't use glibc's NSS: hostnames resolve through /etc/hosts and the DNS servers in /etc/resolv.conf only, so names that only LDAP or systemd-resolved NSS plugins can resolve won't work. Use a hostname that DNS can resolve, or add it to /etc/hosts.

Homebrew (macOS/Linux)

brew install artifact-keeper/tap/ak

From source

Requires Rust 1.88+:

cargo install --locked --git https://github.com/artifact-keeper/artifact-keeper-cli artifact-keeper-cli

GitHub Releases

Pre-built binaries for every platform are available on the Releases page:

Platform Binary
Linux x86_64 ak-linux-amd64
Linux ARM64 ak-linux-arm64
macOS x86_64 ak-darwin-amd64
macOS ARM64 (Apple Silicon) ak-darwin-arm64
Windows x86_64 ak-windows-amd64.exe

Each binary includes a .sha256 checksum file for integrity verification.

Verifying signatures

Release artifacts are also signed with cosign using Sigstore keyless signing — the signing identity is the release workflow itself, authenticated via GitHub Actions OIDC, so there is no long-lived signing key that can leak. Every artifact is published with a .sig (signature) and .pem (signing certificate) file.

To verify authenticity (not just integrity) of a download, e.g. ak-linux-amd64 from release vX.Y.Z:

cosign verify-blob \
  --certificate ak-linux-amd64.pem \
  --signature ak-linux-amd64.sig \
  --certificate-identity "https://github.com/artifact-keeper/artifact-keeper-cli/.github/workflows/release.yml@refs/tags/vX.Y.Z" \
  --certificate-oidc-issuer "https://token.actions.githubusercontent.com" \
  ak-linux-amd64

A successful verification prints Verified OK. The --certificate-identity value pins the exact workflow and tag that produced the signature; to accept any release tag from this repository's release workflow, pass --certificate-identity-regexp '^https://github\.com/artifact-keeper/artifact-keeper-cli/\.github/workflows/release\.yml@refs/tags/v.*$' instead. The same command works for the .deb/.rpm packages and the completions/man-page tarballs — substitute the file name.

Supported Servers

The first two numbers of the ak version tell you the server version it's built for. The last number is the CLI's own and doesn't match the server's patch number, so ak 1.12.0 is built from API 1.12.1. New commands may ship in CLI patch releases (1.12.x).

A 1.12.x CLI supports servers on 1.11 and 1.12. Each ak minor supports the server minor it's built for and the one before. Other versions aren't tested, and ak doctor warns about them.

Quick Start

# 1. Log in. This adds your registry, named from its host
ak auth login https://registry.company.com

# 2. Browse repositories
ak repo list

# 3. Upload an artifact
ak artifact push my-repo ./package-1.0.tar.gz

# 4. Download an artifact
ak artifact pull my-repo org/pkg/1.0/pkg-1.0.jar

# 6. Configure your package managers automatically
ak setup auto

Browser, headless and SSO login

Requires Artifact Keeper backend 1.12.0 or newer with DEVICE_AUTH_ENABLED=true.

At a terminal, ak auth login signs in through the browser when the server offers it (the device authorization grant, RFC 8628). It prints a verification URL and a short code and opens the browser. Approve the request there, or on any other device where you are signed in to Artifact Keeper. The CLI polls at the server's interval, honours slow_down, and stores the returned access and refresh tokens through the same credential store as a password login. Tokens are never printed.

A bare ak auth login asks for every scope the device grant gives a non-admin: read:artifacts, write:artifacts, read:repositories, write:repositories and read:users, so pushing works. The session never carries *, admin or the admin-only scopes (deleting, promoting, ak admin and the like): for those, use ak auth login --password or an API token. When the server refuses a browser session for scope, the error says so.

ak auth login                  # browser sign-in, if the server offers it
ak auth login --password       # username and password instead
ak auth login --device         # browser sign-in, also without a terminal
  • --password signs in with a username and password, as ak auth login did before 1.12. --token and --token-stdin take an API token.
  • --device asks for browser sign-in even without a terminal, or with --no-input, for a headless host: approve the code from another device. --oidc-device, its old name, still works.
  • --scope <SCOPE> requests specific AK scopes, repeatable or comma-separated, and implies --device. --device without it asks only for read:artifacts, the least a headless host needs. *, admin and OIDC scopes (openid, profile, email) are refused: this is a plain Artifact Keeper grant, not an OIDC device flow.
  • Without a terminal, with --no-input, or on a server that doesn't offer device sign-in (1.11, or DEVICE_AUTH_ENABLED off), ak auth login asks for a password or a token as before. It also falls back to that prompt, with a note, when the server can't start a browser sign-in (rate-limited, unavailable, or a proxy in the way); --device fails there instead.
  • --no-input never opens a browser and never prompts. Set AK_NO_BROWSER=1 to suppress the browser launch without disabling prompts.

With --device on a server without it, the command reports that device authorization isn't available. Use ak auth logout to clear the stored credential.

Commands

Core
  ak instance      Add, remove, and switch between registry instances
  ak auth          Log in, manage tokens, check identity
  ak repo          Manage repositories: members, upstream settings, storage, and more
  ak artifact      Push, pull, list, search, copy, and delete artifacts; revisions and upload sessions
  ak api           Send any HTTP request to the instance, with its auth and TLS settings
  ak pkg           Publish packages and use format APIs without the format's own client
  ak agent         Publish and install AI coding-agent plugins (Claude Code, Cursor, Codex, Copilot)
  ak mcp           MCP Registry repositories: catalog approvals, sync and seed, versions, health
  ak setup         Auto-configure npm, pip, cargo, docker, maven, gradle, go, helm, nuget, and more
  ak doctor        Diagnose configuration and connectivity issues. Exits 1 if a check fails
  ak config        Get/set CLI configuration values

Security & Compliance
  ak scan          Trigger security scans and view findings
  ak sign          Signing and key management
  ak sbom          Software Bill of Materials operations
  ak license       License compliance management
  ak quality-gate  Manage artifact quality gates
  ak quarantine    Hold, release, and reject quarantined artifacts
  ak totp          Manage two-factor authentication (TOTP)

Organization
  ak group         Manage user groups
  ak permission    Manage fine-grained permission rules
  ak profile       Manage your user profile
  ak label         Tag repositories with key-value labels
  ak sso           Manage SSO authentication providers (LDAP, OIDC, SAML)

Workflow & Lifecycle
  ak promotion     Promote artifacts between repositories
  ak approval      Manage promotion approval workflows
  ak lifecycle     Manage lifecycle and retention policies
  ak migrate       Migrate artifacts between instances in bulk

Federation & Integration
  ak peer          Manage federation peer instances
  ak sync-policy   Manage sync policies for automated replication
  ak webhook       Manage webhooks for event-driven integrations
  ak dt            Dependency-Track integration
  ak analytics     Usage analytics and storage insights

Administration
  ak monitoring    Server health, readiness, metrics and alerting
  ak catalog       Discover packages and browse repository trees
  ak admin         Backup, cleanup, stats, users, plugins, settings, audit log, downloads, trash, storage checks
  ak project       Projects: grouped repositories, members and a storage quota
  ak banner        System-wide maintenance and downtime banners
  ak search        Quick, checksum, recent, suggested and trending artifact searches
  ak events        Follow the server's stream of change events
  ak bundle        Offline bundles: format, manifest checks, export and import jobs
  ak environment   Stored lockfiles, and which of them contain a component
  ak image-build   Server-side container image builds and image inspection
  ak attestation   The publishers and keys this server trusts for attestations
  ak tui           Launch interactive TUI dashboard
  ak completion    Generate shell completions (bash/zsh/fish/powershell)
  ak man-pages     Generate man pages for all commands

Run ak <command> --help for detailed usage and examples. ak ls, ak rm, ak login, ak logout, ak whoami, ak upload and ak download work as you'd expect. ak ls lists repositories, and ak ls <repo> what's in one.

Agent Plugins

An Agent Plugins repository (--pkg-format agentplugins) holds plugin bundles for AI coding agents. ak agent plugins publishes a plugin directory and installs it where each agent looks for plugins:

# Publish: the manifests name the plugin, --version sets the version in all of them
ak repo create plugins --pkg-format agentplugins --repo-type local
ak agent plugins publish ./deploy-tools --repo plugins
ak agent plugins publish ./deploy-tools --repo plugins --version 1.3.0 --dry-run

# Install for one or more agents, then keep up to date
ak agent plugins install deploy-tools --repo plugins --harness claude,cursor
ak agent plugins list --check-updates
ak agent plugins update --all
ak agent plugins uninstall deploy-tools --harness cursor

# Find and remove published versions
ak agent plugins search deploy --repo plugins --harness codex
ak agent plugins delete deploy-tools --version 1.2.0 --repo plugins --yes

publish finds .claude-plugin/plugin.json, a root plugin.json with an agent-plugins.org $schema, .cursor-plugin/plugin.json, .codex-plugin/plugin.json and gemini-extension.json. It zips the directory with the same bytes for the same files, leaves out .git, refuses symbolic links, and never changes the directory: a --version is written only into the upload.

install checks the zip's SHA-256 against the repository's index, refuses entries that would land outside the plugin, and records what it installed in <plugin>/.ak/plugin-info.json:

--harness Installed to Then
claude ~/.claude/plugins/local/ak/<repo>/<slug>, listed in the local marketplace ak-<repo> claude plugin marketplace add (or update) and claude plugin install <slug>@ak-<repo>
cursor ~/.cursor/plugins/local/<slug> Reload Cursor
codex ~/.agents/plugins/local/ak/<repo>/<slug>, listed in the local marketplace ak-<repo> codex plugin marketplace add
vscode ~/.copilot/installed-plugins/ak-<repo>/<slug> copilot plugin install

The follow-up commands run when the agent's CLI is on PATH, and are printed otherwise. --path DIR installs to DIR/<slug> and runs nothing. Claude Code can also read the repository itself, with no ak: claude plugin marketplace add https://<host>/agentplugins/<repo>/claude-marketplace.json.

MCP Registries

An MCP Registry repository (--pkg-format mcp, server 1.12 or newer) serves the MCP registry API at /mcp/<repo>/v0.1. Publishers use mcp-publisher against it, and clients read it directly. ak mcp is the management side:

# A Local registry whose servers' packages resolve in this instance's npm and OCI repositories
ak repo create mcp-local --pkg-format mcp --repo-type local \
  --mcp-package-repo npm=npm-local,oci=docker-local --mcp-namespace-allow com.acme
ak mcp health --repo mcp-local com.acme/weather 1.2.0

# One version: deprecate it, take a bad one down and purge it, re-probe its tools
ak mcp version status --repo mcp-local com.acme/weather 1.1.0 --status deprecated --message "Use 1.2"
ak mcp version delete --repo mcp-local com.acme/weather 1.0.0 --message "Malicious" --yes
ak mcp version purge --repo mcp-local com.acme/weather 1.0.0 --yes
ak mcp version probe --repo mcp-local com.acme/weather 1.2.0

# A Remote registry: an allowlist filled from its upstream
ak repo create mcp-official --pkg-format mcp --repo-type remote \
  --upstream-url https://registry.modelcontextprotocol.io
ak mcp sync start --repo mcp-official --wait
ak mcp pending
ak mcp catalog list --repo mcp-official --queue
ak mcp catalog approve --repo mcp-official <id> --reason "Vetted" --yes
ak mcp catalog bulk-approve --repo mcp-official 'io.github.acme/*' --dry-run
ak mcp seed start --repo mcp-official io.github.acme/weather@1.2.0 --yes --wait

# Evidence that a domain's owner controls a namespace (instance administrators)
ak mcp namespace-proof create com.acme --method dns
ak mcp namespace-proof verify <id>

Approvals, blocks, pins, seeds, bulk decisions and ak mcp version purge take --yes, as deletes do.

Output Formats

Every command supports multiple output modes:

ak repo list                    # Table (default in terminals)
ak repo list --format json      # JSON (default when piped)
ak repo list --format yaml      # YAML
ak repo list -q                 # Quiet: IDs only, one per line

--format json is the server's response as sent, so its shape follows the server's version, and ak doesn't normalize it. For a script that has to work across server versions, -q prints the stable IDs.

The format comes from --format, then AK_FORMAT, then ak config set output_format, and otherwise table on a terminal and JSON on a pipe. ak config set output_format table is that default, so a pipe still gets JSON; --format table keeps a table on a pipe. Color goes the same way: --color, then AK_COLOR and NO_COLOR, then ak config set color, and otherwise auto.

Multi-Instance Support

Manage multiple Artifact Keeper servers with named contexts:

ak instance add prod https://registry.company.com
ak instance add staging https://staging.company.com
ak instance use prod

# Or per-command:
ak repo list --instance staging

Custom CA Certificates

For instances behind a private or enterprise Certificate Authority (internal registries, corporate TLS-inspection proxies), point the CLI at a PEM file containing the CA certificate — or a bundle with multiple certificates:

# Per invocation
ak repo list --ca-cert /etc/ssl/corp-root-ca.pem

# Or via environment variable (e.g. in CI)
export AK_CA_CERT=/etc/ssl/corp-root-ca.pem
ak artifact push my-repo ./build/output.tar.gz

The certificate(s) are added to the default trust store; TLS verification always remains enabled. There is intentionally no option to disable certificate verification — use --ca-cert to trust your private CA instead.

Plain HTTP Instances

ak won't send credentials (a login, an API token, a password) over plain http:// to a host that isn't this machine, since anyone on the network path could read them. It stops before sending anything, with exit code 2 (3 for ak api). Loopback (localhost, 127.0.0.0/8, ::1) is always allowed.

If your server only has plain HTTP, such as on a home or lab network, allow it for that instance, once, and ak keeps the setting in its config:

ak instance add nas http://192.168.1.20:8080 --insecure-http
# or, for an instance you already have
ak instance update nas --insecure-http
# and to take it back
ak instance update nas --insecure-http=false

AK_ALLOW_INSECURE_HTTP=1 allows it for one command. ak instance info and ak doctor say when an instance is on plain HTTP, and whether ak sends it credentials.

Shell Completions

# Bash
ak completion bash > ~/.bash_completion.d/ak

# Zsh
ak completion zsh > ~/.zfunc/_ak

# Fish
ak completion fish > ~/.config/fish/completions/ak.fish

# PowerShell
ak completion powershell > ak.ps1

CI/CD Usage

export AK_INSTANCE=https://registry.company.com   # a URL, or the name of a configured instance
export AK_TOKEN=your-api-token
export AK_NO_INPUT=1

ak artifact push my-repo ./build/output.tar.gz

To swap a CI provider's OIDC token for an Artifact Keeper token, capture it with -q, which prints only the token: AK_TOKEN=$(ak auth ci-exchange --provider-id <id> --jwt-stdin -q < jwt). The table output shows only the start of the token, so it's safe in a job log. JSON, which ak prints on a pipe without --format, holds the whole token. On GitHub Actions ak also tells the runner to mask the token, with an ::add-mask:: line on stderr, whenever it prints the token.

AK_NO_INPUT and --no-input mean never prompt. They don't answer a prompt: --yes (-y) is the only consent. A destructive or security-decision command, such as ak repo delete or ak quarantine release, fails without it, with exit code 2, and sends nothing. Everything else runs without asking.

See the CI/CD Integration Guide for GitHub Actions, GitLab CI, and Jenkins examples.

Exit Codes

Code Meaning
0 Success
1 Anything else that failed, such as a file that can't be written
2 Bad arguments or a value that isn't valid
3 Network or TLS: no answer from the server
4 Not logged in, or not allowed (401, 403)
5 Not found (404)
6 Any other server error, or a server too old for the command
7 The server answered 2xx, and its response says it failed or a check didn't pass
22 ak api --fail on a failure status

ak api reports an HTTP exchange rather than a command, so it has its own table in ak api --help: 1 for a failure status, 2 for bad arguments, 3 for a request that didn't complete, and 22 with --fail.

Environment Variables

Variable Description
AK_FORMAT Default output format (table, json, yaml, quiet)
AK_INSTANCE Override default instance: a name, or a URL such as https://registry.company.com
AK_TOKEN API token (alternative to keychain)
AK_NO_INPUT Never prompt, as --no-input does: 1, true or yes. 0, false, no or empty leave it off. Destructive and security-decision commands then need --yes
AK_CA_CERT Path to a PEM file with additional root CA certificate(s) to trust (same as --ca-cert)
AK_ALLOW_INSECURE_HTTP 1, true or yes lets this command send credentials over plain HTTP to a host that isn't this machine. See Plain HTTP Instances
AK_COLOR Color mode (auto, always, never)
AK_CONFIG_DIR Override config directory
NO_COLOR Standard no-color flag

Documentation

License

MIT

About

CLI/TUI tool to integrate with artifact-keeper

Resources

Stars

11 stars

Watchers

0 watching

Forks

Releases

Sponsor this project

Packages

Used by

Contributors

Languages