Skip to content

CLI Reference

Terminal window
# Run without installing
npx @humanauth/cli <command>
# Or install globally
npm install -g @humanauth/cli
humanauth <command>

Create a new pairing with the HARP app by generating a QR code.

Terminal window
humanauth pair --name <name> [--relay <url>]

Flags:

FlagRequiredDefaultDescription
--name <name>YesHuman-readable name for this pairing
--relay <url>Nohttps://relay.humanauth.aiRelay service URL

Example:

Terminal window
humanauth pair --name "my-laptop" --relay https://relay.humanauth.ai

Output:

HARP Pairing QR Code
=====================
Scan this QR code with the HARP app on your phone.
[QR code displayed in terminal]
Platform: my-laptop
Relay: https://relay.humanauth.ai
Expires: 5 minutes
Waiting for app to complete pairing...
Pairing complete!
pair_id: pair_a1b2c3d4e5f6
name: my-laptop
relay: https://relay.humanauth.ai
Pairing saved to ~/.harp/pairings/my-laptop.json

List all saved pairings.

Terminal window
humanauth list

Example output:

NAME PAIR_ID RELAY PAIRED
my-laptop pair_a1b2c3d4e5f6 https://relay.humanauth.ai 2026-04-10
work-server pair_x7y8z9w0v1u2 https://relay.humanauth.ai 2026-04-11

Revoke a pairing. Removes the local pairing file and notifies the relay.

Terminal window
humanauth revoke --name <name>

Flags:

FlagRequiredDescription
--name <name>YesName of the pairing to revoke

Example:

Terminal window
humanauth revoke --name "work-server"

Output:

Pairing "work-server" revoked.
Relay notified: DELETE /v1/pairs/pair_x7y8z9w0v1u2
Local file removed: ~/.harp/pairings/work-server.json

Send a test authorization request through HARP. Useful for verifying that pairing and push notifications work.

Terminal window
humanauth request --name <name> --action <action> --description <desc> [--ttl <seconds>]

Flags:

FlagRequiredDefaultDescription
--name <name>YesName of the pairing to use
--action <action>YesAction identifier
--description <desc>YesHuman-readable description
--ttl <seconds>No300Timeout in seconds (max 600)

Example:

Terminal window
humanauth request \
--name "my-laptop" \
--action "test_approval" \
--description "This is a test authorization request" \
--ttl 120

Output:

Sending authorization request...
request_id: req_m3n4o5p6q7r8
pair_id: pair_a1b2c3d4e5f6
action: test_approval
ttl: 120s
Waiting for response...
Response received!
decision: approved
timestamp: 2026-04-12T10:30:45Z
signature: verified
VariableDefaultDescription
HARP_PAIRINGS_DIR~/.harp/pairingsDirectory for saved pairing files
CodeMeaning
0Success
1General error (invalid args, network error)
2Request denied
3Request expired (TTL elapsed)