lift exec

Execute commands inside Docker containers on the server with automatic shell injection protection.

lift exec

Execute a command inside a Docker container on the server. All arguments after -- are passed as the command. Shell injection is prevented via automatic escaping.

Options

FlagDescriptionDefault
--tool <name>Target a tool's primary container via docker compose exec
--container <name>Target a specific container by name via docker exec

Examples

# Run a command in the auto-detected container
lift exec -- ls /app

# Redis CLI via tool name
lift exec --tool redis -- redis-cli ping
# PONG

# PostgreSQL query
lift exec --container postgres-app -- psql -U postgres -c 'SELECT version()'

# Check Node.js version inside app container
lift exec -- node --version

# Run Django migrations
lift exec -- python manage.py migrate