# ed shelf add-text

> Writes text into a new Dropped Text.txt shelf item, using a numbered name when that file already exists.

- Canonical URL: https://getedith.pro/docs/cli/shelf/add-text
- Updated: 2026-12-02

Writes text into a new `Dropped Text.txt` shelf item, using a numbered name when
that file already exists.

```text
ed shelf add-text <text...> [--json]
```

Words are joined with spaces. Quote shell metacharacters or newlines when they
must reach the item unchanged. The command and the notch drop tray use the
same shelf mutation executor, persist the same index shape, and notify a running
shelf after the write succeeds.

JSON output is the same item document returned by `ed shelf add --json`, with
`index`, `id`, `name`, `path`, `sizeBytes`, `addedAt`, `exists` and a null
`position`. Its index comes from the committed shelf snapshot and matches the
next `ed shelf ls --json` result.

```sh
ed shelf add-text remember to publish
ed shelf add-text $'first line\nsecond line' --json
```

Missing text exits 2. A filesystem or index write failure exits 1 without
claiming success.

## Where to go next

- [`ed shelf`](https://getedith.pro/docs/cli/shelf)
- [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
