keypaste token
Creates, lists and revokes scoped tokens, which only feed keypaste run --token or --bundle: a token injects an environment’s stage into a command and never prints a value.
Synopsis
Section titled “Synopsis”keypaste token create <name> --scope <scopes> [--ttl <n(m|h|d)>] [--allow-prod] [--json]keypaste token ls [--json]keypaste token revoke <name|id>keypaste token bundle <name> -o <file> [--force] [--token <token|-|env>]Every verb also takes --vault <path> and --keyfile <path>. create and revoke change the vault, so lock it in the app or stop keypaste approve first.
Options
Section titled “Options”| Option | Verbs | Effect |
|---|---|---|
--scope <scopes> | create | Required. What it may inject: read:<project>/<stage>/<KEY or *>, several separated by commas. |
--ttl <n(m|h|d)> | create | How long it works, 30d by default. |
--allow-prod | create | Lets it reach a protected stage, which then asks you live every time. |
--json | create, ls | Machine-readable output. |
-o, --output <file> | bundle | Required. Where to write the bundle. |
--force | bundle | Replace a file that is there. |
--token <token|-|env> | bundle | The token, which the process holding the vault checks. - reads it from standard input, env from KEYPASTE_TOKEN. |
Behaviour
Section titled “Behaviour”createprints the token once and never stores it.lslists each token’s name, prefix, scope and expiry, never a secret. The app’s Settings › Scoped tokens lists and revokes them too.keypaste run --tokenasks the desktop app orkeypaste approveholding the vault, so the job must reach that process.bundleseals the token’s sets into a file thatkeypaste run --bundleopens with the token alone, with no vault. It never holds a protected stage. A bundle can’t be revoked, and its expiry is checked against the job’s own clock, so rotate its values once it is retired or may have leaked.
Examples
Section titled “Examples”keypaste token create ci-staging --scope 'read:acme-api/staging/*'KEYPASTE_TOKEN=… keypaste run --token env -p staging acme-api -- npm testkeypaste token bundle ci-staging -o staging.bundle --token envkeypaste run --bundle staging.bundle --token env -- npm testkeypaste token revoke ci-staging