Configuration
Customize Grithub's behavior through the interactive configuration interface or direct database access.
Overview
Grithub stores configuration includes:
- Debug mode
- API settings
- Default repository
- Timeout preferences
- Ngrok Auth Token
- Command generation options
Configuration Command
Access the interactive configuration:
grithub configYou'll see:
? Select configuration to set
❯ Debug Mode
API Base URL
Timeout Duration
Skip Long Command Generation
Ngrok Auth Token
Reset Configuration
Enable or disable debug mode (Disabled)
↑↓ navigate • ⏎ selectConfiguration Options
Debug Mode
Enable detailed error messages and logging.
grithub config
# Select "Debug Mode"
# Toggle enabled/disabledWhen enabled:
- Full error stack traces
- Detailed API request/response logs
- Verbose operation output
When disabled:
- Clean error messages
- Minimal output
- Production-ready logging
Example:
# Debug disabled
ERROR: An error occurred
# Debug enabled
ERROR: An error occurred
Stack trace:
at Object.<anonymous> (/path/to/file.ts:123:45)
at Module._compile (node:internal/modules/cjs/loader:1246:14)
...API Base URL
Set the GitHub API base URL.
Default: https://api.github.com
Use cases:
- GitHub Enterprise Server
- API proxy/gateway
- Testing against mock servers
Example:
grithub config
# Select "API Base URL"
# Enter: https://github.company.com/api/v3WARNING
For GitHub.com, always use the default https://api.github.com.
Timeout Duration
Set request timeout in milliseconds.
Default: 3000 (3 seconds)
Recommended values:
- Fast networks:
3000-5000 - Slow/unstable networks:
10000-30000 - Enterprise/VPN:
15000-60000
Example:
grithub config
# Select "Timeout Duration"
# Enter: 10000Skip Long Command Generation
Control whether to skip generating commands with many parameters.
Default: Enabled
When enabled:
- Faster
generate:apisexecution - Skips endpoints with 20+ parameters or very long names
- Reduces generated file size
When disabled:
- Complete API coverage
- Slower generation
- Larger generated file
Example:
grithub config
# Select "Skip Long Command Generation"
# Toggle enabled/disabledNgrok Auth Token
Set Ngrok authentication token for webhook testing.
Example:
grithub config
# Select "Ngrok Auth Token"
# Enter your token: 2abc...Alternative: Set via environment variable
export NGROK_AUTHTOKEN="your_token_here"Reset Configuration
Restore all settings to defaults.
grithub config
# Select "Reset Configuration"
# Confirm resetThis resets:
- Debug mode →
false - API Base URL →
https://api.github.com - Timeout Duration →
3000 - Skip Long Command Generation →
true - Ngrok Auth Token →
undefined
DANGER
Reset does NOT clear authentication token or default repository.
Default Repository
Set your default repository context.
Set Default Repository
grithub set-repo owner/repositoryExamples:
# Direct specification
grithub set-repo toneflix/grithub
# Interactive selection from your repos
grithub set-repo
# From organization repos
grithub set-repo --orgBenefits
Once set, omit --owner and --repo flags:
# Before (without default)
grithub issues:create --title "Bug" --owner toneflix --repo grithub
# After (with default)
grithub issues:create --title "Bug"Change Default Repository
# Set new default
grithub set-repo different-owner/different-repo
# Or interactively
grithub set-repoViewing Current Configuration
Display all settings:
grithub infoOutput includes:
┌─────────────────────-───┬──────────────────────────┐
│ Key │ Value │
├──────────────────────-──┼──────────────────────────┤
│ App Version │ 0.1.6 │
│ Platform │ darwin │
│ CPUs │ 8 │
│ Host │ username@Machine.host │
│ Database Path │ ~/.grithub/app.db │
│ Github User │ youruser (ID: xxxxxxxx) │
│ Default Repo │ toneflix-forks/dummy │
└───────────────────────-─┴──────────────────────────┘Environment Variables
Override configuration via environment variables:
GitHub Token
export GITHUB_TOKEN="ghp_your_token_here"
grithub issues:listAPI Base URL
export GITHUB_API_URL="https://github.company.com/api/v3"
grithub issues:listNgrok Token
export NGROK_AUTHTOKEN="your_ngrok_token"
grithub webhook:listenDebug Mode
export GRITHUB_DEBUG=true
grithub issues:create --title "Test"TIP
Environment variables take precedence over database configuration.
Configuration File Location
All configuration is stored in SQLite:
~/.grithub/
└── app.dbBackup Configuration
cp ~/.grithub/app.db ~/.grithub/app.db.backupRestore Configuration
cp ~/.grithub/app.db.backup ~/.grithub/app.dbTransfer to Another Machine
# On old machine
cp ~/.grithub/app.db /path/to/usb/grithub-config.db
# On new machine
mkdir -p ~/.grithub
cp /path/to/usb/grithub-config.db ~/.grithub/app.dbCommon Configuration Scenarios
Development Environment
grithub config
# Enable debug mode
# Set shorter timeout (3000ms)
# Enable long command generationProduction/CI Environment
grithub config
# Disable debug mode
# Set longer timeout (10000ms)
# Skip long command generation
# Use environment variables for token
export GITHUB_TOKEN="$CI_SECRET_TOKEN"GitHub Enterprise
grithub config
# Set API Base URL to your GHE instance
# Increase timeout (enterprise networks)
# Enable debug for troubleshootingSlow/Unstable Network
grithub config
# Increase timeout to 30000ms
# Enable debug to see retry attemptsTroubleshooting
Configuration Not Persisting
Problem: Changes don't persist after restart
Solution:
Check database permissions:
bashls -la ~/.grithub/app.db chmod 600 ~/.grithub/app.dbVerify database isn't locked:
bashlsof ~/.grithub/app.db
Timeout Errors
Problem: Requests timing out
Solution:
grithub config
# Increase timeout duration to 10000 or higherGitHub Enterprise Issues
Problem: Commands fail with GHE
Solution:
grithub config
# Set correct API Base URL
# Format: https://github.company.com/api/v3
# Enable debug modeReset Everything
Problem: Configuration corrupted
Solution:
# Remove database
rm ~/.grithub/app.db
# Re-login
grithub login
# Reconfigure
grithub configBest Practices
Version Control
Don't commit:
# .gitignore
.grithub/
*.dbDo document:
# README.md
## Required Configuration
1. Run `grithub login`
2. Run `grithub set-repo owner/repo`
3. Set debug mode if neededTeam Settings
For consistent team configuration:
# scripts/setup-grithub.sh
#!/bin/bash
grithub login
grithub set-repo company/project
grithub config # Then manually set team standardsCI/CD Settings
Always use environment variables in CI:
# .github/workflows/grithub.yml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_API_URL: ${{ secrets.GHE_API_URL }}
GRITHUB_DEBUG: falseNext Steps
- Authentication - Set up login
- Commands - Available commands
- Quick Start - Start using Grithub
