@letterstory/letterpress
v0.2.1
Published
Letterpress in your terminal: Letter's growth engineer builds your site changes and opens the pull requests.
Keywords
Readme
@letterstory/letterpress
Letterpress, Letter's growth engineer, in your terminal. Describe what to build; Letterpress reads your Letter account and site, plans the change, builds it in a cloud sandbox, and opens the pull request. Local files go in as inputs with @path. It never edits files on your machine.
Run it in a site's repo, on GitHub or GitLab (gitlab.com, nested groups and all), and builds go to the site that repo builds, from the branch you're on when it's pushed: the pull request targets that branch. An unpushed branch says so and uses the site's branch. The prompt's footer shows which one, and uncommitted or unpushed work is pointed out, since the sandbox can't see it. A GitLab repo needs the account's GitLab connected (Settings → Integrations → GitLab); Letter then opens merge requests there.
curl -fsSL https://letter.dev/install.sh | sh # or: npm i -g @letterstory/letterpress
letterpress| Type | What happens |
| --- | --- |
| a prompt | Plan, build in a sandbox, open a PR (the console's Build box) |
| @path | Attach a local file from this folder (like Claude Code, nothing outside the folder it was started in is ever read) |
| /setup | What Letter has read of your site, repo and design, and what waits on you (GitHub or GitLab, with the link to connect it). Shown when Letterpress opens until Set-up is finished |
| /proofs | Set up Proofs. The first time, Letterpress opens Proofs setup in your browser (your company and domain, for this organization) and waits; then Build opens a PR that installs it in this folder's repo, and once it's merged and deployed Letter verifies your site and publishes the proof. Run it in the repo where your users sign in |
| /plan | /plan <what to build> shows the plan and waits: build it, don't, or type what to change and it plans again. /plan alone turns this on for every message; letterpress --plan starts that way |
| /resume | Carry on an earlier conversation: a picker of the organization's conversations, this folder's repo first, or /resume <words>. Its newest messages show again, a build still at work is followed, and /open finds its pull request |
| /builds | Recent builds and where each stands (Building, PR open, Merged, PR closed); /builds 2 follows one |
| /diff | What the last build changed, line by line. A preview lists its files; the lines show once its pull request opens |
| /branch | Choose the branch builds work from, or /branch <name>; /branch auto follows yours. Only where builds go: your checkout stays as it is |
| /open | Open the last pull request |
| /model | Choose the agent that builds (Default, Letterpress-1, Claude, GPT): a picker like Claude Code's /model, or /model claude; kept for next time. -p takes --model |
| /org | Switch organization: a picker of the organizations you've signed in to, or /org <name>; its last row signs in to another (your browser picks it). Kept for next time |
| /usage | Tokens left, or this period's tokens on a plan, with the link to Settings → Billing in the app, where the breakdown by product and collection, the card and the invoices live. A free account is also told on open and after each build once it's used 80% of its free tokens, and once more when they're gone |
| /billing | Open Settings → Billing in your browser |
| /login, /logout | Browser sign-in, shared with the letterstory CLI; /logout signs out of every organization |
| /update | Check npm now and install the newest Letterpress (it also updates itself in the background, checking hourly) |
| \ then Enter | A new line in the prompt. Shift+Enter, Option+Enter and Ctrl+J also do it, where the terminal sends them |
| esc | Stop following a build (it keeps going) |
A conversation is the same everywhere it's open: while Letterpress is idle, what's said about it on Letterpress for iOS (or in another terminal) shows here as it's said, marked "from another device", and a build started there is followed here.
Come back to work with letterpress -c (the last conversation in this folder) or letterpress -r (choose one; -r <words or id> opens it). Up finds what you typed here in earlier sessions; prompts are kept owner-only in ~/.letterstory/letterpress-history.json.
letterpress --bypass-permissions is for when you don't want to stop: builds skip the preview and go straight to a pull request, for this session only. It never merges (an organization's own auto-merge setting still applies), and it still stops when the repo isn't one of the account's sites. Letterpress can still ask when it truly can't act. With -p, it builds even if an open build asks the same, and -p --plan prints the plan and builds nothing.
A paste keeps its lines. A long one shows as [Pasted #1, 40 lines] and its words go with the message; too long for a message, it goes as an attached file.
When something that took 15 seconds or more ends (a build, a reply, a question for you), the terminal's bell rings, and iTerm2, Ghostty, WezTerm and kitty also show a desktop notification. LETTERPRESS_NO_NOTIFY=1 turns it off.
A pull request that will merge itself says so in the build's summary, with how to stop it (a merges list on done in --json).
letterpress "add a pricing page" opens Letterpress and sends it; with -c or -r, it goes into that conversation.
On a light terminal the colours switch to darker ones. Letterpress asks the terminal for its background; LETTERPRESS_THEME=light|dark settles it by hand.
For scripts and agents: letterpress -p "add a pricing page" [--json]. A build refused because the free tokens are used says where to pick a plan; with --json it is {"type":"error","code":"CARD_REQUIRED",…} (or PAYMENT_FAILED, OUT_OF_TOKENS), and it exits 3, as the letterstory CLI does.
Developing
npm install
node bin/letterpress.mjs # or: npm link, then letterpressPlain ESM, no build step: the screen is Ink with htm in place of JSX. src/letterstory/ is copied from the letterstory CLI (cli/lib/client.mjs, oauth.mjs) so both share one sign-in.
Testing
npm testnode --test over test/*.test.mjs, with no network and no real sign-in: every test runs
against a fake Letter server (test/helpers/fake-server.mjs) that speaks the same MCP JSON-RPC
and records every request, and LETTERSTORY_CONFIG_HOME points at a temp folder so
~/.letterstory is never read or written. The screen is rendered with ink-testing-library and
driven key by key.
logo,files,terminal,session,conversation,build: each module on its own.prompt-input: editing keys, the/and@menus, history, dragged-in files.app: the whole screen against the fake server: talking, questions back, builds followed to their pull requests, uploads, secrets refused, every command, stopping.cli: theletterpresscommand itself:-p,--json, exit codes,--help,--version.invariants: what Letterpress promises. A session never changes a file in your folder; it talks only to the Letter server; it runs no model and edits no code; and the one-shot path makes the console Build box's exact calls (read from the app's source when it is checked out next to this repo, or whereverLETTERSTORY_APP_REPOpoints).
Releasing
From your own Terminal (npm asks for your security key in the browser, which a non-interactive shell can't do):
cd ~/Desktop/letterpress && npm version patch && npm publish && git push --follow-tagsInstalled copies pick it up on their own within the hour, or right away with /update.
