Skip to content

avr token

Create and manage scoped access tokens.

Terminal window
avr token [OPTIONS] COMMAND [ARGS]...

A scoped access token is a credential bound to one organization that expires within seven days. It reaches only the repositories and VMs it names, and it cannot create further tokens. To use one, set AVR_TOKEN to the credential and AVR_ORG to the organization ID.

Create a scoped token and print its credential.

Terminal window
avr token create [OPTIONS]

The credential is shown once and cannot be retrieved later. A token needs at least one of --repo, --vm or --allow-vm-create. Repository grants are read-only and VM grants are admin; an optional level suffix (--repo acme/api:read, --vm cvm-abc123:admin) must name that level.

The command prints export lines for AVR_TOKEN and AVR_ORG. A scoped token needs the org-... ID in AVR_ORG or --org, ignores the stored organization and cannot create further tokens. Pass run IDs rather than console URLs, whose organization slug a scoped token cannot resolve. If the request is interrupted or the server answers with a 5xx error, a token may already exist: check avr token list before retrying. A 404 names its reason; if scoped tokens are not enabled for the organization, contact support@avrea.com.

Terminal window
Examples:
avr token create --name ci-read --repo acme/api --repo acme/web
avr token create --name agent --vm cvm-abc123 --ttl 30m
avr token create --name sandbox --allow-vm-create --vm-create-limit 3
avr token create --name ci-read --repo acme/api --json token --jq .token
Terminal window
JSON FIELDS
allow_vm_create, created_at, expires_at, grants, id, last_used_at,
name, organization_id, revoked_at, revoked_reason, token, user_id,
vm_create_count, vm_create_limit

Options

  • --name <TEXT> — Token name (1-100 characters). (required)
  • --repo, -R <TEXT> — Grant read access to a repository (org/repo or rep-xxx). Repeatable. (repeatable)
  • --vm <TEXT> — Grant admin access to a VM, by VM ID. Repeatable. (repeatable)
  • --allow-vm-create — Let the token create VMs.
  • --vm-create-limit <INTEGER RANGE> — Max VMs the token may create; needs --allow-vm-create. The server default is 1.
  • --ttl <TEXT> — Lifetime: e.g. 30m, 8h, 7d, or a number of seconds. 60 seconds to 7 days; the server default is 8 hours.
  • --org, -o <TEXT> — Organization ID or slug. Uses default org if not specified (see: avr config set org).
  • --json <TEXT> — Output JSON. Pass comma-separated field names, "*" for all fields, or "?" to list available fields.
  • -q, --jq <TEXT> — Filter --json output through a jq expression.

List live tokens, newest first.

Terminal window
avr token list [OPTIONS]

Shows your own tokens, or every member's when you are an organization admin. Revoked and expired tokens are not listed; avr token view still reads them by ID.

Terminal window
Examples:
avr token list
avr token list --json id,name,expires_at
Terminal window
JSON FIELDS
allow_vm_create, created_at, expires_at, grants, id, last_used_at,
name, organization_id, revoked_at, revoked_reason, user_id,
vm_create_count, vm_create_limit

Options

  • --org, -o <TEXT> — Organization ID or slug. Uses default org if not specified (see: avr config set org).
  • -L, --limit <INTEGER RANGE> — Max tokens to return. (default: 50)
  • --json <TEXT> — Output JSON. Pass comma-separated field names, "*" for all fields, or "?" to list available fields.
  • -q, --jq <TEXT> — Filter --json output through a jq expression.

Revoke a token.

Terminal window
avr token revoke [OPTIONS] TOKEN_ID

Requests made with the token are refused from then on. Revoking a token that is already revoked succeeds.

Terminal window
Examples:
avr token revoke <token-id>
avr token revoke <token-id> --yes

Arguments

  • TOKEN_ID

Options

  • --org, -o <TEXT> — Organization ID or slug. Uses default org if not specified (see: avr config set org).
  • --yes, -y — Skip the confirmation prompt.

Show a token's details and grants, including a revoked or expired one.

Terminal window
avr token view [OPTIONS] TOKEN_ID

The credential itself is never shown again after avr token create.

Terminal window
Examples:
avr token view <token-id>
avr token view <token-id> --json grants
Terminal window
JSON FIELDS
allow_vm_create, created_at, expires_at, grants, id, last_used_at,
name, organization_id, revoked_at, revoked_reason, user_id,
vm_create_count, vm_create_limit

Arguments

  • TOKEN_ID

Options

  • --org, -o <TEXT> — Organization ID or slug. Uses default org if not specified (see: avr config set org).
  • --json <TEXT> — Output JSON. Pass comma-separated field names, "*" for all fields, or "?" to list available fields.
  • -q, --jq <TEXT> — Filter --json output through a jq expression.