Skip to content

Artisan Commands

SKE lets you run artisan commands against any deployed environment. Commands execute inside a fresh container instance with full access to your application’s environment variables, database, and cache.

Terminal window
ske command:run "migrate --force" --env production
Migrating: 2026_09_15_create_orders_table
Migrated: 2026_09_15_create_orders_table (42ms)

The command runs in a dedicated invocation, isolated from web traffic. On AWS, this creates a separate Lambda invocation. On GCP, it runs as a Cloud Run job.

Open an interactive tinker session:

Terminal window
ske tinker --env production
>>> User::count()
=> 1547
>>> Cache::get('stats:daily')
=> ["visits" => 4291, "signups" => 23]

Tinker runs in your deployed environment with the same database, cache, and environment variables.

Commands have a separate timeout from web requests, configurable in ske.yml:

name: my-app
environments:
production:
timeout: 30 # Web request timeout (seconds)
cli_timeout: 120 # CLI command timeout (seconds)
cli_memory: 1024 # Memory for CLI commands (MB)
Setting Description Default
cli_timeout Maximum execution time for commands 120 seconds
cli_memory Memory allocation for commands Same as memory

Long-running commands like imports or data migrations can use higher timeouts. AWS Lambda supports up to 15 minutes; Cloud Run supports up to 60 minutes.

The SKE adapter handles command execution through the bridge package:

  1. The API sends a command payload to the adapter
  2. The adapter creates a synthetic POST request to /__ske/cli
  3. The bridge package executes the artisan command
  4. Output is streamed back through the API to your CLI
Terminal window
# Run database migrations
ske command:run "migrate --force" --env production
# Clear caches
ske command:run "cache:clear" --env staging
# Check queue status
ske command:run "queue:monitor" --env production
# Run a custom command
ske command:run "app:import-data --source=s3" --env production