karaodin / chargily-pay-cli
Professional CLI tool for Chargily Pay - Manage payments, customers, products, and payment links with advanced features and multi-application support.
Installs: 6
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
Type:project
Requires
- php: ^8.1|^8.2|^8.3
- illuminate/http: ^12.17
- illuminate/log: ^12.17
- laravel-zero/framework: ^12.0
Requires (Dev)
- laravel/pint: ^1.22
- mockery/mockery: ^1.6.12
- pestphp/pest: ^3.8.2
Suggests
- ext-mbstring: Required for proper string handling
- ext-posix: Required for interactive menus on Unix-like systems
- nunomaduro/laravel-console-menu: Required for interactive menus (needs ext-posix on Unix systems)
README
Professional command-line interface for Chargily Pay - Algeria's leading payment gateway. Built for developers, businesses, and DevOps teams who need efficient payment management tools.
โจ Features
๐ฏ Core Payment Operations
- ๐ณ Payment Creation - Create secure checkout links with validation
- ๐ Payment Management - List, filter, and track payment status
- ๐ฐ Balance Monitoring - Real-time account balance across currencies
- ๐ Export Capabilities - CSV export for reporting and analysis
๐ข Multi-Application Support
- ๐ App Switching - Manage multiple Chargily applications seamlessly
- ๐งช Test/Live Modes - Safe testing environment with live mode protection
- โ๏ธ Configuration Management - Secure API key storage and management
- ๐๏ธ Guided Setup - Interactive wizard for first-time configuration
๐จ Professional UX
- ๐ฅ๏ธ Interactive Menus - Beautiful CLI interface with colored output
- โก Smart Caching - Optimized performance with intelligent caching
- ๐ Security First - Encrypted local storage, live mode warnings
- ๐ฑ Modern Design - Progress indicators, loading states, ESC shortcuts
๐ ๏ธ Quick Start
๐ฅ Installation (Super Easy!)
๐ฏ One-Line Install (Recommended)
Windows (PowerShell):
iwr https://raw.githubusercontent.com/karaOdin/chargily-pay-cli/main/install.ps1 -OutFile install.ps1; .\install.ps1
Windows (Command Prompt):
curl -o install.bat https://raw.githubusercontent.com/karaOdin/chargily-pay-cli/main/install.bat install.bat
Linux/macOS:
curl -fsSL https://raw.githubusercontent.com/karaOdin/chargily-pay-cli/main/install.sh | bash
Manual Installation (Advanced Users)
# Install via Composer composer global require karaodin/chargily-pay-cli # Run directly: ~/.config/composer/vendor/bin/chargily # Linux/macOS php "%APPDATA%\Composer\vendor\karaodin\chargily-pay-cli\chargily" # Windows
โก Method 2: Direct Executable Download
Linux:
curl -L https://github.com/karaOdin/chargily-pay-cli/releases/latest/download/chargily-linux -o chargily
chmod +x chargily
sudo mv chargily /usr/local/bin/
chargily # Ready to use!
macOS:
curl -L https://github.com/karaOdin/chargily-pay-cli/releases/latest/download/chargily-macos -o chargily
chmod +x chargily
sudo mv chargily /usr/local/bin/
chargily # Ready to use!
Windows:
# Download and run directly (no setup needed!) curl -L https://github.com/karaOdin/chargily-pay-cli/releases/latest/download/chargily-windows.phar -o chargily.phar php chargily.phar # Works immediately # Or add to PATH for global access move chargily.phar C:\Windows\System32\ chargily.phar # Use anywhere
๐ณ Method 3: Docker
docker run -it ghcr.io/karaodin/chargily-pay-cli:latest
โ Zero Configuration: No environment variables, PHP extensions, or complex setup! The CLI automatically:
- Stores config in
~/.chargily/
folder- Shows startup wizard for first-time users
- Works on Windows, Linux, and macOS
- Falls back to individual commands if interactive menus aren't supported
First Run
chargily
The CLI will guide you through the setup process:
- ๐ฏ Welcome screen with feature overview
- ๐ API Key Setup with links to Chargily dashboard
- ๐งช Test Environment configuration (recommended first)
- โ Ready to use - start managing payments!
๐ Usage Examples
Basic Commands
# Check account balance chargily balance # Create a new payment chargily payment:create # List recent payments chargily payment:list # Check specific payment status chargily payment:status ch_123456789
Advanced Operations
# Filter payments by status chargily payment:list --status=paid --limit=50 # Export payment data to CSV chargily payment:list --export=payments_2024.csv # Switch between applications chargily configure # Switch between test/live modes chargily mode:switch
Interactive Mode
# Launch interactive menu chargily menu # Available options: # ๐ณ Create Payment # ๐ List Recent Payments # ๐ Check Payment Status # ๐ฐ Check Balance # โ๏ธ Configuration # ๐ Switch Mode
๐๏ธ For Developers
API Coverage
Full support for Chargily Pay v2 API:
- โ Payments - Create, retrieve, list with filtering
- โ Balance - Multi-currency balance checking
- โ Customers - Full CRUD operations
- โ Products - Catalog management
- โ Payment Links - Professional link creation
- โ Webhooks - Configuration and testing
Configuration
The CLI stores configuration in ~/.chargily/
:
~/.chargily/
โโโ applications.json # Application configurations
โโโ cache/ # API response cache
โโโ logs/ # Error and activity logs
Environment Variables
export CHARGILY_DEFAULT_APP=my_business export CHARGILY_GLOBAL_MODE=test # Force test mode globally export CHARGILY_CACHE_TIMEOUT=300 # Cache timeout in seconds
Integration Examples
Payment Creation Workflow:
#!/bin/bash # Create payment for order PAYMENT_ID=$(chargily payment:create \ --amount=2500 \ --description="Order #${ORDER_ID}" \ --success-url="https://mystore.dz/success" \ --format=json | jq -r '.id') echo "Payment created: $PAYMENT_ID"
Balance Monitoring:
#!/bin/bash # Monitor balance and alert if low BALANCE=$(chargily balance --format=json | jq -r '.dzd.balance') if [ "$BALANCE" -lt 10000 ]; then echo "โ ๏ธ Low balance alert: ${BALANCE} DZD" fi
๐ Algeria-Focused Features
Currency Support
- ๐ฉ๐ฟ DZD (Algerian Dinar) - Primary currency with native formatting
- ๐ต USD, EUR - Multi-currency support for international transactions
Payment Methods
- ๐ณ EDAHABIA - Algeria's national payment card
- ๐ฆ CIB - Banque CIB cards
- ๐ฑ Mobile Payments - Integration ready
Localization
- ๐ Algeria Timezone - Automatic timezone handling (UTC+1)
- ๐ Date Formats - Localized date and time formatting
- ๐ฑ Amount Display - Proper DZD formatting with separators
๐ง Advanced Configuration
Multi-Application Setup
# Add new application chargily configure # Switch between applications chargily app:switch # Remove application chargily configure --remove=old_app
Security Best Practices
# Always start with test mode chargily mode:switch test # Verify API keys chargily configure --test-connection # Enable additional safety checks export CHARGILY_LIVE_MODE_CONFIRM=true
๐ Monitoring & Analytics
Built-in Reporting
# Payment summary with statistics chargily payment:list --summary # Export for external analysis chargily payment:list --export=monthly_report.csv --from=2024-01-01
Performance Metrics
- โก Fast Response - Cached API responses
- ๐ Success Rate - Built-in retry mechanisms
- ๐ Auto-Recovery - Network failure handling
๐ Production Deployment
CI/CD Integration
GitHub Actions Example:
name: Payment Processing on: schedule: - cron: '0 */6 * * *' # Every 6 hours jobs: check-payments: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - name: Install Chargily CLI run: | curl -L https://github.com/karaOdin/chargily-pay-cli/releases/latest/download/chargily -o chargily chmod +x chargily sudo mv chargily /usr/local/bin/ - name: Check Payment Status run: chargily payment:list --status=pending --format=json env: CHARGILY_API_KEY: ${{ secrets.CHARGILY_API_KEY }}
Docker Deployment
FROM ghcr.io/karaodin/chargily-pay-cli:latest COPY payment-processor.sh /usr/local/bin/ RUN chmod +x /usr/local/bin/payment-processor.sh CMD ["payment-processor.sh"]
๐จโ๐ป About the Developer
Chawki Mahdi
- ๐ CEO of DevCloud - Leading Algerian development company
- โก CTO of Chargily - Algeria's premier payment gateway
- ๐ก Vision: Empowering Algeria's digital economy with cutting-edge payment solutions
- ๐ฉ๐ฟ Mission: Building world-class fintech tools for Algerian businesses
DevCloud Company
DevCloud specializes in:
- ๐๏ธ Enterprise Software Development
- ๐ Fintech Solutions & Payment Systems
- ๐ Digital Transformation Consulting
- โก High-Performance CLI Tools & APIs
This CLI represents our commitment to providing Algerian businesses with professional-grade tools that rival international standards.
๐ค Contributing
We welcome contributions! Please see our Contributing Guide for details.
Development Setup
git clone https://github.com/karaOdin/chargily-pay-cli.git
cd chargily-pay-cli
composer install
./chargily --version
Building
# Build PHAR executable ./vendor/bin/box compile # Test the build ./builds/chargily --version
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
๐ Links
- ๐ Chargily Pay - https://chargily.com
- ๐ API Documentation - https://dev.chargily.com
- ๐ซ Get API Keys - https://pay.chargily.dz/developer
- ๐ Report Issues - GitHub Issues
๐ Support
- ๐ฌ GitHub Discussions - Community Q&A
- ๐ GitHub Issues - Bug reports and feature requests
- ๐ง Email - support@chargily.com (for Chargily-related questions)
๐ฉ๐ฟ Made for Algeria's Digital Economy
Empowering businesses with professional payment tools