Authentication Guide
GitHub Commander requires authentication with GitHub to access most features. This guide will help you set up authentication using a GitHub Personal Access Token.
Why Authentication is Required
GitHub Commander needs authentication to:
- Access your repositories
- Upload and download files
- Manage wikis and pages
- Create releases
- Perform Git operations
Setting Up Your GitHub Token
Step 1: Generate a Personal Access Token
- Go to GitHub.com
- Click on your profile picture → Settings
- Navigate to Developer settings → Personal access tokens → Tokens (classic)
- Click "Generate new token (classic)"
- Enter a descriptive note (e.g., "GitHub Commander")
- Select the following scopes:
Required Scopes:
repo - Full control of private repositories
workflow - Update GitHub Action workflows
delete_repo - Delete repositories
Optional Scopes:
Step 2: Add Token to GitHub Commander
- Launch GitHub Commander
- Click on "Settings" in the main menu or press
Ctrl+,
- Find the "GitHub Token" field
- Paste your Personal Access Token
- Click "Save"
The token will be saved securely in ~/.github-commander/config.json.
Token Security
Best Practices
- Never share your token with anyone
- Don't commit tokens to repositories
- Use short expiration periods (30-90 days)
- Rotate tokens regularly for better security
- Use different tokens for different applications
- Revoke unused tokens from GitHub settings
Where Tokens Are Stored
Your token is stored locally in:
~/.github-commander/config.json
This file is only accessible by your user account. Ensure your system is secured with proper permissions.
Revoking a Token
If your token is compromised or no longer needed:
- Go to GitHub.com → Settings → Developer settings → Personal access tokens
- Find the token you want to revoke
- Click "Delete" or "Revoke"
- Generate a new token if needed
- Update the token in GitHub Commander settings
Verifying Authentication
After adding your token, verify it works:
- Try to list your repositories
- If successful, your token is working correctly
- If you get an error, check:
- Token is correct (no extra spaces)
- Token has required scopes
- Token hasn't expired
- You have internet connection
Common Authentication Issues
"Failed to authenticate" Error
Possible causes:
- Invalid or expired token
- Token lacks required scopes
- Network connectivity issues
Solutions:
- Verify token is correct
- Check token expiration date
- Ensure token has
repo, workflow, and delete_repo scopes
- Test your internet connection
- Regenerate the token if necessary
"Insufficient permissions" Error
Possible causes:
- Token lacks specific scope for the operation
- Repository access restrictions
- Organization policies
Solutions:
- Add additional scopes to your token
- Ensure you have access to the repository
- Check organization permissions
- Contact repository owner if needed
Two-Factor Authentication
If you have 2FA enabled on GitHub:
- Personal Access Tokens bypass 2FA
- No additional configuration needed
- Tokens work the same way with or without 2FA
Using Environment Variables (Advanced)
For enhanced security, you can use environment variables instead of storing the token in config:
-
Set environment variable:
:::bash
export GITHUB_TOKEN="your-token-here"
-
Modify the application to read from environment (requires code changes)
This is an advanced configuration and not enabled by default.
Next Steps
After successful authentication, proceed to Repository Management to start using GitHub Commander.