Deploys and manages Laravel applications on Laravel Cloud using the `cloud` CLI. Use when the user wants to deploy an app, ship to cloud, create/manage environments, databases, caches, domains, instances, background processes, or any Laravel Cloud infrastructure. Triggers on deploy, ship, cloud management, environment setup, database provisioning, and similar cloud operations.
composer global require laravel/cloud-cli
cloud auth -n
Commands follow a CRUD pattern: resource:list, resource:get, resource:create, resource:update, resource:delete.
Available resources: application, environment, instance, database-cluster, database, cache, bucket, domain, websocket-cluster, background-process, command, deployment.
Some resources have additional commands (e.g., domain:verify, database:open, instance:sizes, cache:types). Discover these via cloud -h.
Never hardcode command signatures. Always run to discover options at runtime.
cloud <command> -hAlways add -n to every command — prevents the CLI from hanging.
Never use -q or --silent — they suppress all output.
Flag combos per operation:
:list, :get) → --json -n:create) → --json -n:update) → --json -n --force:delete) → -n --force (no --json)-n --force-n with all options passed explicitly (no --json)Determine the task and follow the matching path:
First deploy? → cloud ship -n (discover options via cloud ship -h)
Existing app? →
cloud repo:config
cloud deploy {app_name} {environment} -n --open
cloud deploy:monitor -n
Environment variables? → cloud environment:variables -n --force
Provision infrastructure? → cloud <resource>:create --json -n
Custom domain? → cloud domain:create --json -n then cloud domain:verify -n
For multi-step operations, see reference/checklists.md.
Not sure what the user needs? → ask them before running anything.
:list --json -n or :get --json -ncloud auth -nAlways run cloud deploy:monitor -n after every deploy. If it fails, show the user what went wrong before attempting a fix.
Delegate high-output operations to subagents (using the Task tool) to keep the main context window small. Only the summary comes back — verbose output stays in the subagent's context.
Delegate these to a subagent:
cloud deploy:monitor -n — deployment logs can be very longcloud deployment:get --json -n — full deployment detailscloud <resource>:list --json -n — listing many resources produces large JSONWebFetchKeep in the main context:
:create, :delete, :update — output is smallcloud deploy -n — you need the deployment ID immediatelyFollow exact steps:
Use your judgment:
Run PHP code directly in a Cloud environment:
cloud tinker {environment} --code='Your PHP code here' --timeout=60 -n
--code — PHP code to execute (required in non-interactive mode)--timeout — max seconds to wait for output (default: 60)The code must explicitly output results using echo, dump, or similar — expressions alone produce no output.
Always pass --code and -n to avoid interactive prompts.
Run shell commands on a Cloud environment:
cloud command:run {environment} --cmd='your command here' -n
--cmd — the command to run (required in non-interactive mode)--no-monitor — skip real-time output streaming--copy-output — copy output to clipboardReview past commands:
cloud command:list {environment} --json -n — list command historycloud command:get {commandId} --json -n — get details and output of a specific commandDelegate command:run to a subagent when output may be long.
~/.config/cloud/config.json — auth tokens and preferences.cloud/config.json — app and environment defaults (set by cloud repo:config)Laravel Cloud Docs: https://cloud.laravel.com/docs/llms.txt
When the user asks how something works or needs an explanation of a Laravel Cloud feature, fetch the docs from the URL above using WebFetch and use it to provide accurate answers.
cloud <command> -h for any command's optionscloud -h to discover commands