# The ed command line for Edith

> The optional ed command line for scripts and coding agents: link it, read ed guide, rely on the --json and exit code contract, and run commands on SSH machines.

- Canonical URL: https://getedith.pro/docs/command-line
- Updated: 2026-12-03

`ed` is Edith's command line. It ships inside the app and reaches what the window reaches: settings, extensions, permissions, and the commands of every extension you turn on. `edith` is the same command under its full name, so every example works with either.

> **Note:** Everything in Edith is available in the app. You never need `ed` for everyday use. It is there for automation, scripts and coding agents.

## Install and link `ed`

Edith links `ed` and `edith` onto your `PATH` the first time it runs, in `/usr/local/bin` when you can write there and `~/.local/bin` otherwise. Homebrew installs create the same two names.

In the Developer profile, **Settings > Tools** has a **Command line tools** section. It shows where **Edith command** is linked, with **Install** (or **Reinstall**) and **Remove** buttons. Its **Shell completion** section installs completions for the shells it finds.

Check the links from the terminal with:

```sh
ed status
```

To relink, run the copy inside the app:

```sh
/Applications/Edith.app/Contents/MacOS/ed install
```

[Install](https://getedith.pro/docs/install) covers custom directories and the mistake to avoid. `ed uninstall` removes the two links again.

## Learn the commands

```sh
ed guide
ed guide agent
ed guide --json
ed help config
ed config --help
ed docs ask "keep the mac awake with the lid closed"
```

- `ed guide` prints the built-in manual, written for people and agents alike.
- `ed guide agent` prints a section you can paste into a repository's instructions so a coding agent knows `ed` exists. `ed guide mcp` prints the MCP flow in short form.
- `ed guide --json` prints every command, alias, flag, default and help text as one JSON catalog.
- `ed help <command>` and `<command> --help` print a command's detailed help.
- `ed docs ask` names the commands that handle a plain-language request. `ed docs show <page-or-command>` prints a reference page.

![The Docs page in Edith with the search "free up docker space" and the reference page for ed machines docker prune, with its arguments and options](shot:ext-docs)

An extension's commands need that extension turned on. `ed extensions ls` lists the ids and which ones are on.

## Rely on the `--json` contract

Commands that offer `--json` print exactly one JSON document on stdout. Errors, hints and progress go to stderr, so you can pipe stdout straight into `jq`:

```sh
ed extensions ls --json | jq '.[] | select(.enabled) | .id'
ed usage summary --json > usage.json
```

- Object keys are sorted and a missing value is `null` rather than a dropped key, so the shape is the same on every run.
- On a non-zero exit, stdout is empty. A failing command never leaves half a document behind.
- Failures print `error: <message>` and often `hint: <next step>` on stderr.

```terminal
$ ed version --json
{
  "appRunning": true,
  "version": "1.0.0"
}
$ ed clipboard get 9999
error: there is no clipboard entry 9999
hint: the history holds 1217 entries, numbered from 1
```

The only streaming exceptions are `ed menu-bar-stats stats --json --follow` and `ed machines metrics <machine> --json --follow`, which print one compact document per line.

## Read the exit code

| Code | Meaning                                                                                                                                                  |
| ---- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 0    | Success. A preview that changed nothing on purpose is also 0.                                                                                            |
| 1    | The command was understood but refused or failed, such as a value that failed validation.                                                                |
| 2    | The command line was wrong: an unknown flag, a missing argument or an unparseable value.                                                                 |
| 3    | The thing you named does not exist or is ambiguous: a machine, setting key, permission or guide topic.                                                   |
| 4    | It exists but is unavailable right now: Edith cannot be reached, an extension is off, a permission is missing, a machine is down, the command timed out. |

`ed machines exec`, the `ed <machine> ...` shorthand, and the two docker log commands pass the remote program's own exit code through instead.

```terminal
$ ed box sh -c 'exit 42'
$ echo $?
42
```

When `ed` cannot reach Edith at all, it exits 4. So does a command that runs past its time limit: it is cancelled with `The command timed out and was cancelled.`

## Preview before you change anything

Commands that remove or restart something preview by default and act only with `--yes`, for example `ed app relaunch`, `ed app rollback`, `ed machines rm` and `ed cleaner clean`. A missing `--yes` is never an error: the command reports what it would do and exits 0.

```sh
ed app relaunch
ed app relaunch --yes
```

## Know what needs Edith running

You do not need to open Edith first. When a command needs the app and Edith is not running, `ed` opens it in the background, without showing a window, and waits about 20 seconds for it to answer. If it still cannot reach Edith, the command fails with this message and exits 4:

```text
Edith is not running for this app installation. Open this Edith app and try again.
```

A few commands never need the app: `ed guide` (without `--json`), `ed schema`, `ed version`, `ed status`, `ed install`, `ed uninstall`, `ed completions` and `ed app rollback`. A command that comes from an extension also needs that extension turned on. See [What needs Edith running](https://getedith.pro/docs/cli/conventions#what-needs-edith-running).

`ed version --json` reports `appRunning`, and `ed app actions` reports whether each one-shot action can run now.

## Turn on shell completion

In the app, press **Install completions** in **Settings > Tools > Shell completion**. From the terminal:

```sh
ed completions install
ed completions source
```

Completion asks `ed` itself for candidates, so it never goes out of date. It completes setting keys and their allowed values, extension ids, permission ids, machine names, and commands on a remote machine while a connection to it is open. `ed completions zsh`, `bash` and `fish` print the scripts if you prefer to place them yourself.

## Run commands on another machine

Name a machine from `ed machines ls` as the first word and the rest of the line runs there:

| You type                           | What runs                          |
| ---------------------------------- | ---------------------------------- |
| `ed box`                           | `ed machines show box`             |
| `ed box uptime`                    | `ed machines exec box -- uptime`   |
| `ed machines box metrics --follow` | `ed machines metrics box --follow` |
| `ed machines box docker ps`        | `ed machines docker ps box`        |

Edith's own command names always win, so a machine called `usage` needs `ed machines exec usage -- ...`. Quote a machine name with spaces. See [Machines](https://getedith.pro/docs/machines).

## Find the right reference page

The [command reference](https://getedith.pro/docs/cli) has one page per command group. Good places to start:

- [Getting started](https://getedith.pro/docs/cli/getting-started) and [conventions](https://getedith.pro/docs/cli/conventions)
- [`ed config`](https://getedith.pro/docs/cli/config), [`ed app`](https://getedith.pro/docs/cli/app) and [`ed extensions`](https://getedith.pro/docs/cli/extensions)
- [`ed permissions`](https://getedith.pro/docs/cli/permissions) and the [beta](https://getedith.pro/docs/beta)
- [`ed machines`](https://getedith.pro/docs/cli/machines) and [running commands on a machine](https://getedith.pro/docs/cli/machines-remote)
- [`ed agent`](https://getedith.pro/docs/cli/agent), [`ed run` and `ed runs`](https://getedith.pro/docs/cli/run-inbox) and [`ed mcp`](https://getedith.pro/docs/cli/mcp)

To let a coding agent use all of this, connect it over [MCP](https://getedith.pro/docs/mcp).

## 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
