The command line for AuthForge: manage apps, licenses, webhooks and the authentication log from a terminal, a script or CI.
Run authforge with no arguments for the interactive mode above. Run it with a command for one result and an exit code: every command takes flags, and --json for scripts.
npm install -g authforgeNeeds Node.js 22.12 or later. Works in PowerShell and Windows Terminal, and in any terminal on macOS and Linux. To try it without installing: npx authforge.
authforge loginThis shows a short code and opens the pairing page in your browser. There you see what the key will be allowed to do, choose how long it lives (7, 30 or 90 days) and approve. No password is typed in the terminal.
The key is stored in the operating system's credential store: Windows Credential Manager, the macOS Keychain, or the Secret Service (GNOME Keyring, KWallet) on Linux. Where there is none, it goes into a file only your user account can read. authforge login and authforge whoami both say which one is in use. The whole key is never printed, only its first characters.
By default the key may read and write apps and licenses, read logs and read the account. Ask for something else with --scopes:
authforge login --scopes all # also pausing and deleting apps, and webhooks
authforge login --scopes read # a key that can only look
authforge login --scopes +admin:apps,+write:webhooks # what you have now, plus twoauthforge logout revokes the key and removes it from the machine.
authforge use "My Game" # the app the next commands work on
authforge licenses create --days 30 # issue a 30-day license
authforge licenses list --status active
authforge licenses show A3K9-BFWX-7NP2-QHDT
authforge licenses revoke A3K9-BFWX-7NP2-QHDT
authforge logs tail --failures # watch failed authentications liveauthforge <command> --help describes every flag, the scope the command needs, and gives examples.
authforge on its own opens a full-screen view: your apps, each app's licenses, a live log, webhooks with their deliveries, and your account. It leaves the terminal as it found it.
| An app's licenses | The live log |
|---|---|
![]() |
![]() |
| Key | Does |
|---|---|
↑ ↓ or j k |
Move. g and G jump to the ends, PgUp and PgDn move a page |
Enter |
Open what is selected |
Esc |
Back |
/ |
Filter the list |
? |
Every key on this screen |
a |
Account, key and sign-in |
q or Ctrl+C |
Quit |
Each screen lists its own keys in the bottom line. Anything destructive asks first, and deleting an app asks for its name. An action your key has no scope for is dimmed, and pressing it says which scope is missing.
| Command | What it does |
|---|---|
login, logout, whoami |
Pair this device, sign out, show the key in use |
status |
Credit balance and every app's last 24 hours |
use <app> |
Set the app that commands work on when --app is not given |
apps list, show, create, delete |
Manage apps |
apps pause, unpause, set |
Stop an app's validations; change its credit caps |
apps stats, problems |
Usage, and recent failures grouped by license and reason |
apps vars get, set, unset |
App variables |
licenses list, show, create, delete |
Manage licenses |
licenses revoke, activate, extend |
Change whether and until when a license validates |
licenses reset-hwid, set-devices, set-email |
Devices and the customer email |
licenses vars get, set, unset |
License variables |
licenses import, import-undo |
Bring existing keys in from a CSV file |
licenses offline mint, list, machines, release |
Offline license files |
logs tail, logs search |
Follow the authentication log live; search the last 90 days |
webhooks list, create, update, delete |
Manage webhooks |
webhooks test, rotate-secret, deliveries, replay |
Check and repair deliveries |
security list, block, unblock, allow, unallow |
Device and IP lists for an app |
api <method> <path> |
An authenticated request to any Developer API route |
completion <shell> |
Shell completion for bash, zsh, fish and PowerShell |
An app can be given by ID, by name, or by the start of either. licenses revoke, activate, reset-hwid and delete take several keys at once.
Set AUTHFORGE_API_KEY to a key from the dashboard; nothing is stored and no sign-in is needed.
export AUTHFORGE_API_KEY=af_live_...
export AUTHFORGE_APP="My Game"
# 50 keys, one per line, into a file
authforge licenses create -n 50 --days 365 --label reseller-7 > keys.txt
# Revoke every license of one customer
authforge licenses list --all --json \
| jq -r '.licenses[] | select(.email == "sam@example.com") | .licenseKey' \
| xargs authforge licenses revoke --yesWhat scripts can rely on:
- stdout carries the result and nothing else. Progress, hints and errors go to stderr.
--jsonprints one JSON document (logs tail --jsonprints one object per line). An error is then JSON on stderr:{"error":{"code","message","hint","status"}}.- Piped output is plain. Tables become tab-separated lines with no header and no colour.
- Nothing waits for an answer in a pipeline. Without a terminal, a command that needs a confirmation fails and says to pass
--yes.--no-inputdoes the same on a terminal. - Creating licenses is safe to retry: the request carries an idempotency key.
--waitwaits out a rate limit instead of failing.
| Exit code | Meaning |
|---|---|
| 0 | Done |
| 1 | Failed |
| 2 | Wrong usage: an unknown command or flag, a bad value |
| 3 | Not signed in, key expired or revoked, or a scope is missing |
| 4 | Not found |
| 5 | Rate limited, or a limit of the account was reached |
| 6 | Out of credits |
| 7 | AuthForge could not be reached, or is in maintenance |
| 130 | Interrupted with Ctrl+C |
| Variable | |
|---|---|
AUTHFORGE_API_KEY |
Use this key instead of a stored sign-in |
AUTHFORGE_APP |
The app to work on when --app is not given |
AUTHFORGE_KEY_STORAGE |
Where login keeps the key: keychain or file |
AUTHFORGE_CONFIG_DIR |
Where settings are kept. Default: %APPDATA%\authforge on Windows, $XDG_CONFIG_HOME/authforge or ~/.config/authforge elsewhere |
AUTHFORGE_ASCII |
Set to 1 to draw with plain ASCII characters |
NO_COLOR |
Turn colour off (--no-color does the same) |
authforge completion powershell >> $PROFILE
authforge completion bash > ~/.local/share/bash-completion/completions/authforge
authforge completion zsh > ~/.zfunc/_authforge
authforge completion fish > ~/.config/fish/completions/authforge.fishErrors say what happened and what to do next. The common ones:
- "This key lacks write:licenses": the key was paired without that scope.
authforge login --scopes +write:licensespairs a new one that has it. - "Your key expired": keys paired by
loginlive 7, 30 or 90 days. Runauthforge loginagain. - Rate limited: wait the time the message names, or pass
--wait. - Out of credits: buy more at app.authforge.cc/buy-credits.
--debug prints each API request to stderr, without the key.
- This CLI: docs.authforge.cc/cli
- The API it talks to: docs.authforge.cc
- Protecting your own software with AuthForge is the job of the SDKs, for example
@authforgecc/sdkfor Node.js. This package is the management tool, not an SDK.
npm ci
npm run check # type-check, tests, build, and a smoke run of the built binary
npm run dev # build and open the interactive modeThe tests run every command and the interactive mode against a local fake of the API; nothing talks to the real service.
The pictures in media/ are made by npm run media: it records the real interactive mode and commands against that same fake API with made-up data (test/media-demo.ts), draws the frames as a terminal window and photographs them. It needs Edge, Chrome or Chromium and ffmpeg; run it again after changing how a screen looks.
A tag publishes. Raise the version, push the commit and its tag, and .github/workflows/release.yml checks the tag against package.json, runs npm run check and publishes to npm with provenance:
npm version patch # or minor, major: edits package.json and the lockfile, commits, tags vX.Y.Z
git push origin main --follow-tagsNo npm token is stored: the package on npmjs.com names this repository and release.yml as its trusted publisher.
The authforge name on npm belonged to Hosung (devho, devho.net), who generously handed it over so the CLI could have it. Thank you, Hosung. Versions 1.x of this package are his earlier, unrelated project; the CLI begins at 2.0.0.
MIT



