DAFU CLI is an interactive command-line interface for managing the DAFU (Data Analytics Functional Utilities) platform, including fraud detection models and Docker services.
Start the interactive CLI:
./dafuYou'll see a welcome screen and an interactive prompt:
╔════════════════════════════════════════════════════════════╗
║ ____ _ _____ _ _ ║
║ | _ \ / \ | ___| | | | ║
║ | | | |/ _ \ | |_ | | | | ║
║ | |_| / ___ \| _| | |_| | ║
║ |____/_/ \_\_| \___/ ║
║ ║
║ Data Analytics Functional Utilities - Interactive CLI ║
║ Enterprise Fraud Detection & Analytics Platform ║
╚════════════════════════════════════════════════════════════╝
Welcome to DAFU Interactive CLI!
Type 'help' for available commands or 'exit' to quit
dafu>
Execute a single command without entering interactive mode:
./dafu fraud-detection # Run fraud detection
./dafu status # Show platform status
./dafu help # Show help| Command | Description |
|---|---|
fraud-detection |
Run fraud detection models (interactive) |
models |
Alias for fraud-detection |
ml |
Alias for fraud-detection |
Example:
dafu> fraud-detection
This will:
- Check for virtual environment (create if needed)
- Install dependencies (if needed)
- Launch the fraud detection model selector
- Return to CLI after completion
| Command | Description |
|---|---|
docker up |
Start Docker services |
docker down |
Stop Docker services |
docker restart |
Restart Docker services |
docker status |
Show Docker service status |
docker logs |
View Docker logs (Ctrl+C to exit) |
docker rebuild |
Rebuild and restart services |
Examples:
dafu> docker up
dafu> docker status
dafu> docker logs
The CLI is designed to stay active even when Docker commands fail. If a Docker operation encounters an error:
- ✅ The CLI will not exit
- ✅ You'll see an informative error message
- ✅ You can continue using other commands
- ✅ Exit code is displayed for debugging
Example:
dafu> docker up
Starting Docker services...
[... error messages ...]
⚠️ Docker service start returned exit code: 1
💡 You can still use other CLI commands
dafu> status
[... continues normally ...]
This design ensures a smooth user experience even when some operations fail.
| Command | Description |
|---|---|
status |
Show platform status |
version |
Show version information |
info |
Show detailed system information |
Examples:
dafu> status
Output:
DAFU Platform Status
══════════════════════════════════════════════════════════
Python 3: ✓ Available (Python 3.9.7)
Docker: ✓ Available (Docker version 24.0.5)
Docker Daemon: ✓ Running
Docker Services: ○ No containers running
Fraud Detection: ✓ Available
Trained Models: ✓ 3 model(s) found
| Command | Description |
|---|---|
help |
Show available commands |
clear |
Clear the screen |
exit |
Exit DAFU CLI |
quit |
Alias for exit |
# Start CLI
./dafu
# Run fraud detection
dafu> fraud-detection
# [Interactive model selection appears]
# Choose model, process data, view results
# Returns to CLI when done
dafu> exit# Start Docker services
./dafu
dafu> docker up
# Services starting...
dafu> docker status
# Check if services are running
dafu> docker logs
# View service logs (Ctrl+C to exit logs)
dafu> exit./dafu
dafu> status
# Shows platform status
dafu> info
# Shows detailed information
dafu> version
# Shows version
dafu> exit# No interactive mode - just run and exit
./dafu fraud-detection
# Or check status
./dafu status
# Or show help
./dafu help# 1. Start DAFU CLI
./dafu
# 2. Check system status
dafu> status
# 3. Run fraud detection
dafu> fraud-detection
# [Model selection interface appears]
# Select: 1 (Isolation Forest & Risk Score)
# [Model runs and completes]
# 4. Check results
dafu> info
# 5. Exit
dafu> exit# 1. Start DAFU CLI
./dafu
# 2. Start Docker services
dafu> docker up
# 3. Check status
dafu> docker status
# 4. View logs
dafu> docker logs
# 5. Stop services when done
dafu> docker down
# 6. Exit CLI
dafu> exit- Automatically creates Python virtual environment if not present
- Installs dependencies when needed
- No manual setup required
- Use interactively with a persistent session
- Or run single commands for scripting/automation
- Clear command structure
- Helpful error messages
- Color-coded output
- Tab-friendly command names
- Seamlessly integrates with fraud detection models
- Manages Docker services via start.sh
- Real-time status monitoring
- Use Tab Completion: Many terminals support command history with arrow keys
- Ctrl+C: Interrupts current operation but doesn't exit CLI
- Multiple Sessions: You can run multiple fraud detection sessions without restarting CLI
- Command Aliases: Use shorter commands like
mlinstead offraud-detection
# Make sure the script is executable
chmod +x dafuThe CLI will automatically create and manage the virtual environment. If you encounter issues:
# Remove the old environment
rm -rf core/features/fraud_detection/venv
# Run fraud-detection again, it will recreate
./dafu fraud-detectionMake sure Docker is installed and running:
dafu> docker statusIf Docker daemon is not running, start Docker Desktop or the Docker service.
# Make the script executable
chmod +x dafu
# If still issues, run with bash
bash dafuThe DAFU CLI complements start.sh:
./dafu: Interactive CLI for all operations./start.sh: Direct Docker service management
Both tools work together seamlessly!
- Try it out:
./dafu - Run fraud detection:
dafu> fraud-detection - Explore commands:
dafu> help - Check status:
dafu> status
Enjoy using DAFU! 🎉