Read, clone and edit books on any Writebook instance.
With mise:
mise use -g github:basecamp/writebook-cliOn Omarchy:
omarchy-mise-install github:basecamp/writebook-cli writebookTo upgrade, run writebook upgrade.
Sign in to your Writebook. The CLI prints a link to approve in the browser:
writebook instance add https://books.example.comAdd --read-only if this device only needs to read books.
Find a book and read it:
writebook book list
writebook book contents 4
writebook read https://books.example.com/4/field-notes/12/getting-started
writebook search "roll back" --book 4To edit a book, clone it into a folder of Markdown files:
writebook clone https://books.example.com/4/field-notes
cd field-notesEach page is a Markdown file. index.md holds the book's settings and its
table of contents. The order of its lines is the order of the book:
---
title: Field Notes
author: Stanko
theme: green
cover: assets/cover.jpg
---
# Part One {theme=blue} ← a section
[Getting Started](getting-started.md) ← a page
 ← a pictureEdit the files with any tool, then sync like with git:
writebook status
writebook pull
writebook pushTo work with more than one Writebook, add each one under a short name and pick
it with --instance:
writebook instance add https://handbook.example.org --alias handbook
writebook book list --instance handbookThere's also an MCP server which allows agents to read and edit books directly on all configured instances. To give Claude access to it run:
claude mcp add writebook -- writebook mcpIt can also be used as a server to give anyone's agent access to a Writebook instance using their own logins:
writebook mcp --instance https://books.example.com --serve 127.0.0.1:8080Or run it with Docker:
docker run -p 8080:8080 ghcr.io/basecamp/writebook-cli mcp --instance https://books.example.com --serve 0.0.0.0:8080To browse your books in the terminal, and add, delete, move and publish pages, run:
writebook tuiRun writebook --help for every command.
cargo build --release
cargo testtests/live.rs runs against a real Writebook:
docker run -d --name writebook -p 3000:80 -e SECRET_KEY_BASE=$(openssl rand -hex 64) -e DISABLE_SSL=1 ghcr.io/basecamp/writebook:main
docker exec -i writebook bin/rails runner - < tests/support/seed.rb
WRITEBOOK_LIVE_URL=http://localhost:3000 cargo test --test liveTo publish a release, see RELEASING.md.