CLI Reference
Your bookshelf, from the terminal.
The Spine CLI is a single-file command-line tool that talks to the same API as the mobile app. Search the catalog, shelve books, rate them, and pull recommendations from your reading companion — all without leaving your terminal.
Overview
Every command returns plain text, color-coded where it helps, and accepts book titles as natural strings. Anywhere you pass a <title>, the CLI resolves it against your catalog or runs a lookup, so you don't need to hunt for IDs.
The tool is a single TypeScript entrypoint. Run it with bun or compile with bun build and alias spine to it.
Install
You'll need Bun (1.0+) or Node 18+. The CLI ships as a single file in apps/cli/src/index.ts.
# clone the CLI source (private beta access required)
$ git clone git@github.com:Jbern16/spine.git
$ cd spine/apps/cli
# run without installing
$ bun src/index.ts search "piranesi"
# or alias globally
$ alias spine="bun $(pwd)/src/index.ts"
#developer-access.
Configure
The CLI reads its API key from either ~/.spine.json or the SPINE_API_KEY environment variable. The env var takes precedence.
{
"apiKey": "sk_spine_abc123...",
"apiUrl": "https://spine-api.fly.dev"
}
Or via environment variables:
$ export SPINE_API_KEY=sk_spine_...
$ export SPINE_API_URL=https://spine-api.fly.dev # optional, this is the default
Generating a key
Open the Spine mobile app, go to Settings → API Key, and tap Generate. Your key starts with sk_spine_ and is shown once — copy it before dismissing the screen.
~/.spine.json or your secrets manager; it won't be shown again.
To revoke access entirely, open Settings → API Key and delete it, or DELETE /users/me/api-key against the API.
First run
$ spine search "the dispossessed"
The Dispossessed by Ursula K. Le Guin (9780061054884)
The Dispossessed by Ursula K. Le Guin (9780062823403)
...
$ spine add "the dispossessed" --status reading
✓ Added to shelf as reading
$ spine ask "the dispossessed"
This will surprise you because it sounds political, but what
it actually is is a portrait of a man who is an outsider on
every world he ever stands on...
Reading
Commands for finding books in the catalog and looking up metadata.
Search books by title, author, or keyword. Returns up to ten matches with ISBN.
- query string · required Search term. Quote multi-word queries.
$ spine search "dune frank herbert"
Full book details: author, publisher, page count, year, series info, moods, ISBN, description.
$ spine book "project hail mary"
Author profile: bio, birth/death years, complete bibliography, and series.
$ spine author "Ursula K. Le Guin"
If a book belongs to a series, returns the series name and every book in reading order.
$ spine series "the name of the wind"
Books similar to a given title, using catalog metadata and the recommendation model.
$ spine similar "the seven husbands of evelyn hugo"
Lists every mood category you can browse by (Cozy & Comforting, Dark & Brooding, Strange & Unsettling, and so on).
$ spine moods
Checks whether a book is already in the Spine catalog. Returns the book ID if found.
$ spine resolve "dune"
Shelf
Manage your bookcase: which books you own, which you're reading, and how they landed.
Displays your bookcase with status (color-coded) and rating emoji.
-
--status
string · default: all
Filter by
read,reading,want, orall. - --limit number · default: 20 How many entries to return (1–500).
$ spine shelf --status reading --limit 10
Adds a book to your bookcase. If it's not in the catalog yet, the CLI resolves it via search.
-
--status
string · default: want
want,reading, orread. -
--rating
string · optional
Only valid with
--status read:loved,liked, ordisliked.
$ spine add "the midnight library" --status reading
Rates a book and marks it as read if it wasn't already. Ratings are loved, liked, or disliked.
$ spine rate "project hail mary" loved
Removes a book from your bookcase entirely. This is permanent.
$ spine remove "twilight"
Posts a short review (max 280 characters) for a book on your shelf.
$ spine review "project hail mary" "Amazing hard sci-fi with humor and heart"
Recommendations
See what your companion picked, ask it to explain a book, or dismiss something that doesn't fit.
Your current recommendations with companion reasoning next to each title.
$ spine recs
Today's single featured pick — the one your companion wants to surface above the others.
Ask your companion why you might love a book, how it connects to your taste, and any caveats.
$ spine ask "the seven husbands of evelyn hugo"
Pass on a recommendation. Your companion learns from the dismissal.
Kicks off a fresh round of recommendations. New picks show up within a minute.
Shelves & building
Custom shelves are curated sub-collections inside your bookcase. You can build them by hand or ask your companion to assemble one from a prompt.
Manages custom shelves. Without a subcommand, lists every shelf you own. With a subcommand, creates, views, edits, or deletes one.
-
create <name>
string
Creates a new shelf. Accepts
--desc. - view <name> string Lists the books on a shelf.
-
add <book>
string
Adds a book from your bookcase to a shelf. Requires
--shelf <name>. -
remove <book>
string
Removes a book from a shelf. Requires
--shelf <name>. - delete <name> string Deletes a shelf. Books stay in your bookcase.
$ spine shelves
$ spine shelves create "Beach Reads" --desc "Summer 2026"
$ spine shelves view "Beach Reads"
$ spine shelves add "The Midnight Library" --shelf "Beach Reads"
Creates a shelf and populates it with books by title in one go. Each title gets resolved against the catalog, added to your bookcase if needed, then placed on the new shelf. Reports what it found and what it couldn't.
$ spine shelves-from "Cozy Mysteries" \
"The Body in the Library" \
"A Murder Most Natural"
Asks your companion to build a themed shelf from a natural-language prompt. Returns a shelf name and up to ten picks with reasoning for each.
$ spine build "cozy mysteries set in bookshops with female protagonists"
Likes or unlikes a shelf, custom list, or review. Toggles, so running it twice undoes the like.
-
type
enum · required
list,review, orshelf. - target string · required The name of the list or shelf, or the ID of the review.
$ spine like list "Beach Reads"
Social
Follow other readers and see what they're shelving.
Your friends' recent activity: reviews, books added, likes. Chronological.
Follow a Spine user by username (no @).
$ spine follow "sarah_reads"
Your 20 most recent notifications: likes, follows, new recommendations.
Admin
Key management and catalog housekeeping.
Generates a new API key and prints instructions for saving it to ~/.spine.json. Rotates the existing key if you have one.
Reports a data issue with a book. Requires librarian status.
-
--type
string · default: bad_data
bad_cover,bad_data,wrong_author, orbad_shop_link.
$ spine report "the hobbit" --type bad_cover
Prints the enrichment queue status: how many books are pending, done, or failed.