Commands
Overview
Commands in Tapitalee are persistent job definitions that can be executed repeatedly, making them ideal for maintenance operations, data processing pipelines, monitoring tasks, and recurring business processes. Commands can be triggered manually or run automatically on a schedule.
Purpose and Benefits
- Scheduled Execution: Automatic execution based on cron schedules (see Scheduled Cronjobs)
- Manual Triggers: On-demand execution for testing and maintenance via Tapitalee web interface
- Pre-deploy Steps: A command can be turned into a pre-deploy step, so it runs automatically as part of every deploy (e.g. database migrations or asset syncing)
- Resource Control: Configurable CPU, memory, and execution limits
- Audit Trail: Complete history of all command executions
- Environment Integration: Full access to app environment and resources
CLI Usage
Create Command
Create a reusable shell command that can be scheduled, run manually, or set as predeploy steps. These commands run as one-off ECS tasks with the specified CPU, memory, and Docker image settings.
tapit create command name=command-name 'command to run' [schedule='cron-expression'] [memory|cpu|image|image_tag|max_hours|ephemeral_storage_gb]=value [description='text'] [--ignore-existing]
Arguments
- ‘command to run’ - The shell command to execute
Parameters
name: Name for the command (required, alphanumeric with hyphens)schedule: Cron expression for scheduled execution (e.g., ‘0 * * * *’)memory: Memory allocation in GB (default: 2.0, sandbox limit: 1.0)cpu: CPU allocation in vCPUs (default: 1.0, sandbox limit: 0.25)image: Custom Docker image to useimage_tag: Docker image tag to use (alias: tag)max_hours: Maximum runtime in hoursephemeral_storage_gb: Ephemeral storage size in GBdescription: Description of what the command does--ignore-existing: Skip creation if a resource with the same name already exists (useful for idempotent scripts)
Examples
# Manual command (no schedule)
tapit create command name=db-maintenance 'python scripts/cleanup_old_records.py' description='Remove old records from database'
# Scheduled command - see Scheduled Cronjobs for more examples
tapit create command name=daily-backup 'python scripts/backup_database.py' schedule='0 2 * * *' description='Daily database backup'
Modify Command
Update the definition of an existing command
tapit set command name=command-name ['new command'] [schedule='cron-expression'] [memory|cpu|image|tag|max_hours|ephemeral_storage_gb]=value [description='text']
Arguments
- ‘new command’ - Updated shell command to run (optional)
Parameters
name: Name of the command to update (required)schedule: Cron expression for scheduled execution (e.g., ‘0 * * * *’)memory: Memory allocation in GB (default: 2.0, sandbox limit: 1.0)cpu: CPU allocation in vCPUs (default: 1.0, sandbox limit: 0.25)image: Custom Docker image to usetag: Docker image tag to usemax_hours: Maximum runtime in hoursephemeral_storage_gb: Ephemeral storage size in GBdescription: Description of what the command does
List Commands
List all commands defined for the app with their schedule and last run time
tapit list commands
Manual Command Execution
Commands can be executed manually regardless of their schedule using the task creation functionality:
# Execute a command manually by creating a task
tapit create task 'python scripts/backup_database.py'
Delete Command
Delete a command definition from the app
tapit delete command name=command-name
Parameters
name: Name of the command to delete (required)