LinuxCommandLibrary

ohdear-cli

Manage website monitoring with Oh Dear!

TLDR

Display details about the currently authenticated user

$ ohdear-cli me
copy

Add a new site to Oh Dear
$ ohdear-cli sites:add [url]
copy

Display a list of sites and their current status
$ ohdear-cli sites:list
copy

Display details about a specific site
$ ohdear-cli sites:show [site_id]
copy

SYNOPSIS

ohdear-cli [global-options] <command> [command-options] [arguments]

PARAMETERS

--api-token=<token>
    Specifies the Oh Dear! API token for authentication. This can also be set via environment variables.

--site-id=<id>
    Used by commands that operate on a specific monitored site, e.g., run-checks or deploy-success.

--url=<url>
    Used by specific check commands like check-broken-links to define the target URL for crawling.

--domain=<domain>
    Used by specific check commands like check-certificate to define the target domain for validation.

--help, -h
    Displays help information for the main command or a specific subcommand.

--version, -V
    Displays the installed version of the ohdear-cli tool.

--verbose, -v
    Increases the verbosity of output messages. Can be specified multiple times for more verbosity (-vv, -vvv).

--quiet, -q
    Suppresses all output messages.

--no-interaction
    Disables interactive prompts, useful for scripting.

DESCRIPTION

ohdear-cli is the official command-line interface for the Oh Dear! website monitoring service. It allows developers and system administrators to interact with their Oh Dear! account directly from the terminal, automating various monitoring and deployment tasks. It supports a range of functionalities, including listing monitored sites, triggering checks, notifying deployment successes, and performing specific checks like SSL certificate validity, broken links, and scheduled tasks. This tool is particularly useful for integrating Oh Dear! into CI/CD pipelines, scripting routine operations, or quickly checking site statuses without needing to access the web interface. It requires an Oh Dear! API token for authentication.

CAVEATS

Requires an Oh Dear! API token, which must be configured or passed with --api-token. An active internet connection is necessary for most operations as it interacts with the Oh Dear! cloud service. The check-scheduled-tasks command often requires specific local server configurations (e.g., running within a Laravel application context) to function correctly. Some features might be limited by your Oh Dear! subscription plan.

AUTHENTICATION

ohdear-cli primarily authenticates using an Oh Dear! API token. This token can be provided via the --api-token option, but it's recommended to store it as an environment variable (e.g., OHDEAR_API_TOKEN) or in a configuration file to avoid exposing it in shell history.

SUBCOMMANDS

The ohdear-cli tool is structured around subcommands, each performing a specific action. Examples include list-sites to view all monitored sites, run-checks <site_id> to trigger checks for a specific site, deploy-success <site_id> to mark a successful deployment, check-certificate <domain> for SSL checks, and check-broken-links <url> for link validation. To see available subcommands, run ohdear-cli --help. Each subcommand also has its own help page (e.g., ohdear-cli list-sites --help).

HISTORY

ohdear-cli is developed by the team behind the Oh Dear! monitoring service. It emerged as a practical tool to extend the service's functionality beyond its web interface, allowing for automation and integration into development and deployment workflows. Its development parallels the growth of the Oh Dear! service itself, continually providing command-line access to an increasing number of features. It is a relatively modern tool, reflecting the industry trend of offering robust CLI clients for SaaS platforms.

Copied to clipboard