# ed longhand

> ed longhand belongs to the Longhand extension. Longhand expands the keywords of Bifrost snippets as you type in any app: type the keyword and a space or…

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

`ed longhand` belongs to the Longhand extension. Longhand expands the keywords of
Bifrost snippets as you type in any app: type the keyword and a space or
punctuation and it becomes the snippet's text. Snippets and keywords live in
Bifrost, so `ed longhand ls` lists exactly the keywords Bifrost shows on its
snippets. Expansion is off until you turn it on and needs Input Monitoring and
Accessibility.

Install the extension with `ed extensions install longhand`. The same controls
are on the Longhand page, the Home card, and the Pause expansion, Resume
expansion and Import Espanso matches actions in Bifrost.

## At a glance

| Command | What it does |
| --- | --- |
| `ed longhand status` | Prints whether expansion is on and what blocks it. Runs when you type `ed longhand` with no subcommand. |
| `ed longhand on` | Resumes expansion and watches typed keywords. |
| `ed longhand off` | Pauses expansion and removes the keyboard event tap. |
| `ed longhand ls` | Lists the Bifrost snippet keywords that expand. |
| `ed longhand import` | Imports Espanso match files into Bifrost snippets. |

## Commands

- [`ed longhand status`](https://getedith.pro/docs/cli/longhand/status)
- [`ed longhand on`](https://getedith.pro/docs/cli/longhand/on)
- [`ed longhand off`](https://getedith.pro/docs/cli/longhand/off)
- [`ed longhand ls`](https://getedith.pro/docs/cli/longhand/ls)
- [`ed longhand import`](https://getedith.pro/docs/cli/longhand/import)

## Page operations

The page talks to the extension through `ed invoke longhand <operation>`. Each
returns `{"state": ..., "espansoFolders": [...]}`, where `state` has
`configuration` (`enabled`, `excluded`), `active`, `block`, `message`,
`library`, `snippets`, `expansions`, `protectedApps` and `lastImport`.

| Operation | Payload | Result |
| --- | --- | --- |
| `longhand.read` | `{}` | The state |
| `longhand.enable` | `on` | Turns expansion on or off |
| `longhand.permission` | `permission`: `inputMonitoring` or `accessibility` | Asks macOS for the permission |
| `longhand.exclude` | `bundleID`, `excluded` | Adds an app to the exclude list or removes it |
| `longhand.import.preview` | `paths` (absolute files or folders) | `files`, `snippets`, `skipped` and `notes`, without changing Bifrost |
| `longhand.import` | `paths` | Imports into Bifrost and sets `lastImport` |

`actions.catalog` lists `pause` or `resume`, and `import.espanso`. Run one with
`actions.perform` and `{"actionID":"resume"}`.

## Exit codes

| Code | When |
| --- | --- |
| 0 | The status or list was printed, expansion was turned on or off, or the import ran. |
| 1 | An import failed: a file is missing, unreadable or not Espanso YAML, or Bifrost is off. |
| 2 | The command line was wrong: an unknown flag or a missing path. |
| 4 | Longhand is not installed or enabled. |

## Notes and gotchas

- Edit snippets and keywords in Bifrost settings. A snippet without a keyword
  never expands.
- `on` prints the missing permission when Input Monitoring or Accessibility is
  not allowed; the keyboard is watched only once both are.
- Keywords never expand in password fields, while secure input is on, in
  password managers or in apps you exclude on the page.

## Where to go next

- [`ed bifrost`](https://getedith.pro/docs/cli/bifrost) for the snippet library
- [`ed permissions`](https://getedith.pro/docs/cli/permissions) for Input Monitoring and Accessibility
- [All `ed` commands](https://getedith.pro/docs/cli)

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