karaodin/chargily-pay-cli

Professional CLI tool for Chargily Pay - Manage payments, customers, products, and payment links with advanced features and multi-application support.

v1.0.3 2025-07-22 03:47 UTC

This package is auto-updated.

Last update: 2025-07-22 10:08:07 UTC


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.

License: MIT PHP Version Laravel Zero

โœจ 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:

  1. ๐ŸŽฏ Welcome screen with feature overview
  2. ๐Ÿ”‘ API Key Setup with links to Chargily dashboard
  3. ๐Ÿงช Test Environment configuration (recommended first)
  4. โœ… 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

๐Ÿ“ž 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