ghtk
v0.0.1
Published
One-click setup for GitHub Packages npm registry auth. No more 403 errors when installing private packages locally.
Maintainers
Readme
ghtk(github packages token configurator)
One-click setup for GitHub Packages npm registry auth. No more annoying 403 errors when installing private packages during local development.
What it does
- Auto-detects and installs
ghCLI if not present (macOS/Linux/Windows) - Runs
gh auth loginwithread:packages,reposcopes (interactive GitHub auth) - Prompts for org scopes — enter one or more (e.g.
@theplant @my-org) - Writes
~/.npmrcwith the correct registry and auth token, sonpm installjust works
Install
npm install -g ghtkOr use directly with npx:
npx ghtkUsage
ghtkYou'll see an interactive flow:
🔧 GitHub Packages npm registry configurator
✅ gh CLI is available.
Enter the GitHub org scopes to configure for npm.pkg.github.com.
You can enter one or more scopes separated by spaces.
Example: @theplant @my-org
Scopes: @theplant @another-orgAfter completing GitHub auth, your ~/.npmrc will be configured:
@theplant:registry=https://npm.pkg.github.com
@another-org:registry=https://npm.pkg.github.com
//npm.pkg.github.com/:_authToken=ghp_xxxxxxxxxxxxPlatform Compatibility
Auto-install gh CLI support:
- [x] macOS — via Homebrew (
brew install gh) - [ ] Linux (Debian/Ubuntu) — via apt
- [ ] Linux (Fedora/RHEL/CentOS) — via dnf
- [ ] Windows — via winget
Test
npm testLinks
- npm: https://www.npmjs.com/package/ghtk
- GitHub: https://github.com/danni-cool/github-packge-ght
License
MIT
