CLI Reference¶
milkcrate provides a unified command-line interface for all operations.
Usage¶
For detailed help on any command, use:
Commands¶
The following commands are available. All commands support --help for detailed usage information.
cli¶
milkcrate - A unified CLI for container orchestration platform management.
Usage:
Options:
backup¶
Create a backup of milkcrate data (database, uploads, extracted apps).
Creates a timestamped compressed archive containing: - Database (instance/milkcrate.sqlite) - Uploads directory (unless --no-uploads is specified) - Extracted apps directory (unless --no-extracted is specified)
Backups are stored in the backups/ directory by default.
Examples: milkcrate backup milkcrate backup --output /path/to/backups milkcrate backup --no-uploads --no-extracted # Database only
Usage:
Options:
-o, --output PATH Directory to store backups (default: ./backups).
--no-uploads Exclude uploads directory from backup.
--no-extracted Exclude extracted_apps directory from backup.
--help Show this message and exit.
check¶
Check system prerequisites and project status.
Usage:
Options:
clean¶
Clean cache files, uploads, extracted apps, and/or reset database.
Cache cleaning does not require confirmation. All other operations require confirmation unless --yes is provided.
Examples: milkcrate clean --cache milkcrate clean --uploads --extracted milkcrate clean --all
Usage:
Options:
--cache Remove Python cache files, bytecode, and build artifacts.
--uploads Remove all files from uploads/ directory.
--extracted Remove all files from extracted_apps/ directory.
--db Delete and re-initialize the database.
--all Clean everything: cache, uploads, extracted apps, and database.
-y, --yes Skip confirmation prompts (use with caution).
--help Show this message and exit.
down¶
Stop docker compose stack.
Usage:
Options:
init-db¶
Initialize the SQLite database.
WARNING: This drops and recreates all tables, destroying existing data.
Usage:
Options:
install¶
Install Python dependencies via uv.
Usage:
Options:
package¶
Package the current directory as a milkcrate-deployable ZIP file.
Usage:
Options:
-o, --output TEXT Output filename (default: app.zip)
-e, --exclude TEXT Additional patterns to exclude (can be used multiple
times)
--include-git Include .git directory (normally excluded)
--help Show this message and exit.
rebuild¶
Rebuild milkcrate image.
Usage:
Options:
rebuild-all¶
Rebuild all compose services.
Usage:
Options:
restore¶
Restore milkcrate data from a backup.
Restores the database and optionally uploads/extracted apps from a backup archive. Requires confirmation unless --yes is provided.
Examples: milkcrate restore --list milkcrate restore backup_file.tar.gz milkcrate restore --backup-dir /path/to/backups milkcrate restore backup_file.tar.gz --no-uploads # Database only
Usage:
Options:
--list List all available backups.
--backup-dir PATH Directory containing backups (default: ./backups).
--no-uploads Do not restore uploads directory.
--no-extracted Do not restore extracted_apps directory.
-y, --yes Skip confirmation prompt.
--help Show this message and exit.
run¶
Start the development server locally (port 5001).
Usage:
Options:
setup¶
Complete setup: install dependencies and initialize database.
Usage:
Options:
status¶
Show system status.
Usage:
Options:
up¶
Start docker compose stack.
Usage:
Options:
Packaging Applications¶
# Package current directory (basic)
milkcrate package
# Package with custom name
milkcrate package --output my-webapp.zip
# Package excluding specific files
milkcrate package --exclude "*.log" --exclude "temp/*"
# Package docker-compose application
milkcrate package --output my-multi-service-app.zip
Maintenance¶
# Create a backup of all data
milkcrate backup
# List available backups
milkcrate restore --list
# Restore from a backup
milkcrate restore backups/milkcrate_backup_20250127_143022.tar.gz
# Clean Python cache and build artifacts
milkcrate clean --cache
# Clean up development artifacts
milkcrate clean --uploads --extracted
# Full reset including cache, uploads, extracted apps, and database (caution!)
milkcrate clean --all
Project Root Detection¶
The CLI automatically detects the milkcrate project root by looking for key files (app.py, pyproject.toml, justfile). You can run CLI commands from any subdirectory within the project.