Agent-skills deploying-laravel-cloud
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.
git clone https://github.com/laravel/agent-skills
T=$(mktemp -d) && git clone --depth=1 https://github.com/laravel/agent-skills "$T" && mkdir -p ~/.claude/skills && cp -r "$T/laravel-cloud/skills/deploying-laravel-cloud" ~/.claude/skills/laravel-agent-skills-deploying-laravel-cloud && rm -rf "$T"
laravel-cloud/skills/deploying-laravel-cloud/SKILL.mdDeploying with Laravel Cloud CLI
Setup
composer global require laravel/cloud-cli cloud auth -n
Commands
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
cloud <command> -h to discover options at runtime.
CLI Flags
Always add
-n to every command — prevents the CLI from hanging.
Never use -q or --silent — they suppress all output.
Flag combos per operation:
- Read (
,:list
) →:get--json -n - Create (
) →:create--json -n - Update (
) →:update--json -n --force - Delete (
) →:delete
(no-n --force
)--json - Environment variables →
-n --force - Deploy/ship →
with all options passed explicitly (no-n
)--json
Deployment Workflow
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.
When a Command Fails
- Read the error output
- Check resource status with
or:list --json -n:get --json -n - Auth error? →
cloud auth -n - Fix the issue, re-run the command
- If the same error repeats after one fix, stop and ask the user
Always run
cloud deploy:monitor -n after every deploy. If it fails, show the user what went wrong before attempting a fix.
Subagent Delegation
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:
— deployment logs can be very longcloud deploy:monitor -n
— full deployment detailscloud deployment:get --json -n
— listing many resources produces large JSONcloud <resource>:list --json -n- Fetching docs from https://cloud.laravel.com/docs/llms.txt via
WebFetch
Keep in the main context:
- Short commands like
,:create
,:delete
— output is small:update
— you need the deployment ID immediatelycloud deploy -n- Any command where you need the result for the next step right away
Rules
Follow exact steps:
- Flag selection — always use the documented combos above
- Deploy sequence — deploy then monitor, never skip monitoring
- Destructive commands — always confirm with user first, show the command and wait for approval
- Error loop — diagnose, fix once, ask user if it fails again
Use your judgment:
- Instance sizes, regions, cluster types — ask the user if not specified
- Which resources to provision — based on what the user describes
- Order of provisioning — no strict sequence required
- How to present output — summarize, show raw, or extract fields based on context
Remote Access
Tinker (> v0.2.0)
Run PHP code directly in a Cloud environment:
cloud tinker {environment} --code='Your PHP code here' --timeout=60 -n
— PHP code to execute (required in non-interactive mode)--code
— max seconds to wait for output (default: 60)--timeout
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.
Remote Commands
Run shell commands on a Cloud environment:
cloud command:run {environment} --cmd='your command here' -n
— the command to run (required in non-interactive mode)--cmd
— skip real-time output streaming--no-monitor
— copy output to clipboard--copy-output
Review past commands:
— list command historycloud command:list {environment} --json -n
— get details and output of a specific commandcloud command:get {commandId} --json -n
Delegate
command:run to a subagent when output may be long.
Config
- Global:
— auth tokens and preferences~/.config/cloud/config.json - Repo-local:
— app and environment defaults (set by.cloud/config.json
)cloud repo:config - CLI arguments override both
Documentation
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.
When Stuck
- Fetch https://cloud.laravel.com/docs/llms.txt for official documentation
- Run
for any command's optionscloud <command> -h - Run
to discover commandscloud -h