michtio/craftcms-claude-skills / skills/craft-cloud
craft-cloud
UnverifiedCraft Cloud — Pixel & Tonic's serverless hosting platform for Craft CMS. Covers craft-cloud.yaml configuration, the Build → Migrate → Release deploy pipeline, the craftcms/cloud extension package, edge image transforms via Cloudflare, edge static caching with cache.rules + ESI, Cloud-managed S3 filesystem, MySQL 8 / Postgres 15 databases (no MariaDB, no tablePrefix), Console-based command runner and scheduled cron (once-per-hour minimum), auto-handled queue jobs, custom domains and SSL, preview environments per branch, Cloud limitations (ephemeral filesystem, no SSH, no .htaccess, no built-in mail), plugin development requirements for Cloud compatibility, and self-hosted → Cloud migration.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 18.8 KB |
| references/assets-and-transforms.md | markdown | 5.5 KB |
| references/caching-and-edge.md | markdown | 23.4 KB |
| references/commands-and-cron.md | markdown | 7.0 KB |
| references/config-file.md | markdown | 6.9 KB |
| references/database.md | markdown | 6.0 KB |
| references/deploy-pipeline.md | markdown | 16.6 KB |
| references/domains.md | markdown | 5.4 KB |
| references/extension.md | markdown | 15.6 KB |
| references/headless.md | markdown | 8.0 KB |
| references/limitations.md | markdown | 17.3 KB |
| references/local-dev.md | markdown | 6.8 KB |
| references/migration.md | markdown | 8.6 KB |
| references/plugin-development.md | markdown | 14.5 KB |
references/commands-and-cron.md
View on GitHub# Console Commands, Scheduled Cron, and Queue Jobs
Cloud has no SSH. Commands run through the Console UI's command runner. Recurring commands schedule from the same UI with a one-hour minimum interval. Queue jobs are auto-processed — don't schedule a runner yourself.
## Documentation
- Console commands: https://craftcms.com/docs/cloud/commands
- Scheduled commands (cron): https://craftcms.com/docs/cloud/cron
## Common Pitfalls
- Adding a scheduled command `php craft queue/run` (or similar) to "make sure the queue runs." Cloud already processes queue jobs automatically. A scheduled queue runner is redundant and can produce competing workers.
- Trying to pipe output (`craft my-command | grep error`) or chain commands (`craft a && craft b`) in the runner. Shell interpolation and piping aren't supported — one command per execution.
- Writing a recurring command that needs to run more often than hourly. Cloud's UI enforces a one-hour minimum. If you need higher frequency, design the work as queue jobs triggered by application events instead of by a cron schedule.
- Trying to schedule commands by committing them to `craft-cloud.yaml`. No YAML-based scheduling exists — Console UI is the only surface.
- Running a long-running resave without `--limit` or batching. Commands cap at 15 minutes. A `resave/entries` across 50k entries on a complex element type will hit the cap. Use the `--limit` option and run multiple times, or split into batched queue jobs.
- Expecting to edit a scheduled command in place. They can't be edited — delete and recreate to change anything (the schedule, the command, etc.).
## Console command runner
Each Cloud environment has a **Commands** screen in the Console.
### How to run a command
1. Open the Commands screen for the target environment.
2. Enter the command text — everything after `craft`. For example, to run `php craft resave/entries`, type `resave/entries`.
3. Press Enter or click Execute.
4. The command moves through states: **Pending** → **Running** → **Success** / **Error**.
Output is captured and viewable by expanding the row in the command history.
### Constraints
| Constraint | Value |
|---|---|
| Command text length | 255 characters (everything after `craft`) |
| Execution time | 15 minutes maximum |
| Interactive prompts | Not allowed — all input must be passed as args/options |
| Shell features | No piping, no command chaining, no bash interpolation |
| History retention | 6 months |
The 255-char limit catches you when running a `resave/entries --propagate-to=site1,site2,site3 --type=foo,bar,baz --status=...` with many options. Split into multiple runs if you hit it.
The 15-min cap is the same as queue jobs (both run in 15-minute-bound Lambda invocations). For longer work, see Queue Jobs below.
### What commands are available
Any Craft console command (`migrate/up`, `clear-caches/all`, `resave/entries`, `db/restore`, etc.) plus any plugin- or module-registered commands. The Cloud extension adds `cloud/*` commands (most are infrastructure-only — see `extension.md`).
The two `cloud/*` commands worth knowing about manually:
- `cloud/info` — diagnostic info about the environment, useful when debugging.
- `cloud/static-cache` — manual edge cache operations (inspect, purge).
## Scheduled commands (cron)
Recurring commands are scheduled from the same Commands screen, under **Scheduled Commands → Create**.
### Configuration
- **Command** — same syntax as one-off commands (everything after `craft`, 255-char cap).
- **Cron expression** — standard cron syntax. The docs reference Cronitor's Crontab.guru as the recommended tool for constructing expressions.
### Frequency floor
**One hour minimum interval.** You can pick the minute offset (e.g. `:17`), but you can't run more often than once per hour — the Console UI enforces this floor.
### Other constraints
| Constraint | Value |
|---|---|
| Max scheduled commands per environment | 5 |
| Editable in place | No — delete and recreate |
| Execution timing precision | Approximate (typically a few seconds late) |
| Same execution limits as one-off | 15 minutes, 255 chars, no shell features |
### Designing around the one-hour floor
When you need more frequent work, the supported pattern is:
- **Queue jobs triggered by events** — when an entry saves, when an asset uploads, when a webhook fires. The job runs immediately (auto-processed) rather than waiting for a scheduled tick.
- **Batched queue jobs** — a long-running task split into many small jobs, each well under the 15-minute cap. See Queue Jobs below.
- **Self-perpetuating jobs** — a queue job that schedules its own next invocation. Use carefully; easy to lose track of.
## Queue jobs
Cloud auto-processes queue jobs. You don't:
- Run a queue worker on a server (there isn't one).
- Schedule a Console command to drive the queue (don't — it conflicts with the platform runner).
- Configure a queue daemon in `app.php` (the extension auto-wires queue components).
You do:
- Push jobs to the queue normally (`Craft::$app->getQueue()->push(new MyJob([...]))`).
- Budget for the 15-minute per-job cap.
- Split long work into batched jobs.
### The 15-minute cap
Each queue job runs in a Lambda invocation capped at 15 minutes. The docs are explicit: "Jobs exceeding 15 minutes should be batched."
### Batched job pattern
A job that processes 100k records over 30 minutes won't survive Cloud. Instead, design it as:
```php
// Parent: figures out total work, queues N child jobs.
class SyncAllEntriesJob extends BaseBatchedJob
{
protected function loadData(): Collection
{
return Entry::find()
->section('blog')
->collect();
}
protected function processItem(mixed $item): void
{
$this->syncOne($item);
}
}
```
Each batch typically processes 50–200 items in well under 15 minutes. Failures are isolated to the current batch — the rest of the job continues.
See the `craftcms` skill's `queue-jobs.md` for the full batched-job pattern (`BaseBatchedJob`, TTR, retry, progress).
### What goes wrong if you ignore the cap
A job that hits 15 minutes is killed mid-execution by Lambda. Craft's queue will retry per the job's TTR/retry config, but each retry hits the same cap — guaranteed failure loop. Visible in Console as a stuck queue entry.
The fix is always architectural — split into smaller units, not "increase the timeout" (no setting exists).
## Reading command output
The Console command runner captures stdout and stderr. Click the row in command history to expand the output. Logs from inside the command (anything routed through `Craft::info/warning/error()`) also appear there.
There is no separate log-tailing UI documented today. If you need persistent operational logs, route them to an external service (Loggly, Papertrail, Datadog) via a Monolog handler configured in `config/app.php`. See `limitations.md` (Logs) for the broader picture.
Last verified against https://craftcms.com/docs/cloud/commands and https://craftcms.com/docs/cloud/cron on 2026-05-28.
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| writing-skillsobra/superpowersUse when creating new skills, editing existing skills, or verifying skills work before deployment | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| xlsxanthropics/skillsUse this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .xltx, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like "the xlsx in my downloads") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| shipping-and-launchaddyosmani/agent-skillsPrepares production launches. Use when preparing to deploy to production, or when asking what needs to be in place before shipping. Use when you need a pre-launch checklist, when setting up monitoring, when planning a staged rollout, or when you need a rollback strategy. | Stars: 119k | Updated | Claude CodeCodex | Verified | Install |
| childhoodthedotmack/claude-memBabysit a shipped release after merge, publication, or deployment. Verify published packages, production behavior, installed plugins, and late CI or user reports until the observation window is clean; use babysit for PR readiness before release. | Stars: 118k | Updated | Claude CodeCodex | Verified | Install |