[ All integrations ](https://ohdear.app/third-party-integrations)

# CLI Tool

Interact with Oh Dear directly from your command line to manage monitors and view check results.

[ ohdearapp/ohdear-cli ](https://github.com/ohdearapp/ohdear-cli)

by [ Oh Dear ](https://ohdear.app)

[Our CLI tool](https://github.com/ohdearapp/ohdear-cli) allows you to interact with Oh Dear via the CLI.

The maintainer of this tool, [Owen Voke](https://github.com/owenvoke), has written [a series of blogposts](https://voke.dev/blog/categories/ohdear-cli) on the Oh Dear CLI tool.

## Installation [\#](#installation)

> **Requires [PHP 8.1+](https://php.net/releases)**

Via composer:

```
<span class="hl-keyword">composer</span> global require ohdearapp/ohdear-cli
```

Via [Docker](https://docker.com):

```
<span class="hl-keyword">docker</span> run <span class="hl-attribute">--rm</span> ghcr.io/ohdearapp/ohdear-cli:latest
```

Via [Homebrew](https://formulae.brew.sh/formula/ohdear-cli):

```
<span class="hl-keyword">brew</span> install ohdear-cli
```

If Brew can't find the formula, try running `brew update`.

Once the Oh Dear CLI is installed, set your API key in the `OHDEAR_API_TOKEN` environment variable. You can generate one from [the API access page](https://ohdear.app/user/api-tokens).

## Usage [\#](#usage)

```
ohdear list
```

### Available commands [\#](#available-commands)

#### Account

- `ohdear me` - Display details about the currently authenticated user

#### Monitors

- `ohdear sites:add [url]` - Add a new monitor to Oh Dear
- `ohdear sites:list` - Display a list of sites and their current status
- `ohdear sites:show [id]` - Display details about a specific site

#### Checks

- `ohdear check:disable [id]` - Disable a specific check
- `ohdear check:enable [id]` - Enable a specific check
- `ohdear check:request-run [id]` - Request a new run for a specific check
- `ohdear check:show [site-id]` - Display checks for a specific site

#### Uptime

- `ohdear uptime:show [site-id] [start-date?] [end-date?] [--limit=10] [--timeframe=hour]` - Display the uptime for a specific site
- `ohdear downtime:show [site-id] [start-date?] [end-date?] [--limit=10]` - Display the downtime for a specific site

#### Broken Links

- `ohdear broken-link:show [site-id]` - Display broken links for a specific site

#### Certificate Health

- `ohdear certificate-health:show [site-id] [--checks] [--issuers]` - Display certificate health for a specific site

#### Cron Job Monitoring

- `ohdear cron-check:add [site-id] [name] [frequency-or-expression]` - Add a new cron check for a site
- `ohdear cron-check:delete [id]` - Delete a cron check
- `ohdear cron-check:show [site-id]` - Display the cron checks for a specific site

#### Status Pages

- `ohdear status-pages:list` - Display a list of status pages
- `ohdear status-pages:show [id]` - Display details about a specific status page
- `ohdear status-page-updates:add [status-page-id] [title] [text]` - Add a new update for a status page

## Screenshots
