Reference

apex token

API tokens for scripts and CI: create one (approved in the browser), list yours, revoke one.

Also on the dashboard at /settings/tokens

apex token [command]

Examples

Create a token held to one repository, approved in the browser, and print it once.

apex token create deploy-bot --repo acme/web --expires-in-days 30

Every token you hold, expired and revoked ones included.

apex token list --all

Revoke one token by the id apex token list shows; it stops working at once.

apex token revoke 0b6f1c2e-9d4a-4f7e-8a31-5c2d9e7b1a40

Subcommands

apex token create

Create an API token for a script or CI system, approved in the browser; the token is printed once and not saved

apex token create [options] <name>
Arguments
ArgumentDescription
<name>what the token is for, as the token list will show it (1–100 characters)
Options
OptionDescription
--expires-in-days <days>days until the token expires, 1–90 (default 30)
--repo <owner/repo>hold the token to this repository (repeatable, up to 100); omit for every repository you administer
--no-browserprint the approval URL instead of opening a browser
--jsonprint the token and its details as JSON on stdout

apex token list

Your API tokens — names and last four characters, never the tokens

apex token list [options]
Options
OptionDescription
--allinclude expired and revoked tokens
--jsonmachine-readable output

apex token revoke

Revoke one of your API tokens by id, or all of them; it stops working immediately

apex token revoke [options] [id]
Arguments
ArgumentDescription
[id]the token id, from apex token list
Options
OptionDescription
--allrevoke every token you hold, including the one this CLI is using