Skip to content
NewNexus 2.0 is here, and it’s open source. Read the launch post

CLI reference

service-accounts

Service accounts (owners and admins): callers for CI and scripts that are no member and hold no seat. Each holds keys (nxsa_…) that you issue, rotate and revoke; a token is shown once.

View as Markdown

nexus service-accounts list

nexus service-accounts list

The organization's service accounts and their keys (owners and admins).

nexus service-accounts create

nexus service-accounts create --name <name> --team <slug> [--owner <user-id>] --expires <YYYY-MM-DD|30d> [--dry-run]

Create a service account: a caller for CI and scripts that is no member and holds no seat (owners and admins).

OptionMeaning
--name <name>The service account's name (1 to 64 characters)
--team <slug>The team that owns it, by slug or id: its keys stop when the team is deleted
--owner <user-id>The member who answers for it, by user id (default: you): its keys stop when they leave the organization
--expires <YYYY-MM-DD|30d>When it stops working: a day (YYYY-MM-DD, UTC, the whole day) or a duration (30d, 12h or a number of days); at most 365 days from now
--dry-runShow what would change, change nothing
Examples
nexus service-accounts create --name ci --team web --expires 90d --dry-run
nexus service-accounts create --name ci --team web --expires 2027-01-31

nexus service-accounts revoke

nexus service-accounts revoke <id> [--dry-run]

Revoke a service account and stop every live key it holds (owners and admins).

OptionMeaning
--dry-runShow what would change, change nothing
Examples
nexus service-accounts revoke sva_… --dry-run

nexus service-accounts keys create

nexus service-accounts keys create <account id> --label <label> [--expires <YYYY-MM-DD|30d>]

Issue a key for a service account: its token (nxsa_…) is shown once.

OptionMeaning
--label <label>A name for the key (1 to 80 characters), to tell keys apart
--expires <YYYY-MM-DD|30d>When the key stops working: a day or a duration, as for the account, and not past the account's own (default: 90 days from now)
Examples
nexus service-accounts keys create sva_… --label github-actions

nexus service-accounts keys rotate

nexus service-accounts keys rotate <account id> <key id> [--label <label>] [--expires <YYYY-MM-DD|30d>]

Issue a new key in place of one and stop the old one at once: it keeps the label and lifetime unless you set them; the new token is shown once.

OptionMeaning
--label <label>A name for the new key (1 to 80 characters); the old key's name by default
--expires <YYYY-MM-DD|30d>When the new key stops working: a day or a duration, as for the account, and not past the account's own (default: as long as the old key lived)
Examples
nexus service-accounts keys rotate sva_… sak_…

nexus service-accounts keys revoke

nexus service-accounts keys revoke <account id> <key id>

Revoke one key at once.

Generated from the CLI's own command list (nexus help --json), version 0.45.0. nexus help and nexus <command> --help always show your installed version.