Installation
Complete guide to installing and configuring GitHub Achievement CLI.System Requirements
Node.js
Version: 18.0.0 or higherThe CLI requires modern Node.js features and uses ES modules.
Git
Any recent versionRequired to clone the repository and for the CLI’s git operations.
Check Node.js Version
Verify your Node.js installation:Installation Steps
Clone the Repository
Clone from GitHub:
This creates a
GitHub-Achievement-CLI directory in your current location.Install Dependencies
Install all required npm packages:This installs:
@octokit/rest- GitHub API clientink- React for CLI renderingdotenv- Environment variable managementink-select-input,ink-text-input,ink-spinner- UI components- TypeScript and type definitions
Installation typically takes 30-60 seconds depending on your connection.
Build the Project
Compile TypeScript to JavaScript:This:
- Compiles all
.tsxand.tsfiles fromsrc/to JavaScript indist/ - Validates TypeScript types
- Makes the CLI executable
Configuration
The CLI creates a.env file during first run. You can also create it manually:
Manual Configuration
Create.env in the project root:
Getting a GitHub Token
Navigate to Token Settings
Generate New Token
Click Generate new token (classic)
Use classic tokens, not fine-grained tokens. The CLI uses Octokit which works best with classic tokens.
Configure Token
- Note: “GitHub Achievement CLI”
- Expiration: Choose based on preference (90 days recommended)
- Scopes: Select repo (full control of private repositories)
- This includes
repo:status,repo_deployment,public_repo, andrepo:invite
- This includes
Target Repository Setup
The target repository must:- Be owned by you (the token’s user)
- Be accessible with your token (public or private)
- Have Issues enabled (default)
- Optional: Have Discussions enabled (for Galaxy Brain achievement)
Enable Discussions (Optional)
For Galaxy Brain achievement:- Go to your repository on GitHub
- Click Settings tab
- Scroll to Features section
- Check Discussions
- Click Set up discussions
Verification
Confirm everything is working:Troubleshooting
Error: Cannot find module 'dist/index.js'
Error: Cannot find module 'dist/index.js'
Problem: The project hasn’t been built.Solution:Ensure the build completes without TypeScript errors.
Error: Unsupported engine
Error: Unsupported engine
Problem: Node.js version is too old.Solution:
Update Node.js to version 18 or higher:
- Download from nodejs.org
- Or use a version manager like
nvm:
Error: Bad credentials
Error: Bad credentials
Problem: GitHub token is invalid or expired.Solution:
- Verify the token in
.envis correct - Check the token hasn’t expired at github.com/settings/tokens
- Ensure the token has
reposcope - Generate a new token if needed
Error: Not Found (404)
Error: Not Found (404)
Problem: Target repository doesn’t exist or token lacks access.Solution:
- Verify the repository exists:
https://github.com/username/repo - Check
TARGET_REPOformat in.env:username/repo(no spaces, no URL) - Ensure you own the repository
- For private repos, verify token has
reposcope
Build fails with TypeScript errors
Build fails with TypeScript errors
Problem: Corrupted dependencies or version mismatch.Solution:
Rate limit errors during execution
Rate limit errors during execution
Problem: GitHub API rate limits exceeded.Solution:
- The CLI has built-in rate limiting (15 ops/min, 2 concurrent)
- Check your rate limit status: api.github.com/rate_limit
- Wait for the hourly reset (shown in error message)
- The CLI automatically retries with exponential backoff
Discussions not available for Galaxy Brain
Discussions not available for Galaxy Brain
Problem: Repository doesn’t have Discussions enabled.Solution:
- Go to repository Settings
- Check Discussions under Features
- Complete the setup wizard
- Restart the CLI
Alternative: Development Mode
Run without building (for development):tsx to run TypeScript directly. Useful for:
- Testing changes without rebuilding
- Debugging with source maps
- Development workflow
Dev mode requires
tsx which is installed as a dev dependency.File Structure
After installation:Uninstallation
To remove the CLI:- All source code
- Dependencies
- Configuration (
.env) - Progress database (
achievements.db) - Logs
Next Steps
Quickstart Guide
Run your first achievement in 5 minutes
Configuration
Learn about advanced configuration options