Introduction
The Duckling CLI provides a comprehensive set of commands for managing database synchronization between MySQL and DuckDB. All CLI commands run inside the Docker container and support multi-database operations.Running CLI Commands
Since Duckling runs in a Docker container, all CLI commands must be executed usingdocker exec:
Quick Examples
Global Options
All CLI commands support the following global options:Database ID to operate on. If not specified, uses the first configured database.
Display help information for any command.
Display the CLI version.
Multi-Database Support
Duckling supports managing multiple database replicas. Use the--database flag to specify which database to operate on:
Command Categories
The CLI commands are organized into the following categories:Synchronization Commands
sync- Run full synchronizationsync-incremental- Run incremental synchronization
Monitoring Commands
health- Check database connectionsstatus- Show sync status with detailed metricsvalidate- Validate sync integrity between MySQL and DuckDB
Database Operations
tables- List tables in both databasesquery- Execute SQL queries on DuckDB
Dump Management
dump-create- Create a full database dumpdump-restore- Restore from a dump filedump-list- List available dump filesdump-cleanup- Clean up old dump files
Common Workflows
Initial Setup
- Health check - Verify database connections
- Full sync - Initial data replication
- Validate - Confirm data integrity
Daily Operations
- Check status - Monitor sync state
- Incremental sync - Update with recent changes
- Query data - Run analytical queries
Backup & Restore
- Create dump - Regular backups
- List dumps - View available backups
- Restore - Recover from backup
Output Format
Most CLI commands output JSON for easy parsing and integration with scripts:Error Handling
The CLI returns appropriate exit codes:0- Success1- Error (check stderr for details)
Next Steps
Commands Reference
Detailed documentation for all CLI commands
API Reference
RESTful API endpoints for programmatic access