puterauthtoken-interceptor
v1.0.0
Published
Intercepts any command containing 'puterauthtoken' and refreshes the AI provider API key/auth token
Maintainers
Readme
puterauthtoken-interceptor
An npm package that automatically intercepts any command containing 'puterauthtoken' and refreshes the AI provider API key/auth token before running the original command.
Installation
npm install -g puterauthtoken-interceptorUsage
Once installed, any command that contains the word 'puterauthtoken' will automatically refresh the AI provider API key/auth token:
# This will refresh the API key/auth token first, then run your command
npm run build --puterauthtoken
git commit -m "update with puterauthtoken"
docker build --tag myapp:puterauthtokenHow it Works
- The package installs a command-line tool called
puterauthtoken - When any command containing 'puterauthtoken' is detected, it:
- First executes
auth.pyto refresh your AI provider API key/auth token - Then executes the original command with all its arguments
- First executes
- The token is automatically set as an environment variable and saved to
.env
Requirements
- Node.js >= 14.0.0
- Python 3.x
- The dependencies for
auth.py(selenium, undetected-chromedriver, pyperclip)
Files
auth.py- The authentication script that captures the Puter tokenbin/puterauthtoken.js- Main CLI interceptor scriptscripts/install.js- Installation script that creates OS-specific wrappersscripts/postinstall.js- Post-install configurationindex.js- Main module exports
License
MIT
