# Power Timer

> Power Timer sleeps, shuts down, restarts, logs out, locks the Mac or sleeps the displays later, at a time, or when something finishes: downloads in a folder,…

- Canonical URL: https://getedith.pro/docs/cli/power-timer
- Updated: 2026-12-02

Power Timer sleeps, shuts down, restarts, logs out, locks the Mac or sleeps the
displays later, at a time, or when something finishes: downloads in a folder,
an app or process, a busy CPU, or the battery. A one minute warning with Cancel
comes before every action.

[The `ed` command line](https://getedith.pro/docs/cli)

It has no command group of its own. Every action is an operation on the running
extension through [`ed invoke`](https://getedith.pro/docs/cli/invoke), with a JSON payload and a
JSON result on stdout. A refused request prints its reason on stderr and exits
non-zero, as described in [conventions](https://getedith.pro/docs/cli/conventions).

| Operation | Payload | What it does |
| --- | --- | --- |
| `schedule` | `{"action": "sleep", "in": 30}` | Sets the timer, replacing any timer already set. |
| `status` | `{}` | Reports the timer, its countdown and the last outcome. |
| `cancel` | `{}` | Cancels the timer. |
| `now` | `{}` | Acts right away during the one minute warning. |
| `processes` | `{"query": "ffmpeg"}` | Lists running processes to wait for, sorted by name. |

```sh
ed invoke powerTimer schedule --json '{"action":"sleep","in":30}'
ed invoke powerTimer schedule --json '{"action":"shutDown","at":"23:30"}'
ed invoke powerTimer schedule --json '{"action":"sleep","downloads":"~/Downloads"}'
ed invoke powerTimer schedule --json '{"action":"restart","process":"HandBrake"}'
ed invoke powerTimer schedule --json '{"action":"sleep","cpuBelow":10,"forMinutes":5}'
ed invoke powerTimer schedule --json '{"action":"shutDown","batteryBelow":15}'
ed invoke powerTimer status
ed invoke powerTimer cancel
```

Unknown keys and values of the wrong type are rejected. Payloads are limited to
16 KiB.

## `schedule`

`action` is `sleep`, `shutDown`, `restart`, `logOut`, `lock` or
`sleepDisplays`. Give exactly one trigger:

| Key | Value | Acts |
| --- | --- | --- |
| `in` | minutes, 1 to 10080 | after that many minutes |
| `at` | `"23:30"` or an ISO 8601 date | at the next 23:30, or at that date, within 7 days |
| `downloads` | a folder path, `~` allowed, or `""` for the folder in the tool's settings | once no partial download files remain and nothing in the folder changed for `quietSeconds` (10 to 900, default from settings, 60) |
| `process` or `pid` | a process name, or a process ID | once every process with that name, or that one process, has quit |
| `cpuBelow` | percent, 1 to 95 | once CPU use stays under it for `forMinutes` (1 to 240, default 5) |
| `batteryBelow` | percent, 2 to 99 | once the Mac runs on battery under that level |

`ignoreKeepAwake: true` acts even while Keep Awake holds the Mac awake.

Partial download files are names ending in `.crdownload`, `.download` (Safari
keeps these as folders), `.part`, `.partial`, `.opdownload`, `.filepart`,
`.aria2`, `.!qB`, `.!ut`, `.dlpart` and `.crswap`. Downloads count as finished
only after a download was seen: a partial file, or a change since the timer was
set. A folder that never changes keeps waiting.

```json
{
  "actsAt": "2027-01-15T08:30:00Z",
  "detail": "At 08:30, in 30 min",
  "holdingAwake": false,
  "keepAwakeBlocks": false,
  "phase": "waiting",
  "plan": {
    "action": "sleep",
    "createdAt": "2027-01-15T08:00:00Z",
    "id": "6F1C3A52-41A8-4E0B-9C1D-2B7E5D9A0F11",
    "ignoreKeepAwake": false,
    "trigger": { "after": { "deadline": "2027-01-15T08:30:00Z", "minutes": 30 } }
  },
  "remainingSeconds": 1800
}
```

- `phase` is `idle`, `waiting`, `warning` (the last minute, when the countdown
  can still be cancelled) or `acting`.
- `trigger` holds one key: `after`, `at`, `downloads` (`folder`,
  `quietSeconds`), `process` (`pid` or none, `name`), `cpu` (`below`,
  `minutes`) or `battery` (`below`).
- `actsAt` and `remainingSeconds` are set for timed triggers, and for every
  trigger during the warning.
- `holdingAwake` is true while Power Timer asks Keep Awake to hold the Mac
  awake. It does that while waiting for downloads, a process or the CPU, when
  Keep the Mac awake while waiting for something to finish is on in the tool's
  settings and Keep Awake is installed.
- `keepAwakeBlocks` is true when Keep Awake would make a due timer stand down.

A timed trigger starts its warning one minute before its time, so it acts on
time. Other triggers warn for a full minute once they are met. A timer whose
time passed more than two minutes ago while the Mac slept or Edith was not
running is cancelled instead of acting late. A set timer survives a restart of
Edith.

## `status`, `cancel` and `now`

All three return the status shown above. After a timer ends, `last` describes
it:

```json
{
  "action": "shutDown",
  "at": "2027-01-15T23:30:00Z",
  "message": "Keep Awake is on. Power Timer stood down.",
  "reason": "keepAwake",
  "result": "cancelled",
  "trigger": "At 23:30"
}
```

`result` is `done`, `cancelled`, `failed` or `skipped`. `reason`, for a
cancelled timer, is `user`, `keepAwake`, `missed` or `replaced`. `cancel` with
no timer set and `now` outside the warning are refused.

Shut down, restart and log out go through System Events, so macOS asks once to
let Edith control it. When the permission is missing, or an app with unsaved
changes stops it, the timer ends as `failed` and `message` says why.

## `processes`

```json
{
  "processes": [
    { "name": "ffmpeg", "path": "/opt/homebrew/bin/ffmpeg", "pid": 4102 }
  ]
}
```

`query` matches part of the name or the exact process ID. At most 500 are
listed.

## Get Edith

Edith is a native Mac app for macOS 14 or later on Apple silicon with 100+ extensions, the `ed` command line and an MCP server. $35 once for one Mac, plus $7 for each additional Mac, with no subscription and a 30-day refund.

- [Buy Edith](https://getedith.pro/pricing): $35 once for one Mac, plus $7 for each additional Mac
- [Download Edith](https://getedith.pro/download): the installer, or Homebrew
