Overview
PATs are an alternative to OAuth for:- CI/CD pipelines
- Automated scripts
- API integrations
- Command-line tools
- A unique identifier
- Scoped permissions
- Optional expiration date
- Audit trail of usage
Quick Start
Creating Tokens
Basic Token
Token with Expiration
Token with Limited Scopes
Token Scopes
| Scope | Description |
|---|---|
repo:read | Read repository data (clone, fetch, view) |
repo:write | Write repository data (push, create branches) |
repo:admin | Admin operations (delete, settings) |
user:read | Read user profile information |
user:write | Update user profile |
View Available Scopes
Managing Tokens
List Tokens
Revoke Token
Using Tokens
Environment Variable
In CI/CD
GitHub Actions
GitLab CI
Jenkins
In Scripts
API Usage
Security Best Practices
1. Use Minimal Scopes
Only request the permissions you need:2. Set Expiration
For CI/CD tokens, set reasonable expiration:3. Use Secrets Management
Never hardcode tokens:4. Rotate Regularly
Create new tokens and revoke old ones periodically:5. Audit Usage
Monitor token usage:Token Format
wit tokens follow this format:wit_- Identifies as a wit token<prefix>- First 8 characters (visible in UI)<random>- Cryptographically secure random string
Comparison with Other Auth Methods
| Method | Best For | Expiration | Revocable |
|---|---|---|---|
| Personal Access Token | CI/CD, scripts | Configurable | Yes |
| OAuth (GitHub) | Interactive login | Session | Via GitHub |
| SSH Keys | Git operations | Never | Yes |
API Reference
Create Token
List Tokens
Revoke Token
Troubleshooting
Token not working
Token not working
Check that:
- Token is set correctly:
echo $WIT_TOKEN - Token hasn’t expired:
wit token list - Token has required scopes for the operation
Lost token
Lost token
Tokens cannot be retrieved after creation. You must:
- Revoke the old token:
wit token revoke <id> - Create a new one:
wit token create <name>
Permission denied
Permission denied
The token may lack required scopes:
Related
- GitHub Integration - OAuth-based authentication
- Platform Server - Server configuration including SSH
- API Reference - Full API documentation