nunomaduro/ohdear-cli
A command-line interface for Oh Dear, the all-in-one site monitoring service. Check uptime, broken links, SSL certificates, DNS and scheduled jobs, trigger on-demand checks, and manage your sites straight from the terminal. Built with Laravel Zero for a fast, friendly experience.
nunomaduro/ohdear-cli is a standalone Laravel Zero CLI, not a package you install into your Laravel app. Install it on your workstation (or CI image) as a global binary:
composer global require nunomaduro/ohdear-cli
export PATH="$PATH:$(composer global config bin-dir --absolute)"
ohdear --help # or `ohdear list` — this is your map of the tool
Authenticate with a personal API token from the Oh Dear dashboard (Account → API tokens):
ohdear auth
The token is persisted for your OS user, so you only do this once per machine.
Where to look first: run ohdear list and read the command groups. The shape is almost always <resource> <site-or-check-id>, so the first two commands you will actually live in are:
ohdear sites # find the numeric ID(s) for the apps you own
ohdear site <id> # full status: uptime, SSL, broken links, cron, etc.
First real use case: during a deploy or an incident, open a terminal next to your logs and run ohdear site <id> to see whether the problem is application-level (your logs) or edge-level (uptime, DNS, certificate, cron ping). Being able to answer "is it just me or is it down for everyone?" without a browser tab is the entire value proposition.
Maintenance windows around deploys. The highest-value day-to-day integration is wrapping deploys so Oh Dear doesn't page anyone during a migration:
#!/usr/bin/env bash
set -euo pipefail
SITE_ID="$1"
ohdear maintenance:start "$SITE_ID" --no-interaction
trap 'ohdear maintenance:stop "$SITE_ID" --no-interaction || true' EXIT
php artisan down --retry=60
php artisan migrate --force
php artisan up
The trap matters: if the deploy dies mid-migration, you still close the window instead of leaving checks silenced.
Deploy hooks. Drop the two maintenance calls into Forge/Envoyer deploy scripts or a GitHub Actions step. Keep the site ID in an env var (OHDEAR_SITE_ID) so the same script works across staging and production.
Cron/scheduler verification. After you touch routes/console.php, Horizon, or a queue worker, confirm the scheduled-job check is actually receiving pings:
ohdear cron-checks <id>
This is the fastest way to prove the problem is your scheduler and not Oh Dear's alerting.
SSL and certificate triage. Before renewing certs, check what Oh Dear currently sees so you do not chase a problem that is already resolved (or miss one that has not propagated yet):
ohdear certificate <id> # confirm the exact command name with `ohdear list`
Makefile / justfile recipes. Codify the three or four commands you actually use so nobody has to remember IDs:
ohdear-status:
ohdear site $(OHDEAR_SITE_ID)
ohdear-maint-start:
ohdear maintenance:start $(OHDEAR_SITE_ID) --no-interaction
ohdear-maint-stop:
ohdear maintenance:stop $(OHDEAR_SITE_ID) --no-interaction
CI gating. For "don't promote if production is unhealthy," be deliberate: human-readable output is not a contract. Prefer a --json/machine format if your version exposes one; otherwise treat the CLI as an operator tool and shell out to the Oh Dear API directly from CI for anything that must reliably fail a build.
Pairing with webhooks. Let Oh Dear webhooks do the alerting; use the CLI for the response. A Slack alert links to a runbook whose first step is ohdear site <id>.
composer require this into your Laravel app. It is a Laravel Zero application with its own binary and dependency tree. Global install (or a downloaded PHAR) only. Pulling it into an app invites command-name collisions and a bloated vendor/.ohdear sites shows depends on the token owner's team memberships. Sharing one token across a team is an anti-pattern — issue per-person tokens so revoking one person does not blind everyone.maintenance:start may ask for a duration. Always pass --no-interaction plus the explicit flag in automation, and test the exact invocation once by hand first.maintenance:stop — a CI runner that dies before trap fires should not silence monitoring for a week.watch is rude to the API. Cache site lists, and prefer one site <id> call per poll.composer global require nunomaduro/ohdear-cli:^X) and never grep for prose you do not control.0. Do not build a CI gate on $? without verifying it on a known-failing site.ohdearapp/ohdear-php-sdk in your own artisan command rather than forking the CLI.How can I help you explore Laravel packages today?