Skip to main content
Service accounts provide machine-to-machine authentication for CI/CD pipelines and automated workflows. Once created, their tokens can be passed via the NSCALE_SERVICE_TOKEN environment variable. Aliases: serviceaccounts, sa

Subcommands

  • list — List service accounts
  • get — Get service account details
  • create — Create a new service account
  • update — Update an existing service account
  • rotate — Rotate a service account token
  • delete — Delete a service account

list

List service accounts in an organization.
nscale serviceaccounts list --org <org-id> [flags]

Flags

FlagDescription
--org stringOrganization ID
--jsonOutput in JSON format

get

Get details for a specific service account in JSON format.
nscale serviceaccounts get --id <sa-id> --org <org-id>

Flags

FlagDescription
--id stringService account ID
--org stringOrganization ID

create

Create a new service account. Supports interactive mode or JSON input.
nscale serviceaccounts create --org <org-id> [flags]

Flags

FlagDescription
--org stringOrganization ID
-f, --file stringPath to a JSON file
--stdinRead JSON from standard input
--dry-runPreview the request payload without persisting
-y, --yesAutomatically confirm creation

Examples

nscale serviceaccounts create --org <org-id> --file serviceaccount.json
nscale serviceaccounts create --org <org-id> --stdin < serviceaccount.json
# Interactive mode
nscale serviceaccounts create

update

Update an existing service account.
nscale serviceaccounts update --org <org-id> --id <sa-id> [flags]

Flags

FlagDescription
--id stringService account ID
--org stringOrganization ID
-f, --file stringPath to a JSON file
--stdinRead JSON from standard input
--dry-runPreview the request payload without persisting
-y, --yesAutomatically confirm update

Examples

nscale serviceaccounts update --org <org-id> --id <sa-id> --file serviceaccount.json
nscale serviceaccounts update --org <org-id> --id <sa-id> --stdin < serviceaccount.json

rotate

Rotate the access token for a service account. The old token is invalidated and a new one is returned.
nscale serviceaccounts rotate --org <org-id> --id <sa-id> [flags]

Flags

FlagDescription
--id stringService account ID
--org stringOrganization ID
--dry-runPreview the request payload without persisting
-y, --yesAutomatically confirm token rotation

Example

nscale serviceaccounts rotate --org <org-id> --id <sa-id> --yes

delete

Delete an existing service account.
nscale serviceaccounts delete --org <org-id> --id <sa-id> [flags]

Flags

FlagDescription
--id stringService account ID
--org stringOrganization ID
--dry-runPreview the request payload without persisting
-y, --yesAutomatically confirm deletion