Skip to main content

Pat Management

Manage Personal Access Tokens (PAT) securely stored in your operating system's keychain.

Usage

gpx pat <subcommand> <profile_name>

Subcommands

SubcommandDescription
setInteractively set or rotate a PAT for a profile
clearSecurely remove a stored PAT from your operating system keychain

Options

OptionDescription
--pat <token>Pass the token directly to bypass interactive prompts

Examples

Set a PAT interactively

You can set a PAT token interactively. gpx will prompt you to securely enter your Personal Access Token.

gpx pat set freelance

Set a PAT non-interactively

gpx pat set freelance --pat "github_pat_11ABC..."

Clear a stored PAT

To securely remove a stored PAT from your operating system credential manager (or local secure file on Windows):

gpx pat clear freelance

What happens behind the scenes

When you set a PAT, gpx validates it against the GitHub API. If valid, it stores it securely using:

  • macOS: Keychain Access (security CLI)
  • Linux: Secret Service API / GNOME Keyring (secret-tool)
  • Windows: Secure per-profile JSON file (~/.gpx/credentials/)

When you clear a PAT, gpx asks the respective OS credential manager (or deletes the file on Windows) to delete the secret permanently.

  • gpx add - Create a new profile (including PAT profiles).
  • gpx doctor - Diagnose if your PAT authentication is working properly.