Skip to content

About

Writebook CLI, MCP and agent skills

Topics

Resources

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Writebook CLI

Read, clone and edit books on any Writebook instance.

Installation

With mise:

mise use -g github:basecamp/writebook-cli

On Omarchy:

omarchy-mise-install github:basecamp/writebook-cli writebook

To upgrade, run writebook upgrade.

Usage

Sign in to your Writebook. The CLI prints a link to approve in the browser:

writebook instance add https://books.example.com

Add --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 4

To edit a book, clone it into a folder of Markdown files:

writebook clone https://books.example.com/4/field-notes
cd field-notes

Each 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 sunset](assets/sunset.jpg)        ← a picture

Edit the files with any tool, then sync like with git:

writebook status
writebook pull
writebook push

To 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 handbook

There'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 mcp

It 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:8080

Or 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:8080

To browse your books in the terminal, and add, delete, move and publish pages, run:

writebook tui

Run writebook --help for every command.

Development

cargo build --release
cargo test

tests/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 live

To publish a release, see RELEASING.md.

About

Writebook CLI, MCP and agent skills

Topics

Resources

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages