Skip to main content

CLI Commands Overview

Django-CFG provides 40+ management commands for development, testing, monitoring, and production operations.

Quick Start

New to Django-CFG? Start with the Quick Reference for most common commands!

๐Ÿ“š Command Categoriesโ€‹

Most Used Commandsโ€‹

# Check all API endpoints health
python manage.py check_endpoints

# Migrate all databases
python manage.py migrate_all

# Run development server
cli runserver

# Create superuser
cli superuser --email admin@example.com

# Show configuration
python manage.py show_config

View Quick Reference โ†’


๐Ÿ“‹ All Command Categoriesโ€‹

๐Ÿ”ง Core Commands โ€” 8 commandsโ€‹

Project setup, configuration validation, and system checks.

CommandDescription
django-cfg create-projectCreate new Django project with full setup
django-cfg infoShow installation and system information
show_configDisplay current configuration
validate_configValidate settings and connections
check_settingsComprehensive diagnostics
show_urlsList all URL patterns
migrate_allMigrate all databases
superuserCreate superuser

Full Documentation โ†’

๐Ÿงช Testing & Monitoring โ€” 6 commandsโ€‹

Health checks, endpoint validation, and service testing.

CommandDescription
check_endpointsProduction-ready endpoint health checker
test_emailTest email configuration
test_telegramTest Telegram bot
test_twilioTest SMS/WhatsApp
test_providersTest payment providers
test_otpTest OTP authentication
REST API Available

Access endpoint health via REST API:

curl http://localhost:8000/cfg/endpoints/

Full Documentation โ†’

๐Ÿ› ๏ธ Development Tools โ€” 8 commandsโ€‹

Development server and productivity tools.

CommandDescription
cli runserverEnhanced development server
runserver_ngrokRun with ngrok tunnel
scriptRun scripts with Django context
treeShow project structure
list_urlsList all URL patterns
generateGenerate Django components
create_tokenCreate API tokens
clear_constanceClear Constance cache

Full Documentation โ†’

๐Ÿค– AI Agents โ€” 2 commandsโ€‹

AI agent management and orchestration.

CommandDescription
create_agentCreate agents from templates
orchestrator_statusShow orchestrator statistics

Full Documentation โ†’

๐Ÿ“š Knowledge Base โ€” 2 commandsโ€‹

Vector search and knowledge management.

CommandDescription
setup_knowbaseSetup pgvector extension
knowbase_statsShow knowledge base statistics

Full Documentation โ†’

๐Ÿ”„ Background Tasks โ€” Django-RQ Integrationโ€‹

Django-RQ worker management via native CLI.

CommandDescription
rearq main:rearq workerStart background workers
rearq main:rearq timerStart cron task scheduler
rearq main:rearq serverStart monitoring server
test_tasksTest task processing

Full Documentation โ†’

๐Ÿ”ง Maintenance Mode โ€” 3 commandsโ€‹

Maintenance mode and Cloudflare integration.

CommandDescription
maintenanceEnable/disable maintenance mode
sync_cloudflareSync with Cloudflare
process_scheduled_maintenanceProcess scheduled windows

Full Documentation โ†’

๐Ÿ’ณ Payments โ€” 6 commandsโ€‹

Payment system management.

CommandDescription
currency_statsCurrency statistics
manage_currenciesManage currencies
manage_providersManage payment providers
test_providersTest provider integrations
process_pending_paymentsProcess pending payments
cleanup_expired_dataCleanup old payment data

Full Documentation โ†’


๐ŸŽฏ Common Workflowsโ€‹

Initial Project Setupโ€‹

# 1. Create project
django-cfg create-project "My Project"
cd my_project

# 2. Validate configuration
python manage.py validate_config --check-connections

# 3. Migrate databases
python manage.py migrate_all

# 4. Create superuser
cli superuser --email admin@example.com

# 5. Check endpoint health
python manage.py check_endpoints

# 6. Run server
cli runserver

Pre-Deployment Checklistโ€‹

# 1. Validate configuration
python manage.py validate_config --check-connections

# 2. Check endpoint health
python manage.py check_endpoints

# 3. Test integrations
cli test-email --to admin@example.com
python manage.py test_providers

# 4. Run migrations
python manage.py migrate_all

# 5. Collect static files
python manage.py collectstatic --noinput

CI/CD Integrationโ€‹

# Health check in pipeline
python manage.py check_endpoints --json | jq '.errors'

# Exit if unhealthy
test $(python manage.py check_endpoints --json | jq '.errors') -eq 0
Production Tip

Add endpoint health checks to your monitoring:

# Cron job - every 5 minutes
*/5 * * * * python manage.py check_endpoints --json > /var/log/health.json

๐Ÿ’ก Best Practicesโ€‹

Use Poetry for Isolationโ€‹

# Recommended
poetry run cli runserver
poetry run python manage.py check_endpoints

# Also works but less isolated
python manage.py runserver

๐Ÿ”— Quick Navigationโ€‹

I want to...Go to...
Find a command quicklyQuick Reference
Set up a new projectCore Commands
Monitor API healthTesting & Monitoring
Start developmentDevelopment Tools
Manage paymentsPayments
Use AI agentsAI Agents
Configure maintenanceMaintenance

Next Steps

40+ commands. One powerful CLI. ๐Ÿš€