apptoken
v0.1.1
Published
GitHub App token provider CLI
Readme
apptoken
Generate and cache GitHub App installation tokens locally, then run gh or git with the token injected. The CLI stores your app config and encrypted private key so you can fetch short-lived tokens on demand.
Prerequisites
- Bun (runtime and build tool)
- GitHub CLI (
gh) if you plan to useapptoken gh - Git if you plan to use
apptoken git
Install
npm install -g apptokenOr run with npx:
npx apptoken --helpQuickstart
- Initialize configuration and store your private key:
apptoken init - Start the token daemon (optional, but speeds up repeated requests):
apptoken daemon start - Run GitHub CLI with an injected token:
apptoken gh repo list - Run Git commands against GitHub with an injected token:
apptoken git fetch
Commands
apptoken init- interactive setup (App ID, Installation ID, PEM key, password)apptoken daemon start|stop|status- manage background token daemonapptoken gh <args...>- runghwith a fresh installation tokenapptoken git <args...>- rungitagainst GitHub with a fresh installation token
Create a GitHub App
- Go to GitHub settings:
- Personal: https://github.com/settings/apps
- Organization: https://github.com/organizations//settings/apps
- Create a new GitHub App.
- Set permissions based on the
ghcommands you plan to run. - Generate and download a private key (PEM).
- Install the app on your organization or account.
- Collect the required identifiers:
- App ID: shown in the GitHub App settings page.
- Installation ID: visible after installing the app (or via
gh api /app/installations).
Security Notes
- The private key is encrypted locally using your password.
- The daemon stores tokens in memory and fetches new ones when needed.
- Config and encrypted PEM are stored under the app config directory.
Troubleshooting
- Ensure Bun is installed and on your PATH.
- Ensure
ghis installed if using theapptoken ghcommand. - Ensure
gitis installed if using theapptoken gitcommand. - Run
apptoken --helpfor usage details.
