Skip to content

CLI reference ​

oa is the command-line client of the REST API. For login, the config file and worked examples see CLI. Global flags go before the command. Each command group below shows its usage as printed by oa help; commands that parse flags list them as printed by oa COMMAND --help (the flag package accepts both -flag and --flag).

Usage ​

text
oa [--server URL] [--token TOKEN] [--format table|json] <command> [args]

Global flags ​

text
--server    Server URL  (default: http://localhost:8080, env: OA_SERVER)
--token     API token   (env: OA_TOKEN)
--format    Output format: table|json  (default: table)

Environment variables ​

VariableNamed by
OA_GPG_PASSPHRASEoa gpg import
OA_IMPORT_SOURCE_TOKENoa import artifactory, oa import nexus
OA_IMPORT_SOURCE_USERoa import artifactory, oa import nexus
OA_SERVER--server
OA_TOKEN--token
OA_WEBHOOK_SECREToa webhook create

Auth ​

text
auth login [--server URL] [--username U] [--password-stdin]
                                   Login with username/password (prompted without echo) or token
auth logout [--revoke --username U --password-stdin]
                                   Clear saved credentials (--revoke also revokes the server-side token)
auth whoami                        Show current user
auth passwd [--password-stdin]     Change your password (stdin: current, then new, one per line)
auth token list                    List your personal API tokens
auth token create --name N [--kind access|deploy] [--username U] [--password-stdin]
                                   Create a personal API token (signs in with your password)
auth token revoke <id> [--username U] [--password-stdin]
                                   Revoke a personal API token (signs in with your password)

oa auth login ​

FlagValueDescription
-passwordstringremoved; use --password-stdin
-password-stdinnoneRead the password from stdin
-serverstringServer URL (default "http://localhost:8080")
-usernamestringUsername (required with --password-stdin)

oa auth logout ​

FlagValueDescription
-password-stdinnoneRead the password from stdin (with --revoke)
-revokenoneAlso revoke the saved token on the server (needs --username and --password-stdin)
-usernamestringUsername (with --revoke)

oa auth passwd ​

FlagValueDescription
-new-passwordstringremoved; use --password-stdin
-old-passwordstringremoved; use --password-stdin
-passwordstringremoved; use --password-stdin
-password-stdinnoneRead current then new password from two lines on stdin

oa auth token create ​

FlagValueDescription
-kindstringToken kind: access|deploy (default "access")
-namestringToken name
-password-stdinnoneRead the account password from stdin
-usernamestringAccount to sign in as (default: the saved token's owner)

Repositories ​

text
repo list                          List repositories
repo create <name> --format <fmt> [--description D] [--public] [--trash-retention-days N] [--immutable-releases] [--sign-packages]
                                   Create repository
repo show <name>                   Show repository details
repo update <name> [--description D] [--public[=false]] [--trash-retention-days N|default] [--immutable-releases[=false]] [--sign-packages[=false]]
                                   Update repository
repo delete <name> --confirm <name>  Delete repository (moved to the trash; prompts for the name on a terminal)
repo packages <name>               List packages in repository
repo members <name>                List the member repositories of a group repository

Trash ​

text
trash list [--repo NAME] [--kind K]  List trashed items (all: admin; --repo: repository delete permission)
trash restore <kind> <id> [--repo NAME]  Restore a trashed item or repository
trash purge <kind> <id> [--yes]    Permanently delete a trashed item now (admin)

oa trash ​

text
Usage: oa trash <list|restore|purge>
  oa trash purge <kind> <id> [--yes]            purge one item (admin)
  oa trash purge --repo NAME --all [--yes]      empty a repository's trash (repository manage permission)

oa trash list ​

FlagValueDescription
-kindstringOnly items of this kind (e.g. maven_artifact, docker_tag, repository)
-repostringOnly items of this repository

oa trash purge ​

FlagValueDescription
-allnonePurge every trashed item of --repo
-repostringRepository whose trash to empty
-yesnoneDo not ask for confirmation

Artifacts ​

text
artifact list <repo>               List packages in repository
artifact upload <repo> <file>      Upload artifact (auto-detects deb/rpm; files over 5 GiB switch to a multipart presigned upload)
artifact upload --presigned [--path P] [--content-type T] [--multipart] [--part-size SIZE] [--parallel N] <repo> <file>
                                   Upload a raw artifact straight to the object store (presigned PUT; files over 5 GiB,
                                   --multipart or --part-size (128M, 1G or bytes) upload in parts, --parallel 1-16, default 4)
artifact delete <repo> <id>        Delete artifact by ID

oa artifact upload ​

FlagValueDescription
-apk-repostringAlpine repository directory of an .apk upload (default main)
-archstringArchitecture directory of an .apk upload; needed for noarch packages
-branchstringAlpine branch directory of an .apk upload (default edge)
-content-typestringContent type (--presigned; default: detected by the server)
-multipartnoneUpload in parts at any size (--presigned; automatic above 5 GiB)
-parallelintParts uploaded at the same time, 1 to 16 (--presigned, multipart) (default 4)
-part-sizevaluePart size such as 128M, 1G or a byte count, 5M to 4000M (--presigned; implies --multipart; default: chosen by the server)
-pathstringArtifact path in the repository (--presigned; default: the file name)
-presignednoneUpload straight to the object store through a presigned URL (raw repositories)
text
search <query> [--repo R] [--fmt F]  Search artifacts
FlagValueDescription
-fmtstringFilter by format
-limitintMax results (default 50)
-repostringFilter by repository

Users (admin) ​

text
user list                          List users
user create --username U --email E [--password-stdin]  Create user (password prompted without echo)
user show <id>                     Show user
user update <id> [--email E] [--full-name N] [--disabled[=false]]  Update user
user delete <id>                   Delete user

oa user create ​

FlagValueDescription
-emailstringEmail
-full-namestringFull name
-passwordstringremoved; use --password-stdin
-password-stdinnoneRead the password from stdin
-usernamestringUsername

Groups (admin) ​

text
group list                         List groups
group create <name>                Create group
group show <id>                    Show group
group delete <id>                  Delete group
group members <id>                 List group members
group add-member <id> <user-id>    Add member to group
group rm-member <id> <user-id>     Remove member from group

Projects ​

text
project list                       List projects
project create <name>              Create a project
project show <name>                Show project (includes my_role)
project update <name> [--display-name N] [--description D]
                                   Update a project (owner); policy flags (--allowed-formats,
                                   --allowed-repo-types, --repo-name-prefix, --allow-public-repos,
                                   --max-repositories, --token-max-ttl-days) need a global admin
project delete <name>              Delete a project
project members <name>             List project members
project add-member <name> (<user-id> | --username U) [--role viewer|developer|maintainer|owner]
                                   Add member to a project
project set-role <name> <user-id> <role>
                                   Change a member's role
project rm-member <name> <user-id> Remove member from project
project groups <name>              List group grants
project add-group <name> <group-id|group-name> [--role viewer|developer|maintainer]
                                   Grant a group access
project rm-group <name> <group-id|group-name>
                                   Remove a group grant

Tokens (admin) ​

text
token list                         List all tokens
token revoke <id>                  Revoke any token

GPG keys (admin) ​

text
gpg list                           List GPG keys
gpg import --key <file|-> [--name N] [--passphrase-stdin] [--activate|--no-activate]
                                   Import a private key (passphrase: stdin or env OA_GPG_PASSPHRASE)
gpg generate [--name N] [--algorithm ed25519|rsa4096] [--user-name U] [--email E] [--comment C] [--activate|--no-activate]
                                   Generate a signing key
gpg delete <key> [--force]         Delete a key (id, name or fingerprint)
gpg activate <key> [--repository R]    Make key the signer (global or per deb/rpm repo)
gpg deactivate <key> [--repository R]  Stop using key for signing
gpg export <key> [--output FILE]   Export the public key

oa gpg import ​

FlagValueDescription
-activatenoneMake the key the active signing key
-keystringArmored private key file, or - for stdin
-namestringKey name
-no-activatenoneDo not activate the key
-passphrase-stdinnoneRead the key passphrase from stdin (env: OA_GPG_PASSPHRASE)

oa gpg generate ​

FlagValueDescription
-activatenoneMake the key the active signing key
-algorithmstringAlgorithm: ed25519|rsa4096 (default "ed25519")
-commentstringUser ID comment
-emailstringUser ID email
-namestringKey name
-no-activatenoneDo not activate the key
-user-namestringUser ID name

oa gpg delete ​

FlagValueDescription
-forcenoneDelete even if the key is active or assigned

oa gpg activate ​

FlagValueDescription
-repositorystringRepository to activate for (default: global)

oa gpg deactivate ​

FlagValueDescription
-repositorystringRepository to deactivate for (default: global)

oa gpg export ​

FlagValueDescription
-outputstringWrite the public key to FILE (default: stdout)

Storage backends (admin) ​

text
storage list                       List storage backends
storage create --name N [--type T] [--config-file F|-]
                                   Create storage backend (credentials via --config-file, - = stdin)
storage show <name>                Show storage backend
storage update <name> [--config-file F|-]  Update storage backend
storage delete <name>              Delete storage backend
storage test <name>                Test storage backend

oa storage create ​

FlagValueDescription
-configstringInline JSON config (non-secret settings only)
-config-filestringFile with the JSON config, or - for stdin (use this for credentials)
-namestringBackend name
-typestringBackend type: filesystem|s3|gcs|azure|garage|seaweedfs|oci (default "filesystem")

Backup & restore (admin) ​

text
backup list                        List backups
backup create [--type full|metadata-only]  Create backup
backup show <id>                   Show backup
backup download <id> <dest>        Download backup
backup restore <archive-file>      Restore from a downloaded backup archive

oa backup create ​

FlagValueDescription
-typestringBackup type: full|metadata-only (default "full")

Audit log (admin) ​

text
audit list [--limit N] [--action A] [--actor A]  List audit entries
audit export [--format jsonl|csv] [--since T] [--until T] [--actor A] [--action A] [-o FILE]
                                   Export the audit log (default: jsonl to stdout)

oa audit list ​

FlagValueDescription
-actionstringFilter by action
-actorstringFilter by actor
-limitintMax entries (default 50)

oa audit export ​

FlagValueDescription
-actionstringFilter by action
-actorstringFilter by actor
-formatstringExport format: jsonl|csv (default "jsonl")
-ostringWrite to this file instead of stdout
-outputstringWrite to this file instead of stdout
-sincestringOnly entries at or after this time (RFC 3339, YYYY-MM-DD or an age like 24h, 7d)
-untilstringOnly entries before this time (same forms)

Webhooks ​

text
webhook list                       List global webhooks
webhook create --name N --url U --events E,E [--secret-file F] [--active=false]  Create webhook
webhook show <id>                  Show webhook
webhook update <id> [--name N] [--url U] [--events E,E] [--active[=false]]  Update webhook
webhook delete <id>                Delete webhook
webhook test <id>                  Test webhook
webhook deliveries <id>            List webhook deliveries
webhook repo list <repo>           List repo webhooks
webhook repo create <repo> --name N --url U --events E,E [--secret-file F]  Create repo webhook

oa webhook create ​

FlagValueDescription
-activenoneEnabled (default true)
-eventsstringComma-separated event types, e.g. artifact.uploaded (required)
-namestringWebhook name
-secretstringremoved; use --secret-file
-secret-filestringfile holding the webhook secret, '-' for stdin (or OA_WEBHOOK_SECRET)
-urlstringWebhook URL

SBOM ​

text
sbom list <repo>                   List SBOMs for repository
sbom generate <repo> --artifact-id ID [--format cyclonedx|spdx|spdx-json|spdx3-json] [--spec-version V]
                                   Generate an SBOM for one artifact (CycloneDX 1.4-1.6, SPDX 2.3)
sbom show <repo> <id>              Show SBOM
sbom download <repo> <id> <dest> [--attest true|bundle]   Download SBOM (or its signed attestation)
sbom delete <repo> <id>            Delete SBOM
vex get <repo> [--artifact-id ID] [--format openvex|cyclonedx] [--spec-version V] [--output FILE] [--attest true|bundle]
                                   VEX document of an artifact or the whole repository (stdout without --output)
vex list <repo> [--artifact-id ID] List recorded VEX decisions
vex set <repo> --artifact-id ID --vuln CVE --status S [--justification J] [--impact TEXT] [--action TEXT]
                                   Record a VEX decision (not_affected requires --justification)
vex delete <repo> <id>             Delete a VEX decision
dtrack show|test|pushes <repo>     Dependency-Track integration of a repository
dtrack push <repo> --artifact-id ID   Push an artifact to Dependency-Track

Vulnerability scanning ​

text
vuln scan <repo> --artifact-id ID --package P --version V --ecosystem E [--scanner osv|trivy|grype]
                                   Scan one package for vulnerabilities
vuln list <repo>                   List vulnerability scans
vuln show <repo> <id>              Show vulnerability scan
vuln quarantine <repo> <id>        Quarantine vulnerable package
vuln delete <repo> <id>            Delete vulnerability scan

License scanning ​

text
license scan <repo> --artifact-id ID  Scan one artifact for license issues
license list <repo>                List license scans
license show <repo> <id>           Show license scan

Secret scanning ​

text
secret scan <repo> --artifact-id ID [--content-file F|-]  Scan one artifact (and optional content) for secrets
secret list <repo>                 List secret scans
secret show <repo> <id>            Show secret scan
secret quarantine <repo> <id>      Quarantine secret
secret delete <repo> <id>          Delete secret scan

Cleanup policies ​

text
cleanup list <repo>                List cleanup policies
cleanup create <repo> --name N [--keep-count N] [--keep-days N] [--name-pattern RE] [--schedule CRON] [--enabled=false]
                                   Create cleanup policy (needs --keep-count or --keep-days)
cleanup show <repo> <id>           Show cleanup policy
cleanup update <repo> <id> [same flags]  Update cleanup policy
cleanup delete <repo> <id>         Delete cleanup policy
cleanup run <repo> <id>            Run cleanup policy now

Storage quotas ​

text
quota show <repo>                  Show repository quota
quota set <repo> [--limit N --unit MB|GB|TB] [--max-artifacts N] [--warn-percent P]  Set quota
quota delete <repo>                Remove quota

Artifact properties ​

text
props list <repo> <artifact-id>    List artifact properties
props set <repo> <artifact-id> <key> <value>  Set property
props delete <repo> <artifact-id> <key>       Delete property
props search <repo> <key> <value>  Search artifacts by property

CI (see docs/integrations/ci.md) ​

text
upload <repo> <file|glob>... [--target-path P] [--flat] [--property k=v]... [--build-name N] [--build-number M] [--build-url U] [--vcs-revision SHA]
                                   Upload files to a raw/maven/ivy/sbt/deb/rpm repository and set build properties
bundle create <name> <version> [--description D] [--pipeline P]
                                   Create a draft release bundle
bundle add <name> <version> --repo R --path P... | --from-build NAME/NUMBER [--repo R]...
                                   Add artifacts to a draft bundle, by path or by the build that produced them
bundle seal <name> <version> [--gpg-key K]  Seal a bundle (optionally sign its manifest)
bundle show <name> <version>       Show a bundle and its items
promote <name> <version> --stage S [--target-repo R] [--notes T]
                                   Promote a sealed bundle to a pipeline stage

oa upload ​

FlagValueDescription
-build-namestringBuild name, recorded as property build.name
-build-numberstringBuild number, recorded as property build.number
-build-urlstringBuild URL, recorded as property build.url
-flatnoneDrop the local directories: upload every file by its name
-propertyvalueProperty k=v set on every uploaded artifact (repeatable)
-target-pathstringPath in the repository; a trailing / makes it a directory (default: the file's path)
-vcs-revisionstringSource revision, recorded as property vcs.revision

oa bundle ​

text
Usage: oa bundle <create|add|seal|show> <name> <version> [flags]
  oa bundle create <name> <version> [--description D] [--pipeline P]
  oa bundle add <name> <version> --repo R --path P... | --from-build NAME/NUMBER [--repo R]...
  oa bundle seal <name> <version> [--gpg-key K]
  oa bundle show <name> <version>

oa bundle create ​

FlagValueDescription
-descriptionstringBundle description
-pipelinestringPromotion pipeline, by name (needed to promote the bundle later)

oa bundle add ​

FlagValueDescription
-from-buildstringAdd every artifact recorded for build NAME/NUMBER (properties build.name and build.number)
-pathvalueArtifact path in --repo (repeatable)
-repovalueRepository of the artifacts (repeatable with --from-build to limit the search)

oa bundle seal ​

FlagValueDescription
-gpg-keystringSign the manifest with this GPG key (id as the server lists it)

oa bundle show ​

text
Usage of bundle show:

oa promote ​

FlagValueDescription
-notesstringPromotion notes
-stagestringPipeline stage to promote to (required)
-target-repostringRepository to promote into (default: the one the stage fixes)

Migration ​

text
import nexus|artifactory --source-url URL --repo SRC[:DST]... [--dry-run] [--create-repos]
                                   [--concurrency N] [--state-file F]  Import from Nexus / Artifactory

oa import nexus ​

FlagValueDescription
-artifactory-listingstringArtifactory listing mode: aql or storage (default "aql")
-concurrencyintparallel transfers (default 4)
-create-reposnonecreate missing destination repositories (hosted, matching format)
-deb-componentstringfallback Debian component when the source does not say
-deb-distributionstringfallback Debian distribution when the source does not say
-dry-runnoneprint the plan without writing anything
-path-prefixstringonly import assets whose repository path starts with this prefix (e.g. com/acme/)
-propertiesstringproperties to copy: comma-separated keys or prefix* patterns, 'none' to disable (default "deb.,rpm.,build.name,build.number,vcs.*")
-quietnoneonly print the summary
-repovaluerepository to import as SRC or SRC:DST (repeatable)
-retriesintretries after a transient failure of a source request or an upload (0 disables) (default 3)
-retry-max-waitdurationlongest wait between retries; a Retry-After above it is not waited out (default 30s)
-source-token-filestringfile holding the source token/password, '-' for stdin (or OA_IMPORT_SOURCE_TOKEN)
-source-urlstringbase URL of the source system
-source-userstringsource user name (or OA_IMPORT_SOURCE_USER)
-state-filestringresume file: completed assets are skipped on the next run

oa import artifactory ​

Same flags as oa import nexus.

Declarative configuration (admin) ​

text
apply -f FILE|DIR|- [-R] [--kind K] [--prune|--prune-all] [--force-secrets] [--continue-on-error] [--validate-only] [-o json]
                                   Make the server match the YAML manifests
diff  -f FILE|DIR|- [-R] [--kind K] [--prune|--prune-all] [-o json]
                                   Show what apply would change (exit 0 none, 2 changes, 1 error)
export [--kind K] [--with-members] [-o DIR]
                                   Write the current configuration as manifests

oa apply ​

FlagValueDescription
-RnoneDescend into subdirectories of -f directories
-continue-on-errornoneKeep applying after a failure (exit status is still 1)
-fvalueManifest file, directory or - for stdin (repeatable)
-force-secretsnoneSend every secret even if the server reports it as set
-kindvalueOnly consider this kind (repeatable), e.g. Repository
-ostringOutput format: json (default: human readable)
-prunenoneDelete objects previously applied by oa that are no longer in the manifests
-prune-allnoneDelete every object absent from the manifests, managed or not (never seeded objects; Users only with --kind User)
-validate-onlynoneValidate the manifests offline and exit

oa diff ​

FlagValueDescription
-RnoneDescend into subdirectories of -f directories
-fvalueManifest file, directory or - for stdin (repeatable)
-force-secretsnoneSend every secret even if the server reports it as set
-kindvalueOnly consider this kind (repeatable), e.g. Repository
-ostringOutput format: json (default: human readable)
-prunenoneDelete objects previously applied by oa that are no longer in the manifests
-prune-allnoneDelete every object absent from the manifests, managed or not (never seeded objects; Users only with --kind User)

oa export ​

FlagValueDescription
-kindvalueOnly export this kind (repeatable); User is exported only when named
-ostringWrite one file per object into this directory (default: one YAML stream on stdout)
-with-membersnoneInclude fields normally omitted, such as Group members

Package deltas ​

text
delta list <repo> <pkg-id>         List available deltas for package
delta get <repo> <pkg-id> --from <sha256> <dest>  Download delta patch

System ​

text
system info                        Show system information

Utility ​

text
version                            Show CLI version (--format json for machine use)
help                               Show this help

Free software under the AGPL-3.0-or-later.