Configuration
Configure Paystack CLI settings to customize your development experience.
Configuration Command
Access the configuration interface:
bash
paystack-cli configThis launches an interactive menu where you can modify various settings.
Available Settings
API Base URL
- Default:
https://api.paystack.co - Purpose: The base URL for Paystack API requests
- When to change: If you're using a proxy or custom API endpoint
bash
# Select "API Base URL" from config menu
# Enter new URL: https://your-proxy.com/apiTimeout Duration
- Default:
3000ms(3 seconds) - Purpose: HTTP request timeout in milliseconds
- When to change: If you experience timeout errors or need longer waits
bash
# Select "Timeout Duration" from config menu
# Enter new timeout in ms: 5000Debug Mode
- Default:
false - Purpose: Enable detailed error messages and stack traces
- When to enable: When troubleshooting issues or during development
bash
# Select "Debug Mode" from config menu
# Choose: trueWhen debug mode is enabled, you'll see:
- Full error stack traces
- Detailed request/response information
- Internal error messages
Ngrok Auth Token
- Default: None
- Purpose: Authentication token for ngrok tunneling
- Required for: Webhook testing with
webhook listencommand
bash
# Select "Ngrok Auth Token" from config menu
# Enter your token from ngrok.comGet your token from ngrok.com/get-started/your-authtoken
Environment Variables
You can also configure settings using environment variables:
NGROK_AUTH_TOKEN
Set your ngrok authentication token:
bash
export NGROK_AUTH_TOKEN="your_token_here"NGROK_DOMAIN
If you have a paid ngrok plan with a custom domain:
bash
export NGROK_DOMAIN="your-domain.ngrok.io"Configuration Storage
All configuration is stored in the local SQLite database (app.db) alongside your authentication data. This means:
- Configuration persists across sessions
- Each project can have its own configuration
- No global system-wide settings (unless using environment variables)
Configuration Examples
Development Setup
bash
# Enable debug mode for development
paystack-cli config
# Select "Debug Mode" → true
# Set longer timeout for slow connections
paystack-cli config
# Select "Timeout Duration" → 10000Production Setup
bash
# Disable debug mode
paystack-cli config
# Select "Debug Mode" → false
# Use default timeout
paystack-cli config
# Select "Timeout Duration" → 3000Webhook Testing Setup
bash
# Configure ngrok token
paystack-cli config
# Select "Ngrok Auth Token" → paste_your_token
# Verify webhook listening works
paystack-cli webhook listen http://localhost:3000/webhookResetting Configuration
To reset to defaults, simply reconfigure each setting through the config menu, or delete the app.db file and run:
bash
paystack-cli initWARNING
Deleting app.db will also clear your authentication session.
Best Practices
- Use Environment Variables for CI/CD - Set tokens via env vars in automated environments
- Enable Debug Mode During Development - Helps catch and fix issues faster
- Disable Debug Mode in Production - Keeps error messages concise
- Secure Your Ngrok Token - Don't commit tokens to version control
- Adjust Timeouts as Needed - Increase for slow networks, decrease for fast ones
Next Steps
- Set up Webhook Testing with ngrok
- Explore available Commands
- Learn about Troubleshooting common issues