A contemplative daily reading practice — open book APIs as your library, real public-domain passages to sit with, and a reading journal that's yours.
Reading trackers log what you read; ebook CLIs fetch files. passage makes a daily practice out of real public-domain texts: today serves an opinionated pick, sit shows a real Project Gutenberg passage and takes your reflection, journal keeps them, and shelf/next/stats track your reading. Everything is local SQLite — the practice is yours.
Authentication
No key required. Open Library and Gutendex (Project Gutenberg) are keyless; Google Books works anonymously. Set GOOGLE_BOOKS_API_KEY only to lift the anonymous rate limit.
Quick Start
# find a book; results flag which have free full text
passage search "marcus aurelius"
# an opinionated public-domain pick for today
passage today
# read a real Gutenberg passage and capture a reflection
passage sit 2680 --note "start slow"
# read back your reflections
passage journal
# add a book to your want-to-read shelf
passage shelf add OL45804W --to want
Unique Features
These capabilities aren't available in any other tool for this API.
The practice
-
today — An opinionated public-domain book or passage to read today, rotated against what you've recently sat with.
Reach for this to start a daily reading practice without deciding what to read.
passage today --agent
-
sit — Fetch a real Project Gutenberg passage, show an excerpt to read, and capture your reflection to your local journal.
Use this for the core contemplative loop: read a real passage, write what it left you with.
passage sit 1342 --note "Austen's irony still lands"
-
journal — Your reflections over time, newest first — the record of your reading practice.
Use this to read back what your reading has left you with.
passage journal --limit 20
Your shelf
-
next — Ranks your want-to-read shelf against your reading history to suggest what to pick up next.
Use this when you've finished a book and want the next one off your own shelf.
passage next
-
stats — Your reading pace, top subjects, and rating distribution from your local log.
Use this to see your reading habits over time.
passage stats
Recipes
The daily loop
passage today && passage sit <id> --note "..."
Get today's pick, then sit with its passage and journal a reflection.
Find something with free text
passage search "stoicism" --json --select docs.title,docs.has_fulltext
Search and narrow to which results have free full text.
Read back the practice
passage journal --limit 30
Your recent reflections, newest first.
Usage
Run passage-pp-cli --help for the full command reference and flag list.
Paths & environment variables
This CLI separates local files into four path kinds:
| Kind | Contents |
|---|
config | User-editable settings such as config.toml and saved profiles |
data | Durable local data such as data.db |
state | Runtime state such as persisted queries, jobs, and teach.log |
cache | Regenerable HTTP/cache files |
Each kind resolves independently. The ladder is:
- Per-kind env var:
BOOK_GOAT_CONFIG_DIR, BOOK_GOAT_DATA_DIR, BOOK_GOAT_STATE_DIR, or BOOK_GOAT_CACHE_DIR
--home <dir> for this invocation
BOOK_GOAT_HOME for a flat relocated root
- XDG env vars:
XDG_CONFIG_HOME, XDG_DATA_HOME, XDG_STATE_HOME, XDG_CACHE_HOME
- Platform defaults matching existing installs
For containers and agent sandboxes, prefer a single relocated root:
export BOOK_GOAT_HOME=/srv/passage
passage-pp-cli doctor
Under BOOK_GOAT_HOME=/srv/passage, the four dirs resolve to /srv/passage/config, /srv/passage/data, /srv/passage/state, and /srv/passage/cache.
MCP servers do not receive CLI flags from the host. Put relocation in the host env block:
{
"mcpServers": {
"passage": {
"command": "passage-pp-mcp",
"env": {
"BOOK_GOAT_HOME": "/srv/passage"
}
}
}
}
Precedence matters in fleets: an ambient per-kind variable such as BOOK_GOAT_DATA_DIR overrides an explicit --home for that kind. Use BOOK_GOAT_HOME or the per-kind variables for durable fleet relocation; treat --home as the weaker per-invocation lever.
Relocation is one-way. Unsetting BOOK_GOAT_HOME does not move files back to platform defaults, and doctor cannot find files left under a former root. Move the files manually before unsetting relocation variables.
Existing installs keep working because the platform-default rung matches the legacy layout. Run passage-pp-cli doctor --fail-on warn to check path warnings in automation.
Commands
authors
Manage authors
passage-pp-cli authors <authorId> - Biographical metadata for an Open Library author.
search-json
Manage search json
passage-pp-cli search-json - Full-text search over Open Library's catalog. Returns works with title, author, year, cover, and full-text availability.
works
Manage works
passage-pp-cli works <workId> - Full metadata for an Open Library work (description, subjects, covers, links).
Self-learning loop
This CLI caches per-question discovery so repeat queries skip the walk and structurally similar queries get answered via entity substitution. The loop also self-captures: every invocation is journaled locally, and failed-flag corrections plus fresh teaches surface as candidates on the next recall for confirm/reject judgment. Agents call recall before discovery and fire teach & after answering. See the ## Automatic learning section in SKILL.md for the full protocol.
passage-pp-cli recall <query> - Look up cached resources for a query before running discovery
passage-pp-cli teach - Record a query -> resource mapping (silent on success, safe to background with &)
passage-pp-cli learnings list - Inspect taught rows
passage-pp-cli learnings forget <query> - Undo a teach
passage-pp-cli learnings candidates - List auto-captured candidates awaiting confirm/reject
passage-pp-cli learnings stats - Local loop metrics: recall hit rate, teach-to-reuse, playbook resolution, candidate counts
passage-pp-cli teach-pattern - Install a query/resource template up front
passage-pp-cli teach-lookup - Add an entity mapping (e.g. country code, team alias) for pattern substitution
Pass --no-learn or set BOOK_GOAT_NO_LEARN=true to disable the loop for deterministic flows.
The local store's schema version stamp is one-way: once this version of passage-pp-cli opens the database, older binaries refuse it with a version error — upgrade the binary rather than downgrading.
Output Formats
# Human-readable table (default in terminal, JSON when piped)
passage-pp-cli authors mock-value
# JSON for scripting and agents
passage-pp-cli authors mock-value --json
# Filter to specific fields
passage-pp-cli authors mock-value --json --select id,name,status
# Dry run — show the request without sending
passage-pp-cli authors mock-value --dry-run
# Agent mode — JSON + compact + no prompts in one flag
passage-pp-cli authors mock-value --agent
Agent Usage
This CLI is designed for AI agent consumption:
- Non-interactive - never prompts, every input is a flag
- Pipeable -
--json output to stdout, errors to stderr
- Filterable -
--select id,name returns only fields you need
- Previewable -
--dry-run shows the request without sending
- Read-only by default - this CLI does not create, update, delete, publish, send, or mutate remote resources
- Offline-friendly - sync/search commands can use the local SQLite store when available
- Agent-safe by default - no colors or formatting unless
--human-friendly is set
Exit codes: 0 success, 2 usage error, 3 not found, 5 API error, 7 rate limited, 10 config error.
Health Check
passage-pp-cli doctor
Verifies configuration and connectivity to the API.
Configuration
Run passage-pp-cli doctor to see the resolved config, data, state, and cache directories. The platform-default config path is ~/.config/passage-pp-cli/config.toml; --home, BOOK_GOAT_HOME, and per-kind env vars can relocate it.
Static request headers can be configured under headers; per-command header overrides take precedence.
Troubleshooting
Not found errors (exit code 3)
- Check the resource ID is correct
- Run the
list command to see available items
API-specific
- 403 or rate-limited from Open Library / Gutendex — These keyless APIs allow ~1 request/second anonymously; passage backs off — retry, or slow bulk syncs.
- sit says no text available — Only public-domain books on Project Gutenberg have full text — use a Gutenberg id (the number in a gutendex /books result), not an Open Library id.
- Google Books returns 'not available in this country' — passage sends country=US by default; enrichment is optional and off the core loop.
Sources & Inspiration
This CLI was built by studying these projects and resources:
Generated by CLI Printing Press