Commands
Comprehensive guide to all available Paystack CLI commands.
Command Structure
All commands follow this general structure:
paystack-cli [resource]:[action] [options]For example:
paystack-cli transaction:initialize --email=user@example.com --amount=10000Core Commands
init
Initialize the Paystack CLI application and set up the local database.
paystack-cli initWhen to use:
- First time setup
- After deleting the database file
- When you need to reset the CLI
login
Authenticate with your Paystack account.
paystack-cli loginFeatures:
- Interactive email and password prompts
- Option to remember email
- Automatic integration selection
- Secure session management
logout
Sign out and clear your authentication session.
paystack-cli logoutWhat it does:
- Clears authentication token
- Removes selected integration
- Requires re-login for API calls
config
Configure CLI settings interactively.
paystack-cli configConfigurable settings:
- API Base URL
- Timeout Duration
- Debug Mode
- Ngrok Auth Token
Webhook Commands
webhook listen
Start a local webhook listener using ngrok tunneling.
paystack-cli webhook listen [local_route]Arguments:
local_route(optional) - Your local webhook endpoint
Options:
--domain, -D- Domain to use (test/live)[default: test]--forward, -F- Forward to specific URL
Examples:
# Listen on default route
paystack-cli webhook listen
# Listen on specific route
paystack-cli webhook listen http://localhost:3000/api/webhook
# Listen on live domain
paystack-cli webhook listen http://localhost:8080 --domain=livewebhook ping
Send a test webhook event to your configured webhook URL.
paystack-cli webhook pingOptions:
--event, -E- Event type to simulate--domain, -D- Domain to ping (test/live)--forward, -F- Forward to specific URL
Available events:
charge.success- Successful paymenttransfer.success- Successful transfertransfer.failed- Failed transfersubscription.create- New subscription
Examples:
# Test charge success
paystack-cli webhook ping --event=charge.success
# Test transfer on live
paystack-cli webhook ping --event=transfer.success --domain=liveAPI Commands
All Paystack API resources are available as commands. See the API Reference for detailed documentation on each resource:
- Transactions - Payment transactions
- Customers - Customer management
- Plans - Subscription plans
- Subscriptions - Customer subscriptions
- Transfers - Money transfers
- Transfer Recipients - Transfer recipient management
- Subaccounts - Split payment subaccounts
- Payment Pages - Payment page management
- Payment Requests - Invoices and payment requests
- Bulk Charges - Bulk charge operations
- Refunds - Transaction refunds
- Banks - Bank information
- Settlements - Settlement information
- Balance - Account balance
- Verifications - Customer verification
- Invoices - Invoice management
Command Options
Common Options
Most API commands support these common options:
--help- Display help for the command-D, --domain- Specify test or live mode--perPage- Number of results per page (for list commands)--page- Page number (for list commands)
Getting Help
For detailed help on any command:
paystack-cli [command] --helpExample:
paystack-cli transaction:initialize --helpCommand Categories
Read Operations
Commands that fetch data without modifying anything:
list- List multiple resourcesfetch- Get a single resourceview- View resource detailscheck- Check resource status
Write Operations
Commands that create or modify data:
create- Create new resourceupdate- Update existing resourceinitialize- Start a processfinalize- Complete a process
Action Operations
Commands that perform specific actions:
verify- Verify a resourcesend- Send notificationsdisable- Disable a resourceenable- Enable a resourcearchive- Archive a resource
Next Steps
- Explore the API Reference for specific command documentation
- Learn about Webhook Testing
- See Examples of common workflows