Reference

trove shelf

Updated 1 Oct 2026

On this page

For agents

Load this page when: you need to create or change a shelf, set the active shelf, or run trove init and trove shelf sync

  • Pass --confirm to trove shelf delete when the shelf holds books.
  • Use trove init to write ./.trove/shelf.json, then trove shelf sync to reconcile it with the cloud shelf.
  • Every shelf argument takes a slug, an id or a name that ignores case.

A shelf is a named group of books. The librarian ranks books on the active shelf higher. See Shelves for the idea.

Quick reference

CommandWhat it does
trove shelf listList your shelves
trove shelf showShow a shelf and its books
trove shelf createCreate a shelf
trove shelf renameRename a shelf
trove shelf deleteDelete a shelf. The books stay in your library
trove shelf addAdd books to a shelf
trove shelf removeRemove books from a shelf
trove shelf useSet the active shelf for this project
trove shelf currentShow the active shelf
trove shelf syncReconcile ./.trove/shelf.json with the cloud shelf
trove initCreate the shelf manifest

trove shelf list

Lists your shelves. A star marks the active shelf for the current directory.

Usage

bash
trove shelf list [--json]

Output

┌───┬──────────┬──────────┬───────┬─────────┬─────┐
│   │ Name     │ Slug     │ Items │ Color   │ Pos │
├───┼──────────┼──────────┼───────┼─────────┼─────┤
│ * │ Backend  │ backend  │ 4     │ #5B7CFA │ 0   │
└───┴──────────┴──────────┴───────┴─────────┴─────┘

With --json the output is { "shelves": [...] }. Each shelf has id, name, slug, color, position and itemCount.

REST equivalent: Shelves API.

trove shelf show

Shows one shelf and its books, in the same table as trove items list.

Usage

bash
trove shelf show TARGET [--json]

Arguments and flags

ArgumentValueDefaultMeaning
TARGETslug, id or namerequiredShelf to show.

With --json the output has shelf, items, enrichmentQueue and pickUrl.

Errors

MessageFix
Shelf '{name}' not found. Available: {list}Use a name from the list.

trove shelf create

Creates a shelf. The slug comes from the name.

Usage

bash
trove shelf create NAME [--color HEX] [--json]

Arguments and flags

Argument or flagValueDefaultMeaning
NAMEtext, 1 to 50 charactersrequiredDisplay name.
--color#RRGGBBnoneSix-digit hex color.

Example

bash
trove shelf create Backend --color "#5B7CFA"

Output

✓ Created shelf 'Backend' (slug: backend)

Errors

MessageFix
A shelf with this name already existsPick another name.
Shelf limit reached ({n}). Delete an unused shelf to make room.Delete a shelf you no longer use.

REST equivalent: Shelves API.

trove shelf rename

Renames a shelf. The slug changes with the name.

Usage

bash
trove shelf rename TARGET NEW_NAME [--json]

Example

bash
trove shelf rename backend "Backend services"

Output

✓ Renamed 'Backend' → 'Backend services' (slug: backend-services)

trove shelf delete

Deletes a shelf. Books on it stay in your library.

Usage

bash
trove shelf delete TARGET [--confirm] [--json]

Arguments and flags

Argument or flagValueDefaultMeaning
TARGETslug, id or namerequiredShelf to delete.
--confirmnoneoffRequired when the shelf is not empty. Agents must pass it on purpose.

Errors

MessageFix
Shelf '{name}' has {n} item(s). Re-run with --confirm to delete.Re-run with --confirm.

REST equivalent: Shelves API.

trove shelf add

Adds one or more books to a shelf. Adding a book that is already there changes nothing.

Usage

bash
trove shelf add SHELF ITEMS... [--json]

Arguments and flags

ArgumentValueDefaultMeaning
SHELFslug, id or namerequiredTarget shelf.
ITEMSone or more idsrequiredBooks to add.

Example

bash
trove shelf add backend cmabc123 cmdef456

Output

✓ Added 2 items to 'Backend'.

With --json the output has added and, for ids you cannot access, notFound.

Errors

MessageFix
Provide at least one item id to add.Pass an id.

REST equivalent: Shelves API.

trove shelf remove

Removes books from a shelf. The books stay in your library.

Usage

bash
trove shelf remove SHELF ITEMS... [--json]

Output

✓ Removed 1 item from 'Backend'.

With --json the output is { "removed": 1 }.

REST equivalent: Shelves API.

trove shelf use

Sets the active shelf for this project. The pointer lives in ~/.trove/projects/<project>/active-shelf, never in the repository. A ./.trove/shelf.json file takes precedence over it.

Usage

bash
trove shelf use [TARGET] [--clear] [--json]

Arguments and flags

Argument or flagValueDefaultMeaning
TARGETslug, id or namenoneShelf to use. Omit it with --clear.
--clearnoneoffClear the active shelf.

Output

✓ Now using shelf 'Backend' (4 books). The librarian will give books in this shelf a relevance boost.

trove shelf current

Shows the active shelf for this project.

Usage

bash
trove shelf current [--json]

With --json the output has the same shape as trove shelf show. It prints nothing when no shelf is set.

trove shelf sync

Reconciles ./.trove/shelf.json with its cloud shelf. By default the file wins: the cloud shelf is changed to match it, then titles and authors in the file are refreshed.

Usage

bash
trove shelf sync [--from-cloud] [--dry-run] [--yes] [--json]

Arguments and flags

FlagValueDefaultMeaning
--from-cloudnoneoffReverse the direction. Rewrite the file's books from the cloud shelf. The why and topics of kept books stay.
--dry-runnoneoffShow the changes and apply nothing.
--yesnoneoffApply removals without a prompt. Needed when the file lists no books but the cloud shelf is not empty.

Example

bash
trove shelf sync --dry-run

Output

Dry run — shelf 'Backend' would change:
  + cmdef456
  - cmold789

Errors

MessageFix
No ./.trove/shelf.json in this directory. Run `trove init` to create one.Run trove init.
Sync would remove {n} book(s) from shelf '{name}' ({ids}). Re-run with --yes to confirm or --dry-run to preview.Check the list, then re-run with --yes.
Shelf '{slug}' declared in ./.trove/shelf.json was not found in your accountThe shelf was deleted. Run trove init --name for a new one.

trove init

Creates ./.trove/shelf.json. Commit the file so your team and agents share the same shelf. Use exactly one of --from or --name.

Usage

bash
trove init [--from SHELF | --name NAME] [--json]

Arguments and flags

FlagValueDefaultMeaning
--fromslug, id or namenoneSeed the file from an existing cloud shelf. Conflicts with --name.
--nametextnoneCreate a new empty cloud shelf and link it. Conflicts with --from.

Example

bash
trove init --name "Billing service"

Output

✓ Created shelf 'Billing service' (slug: billing-service)
✓ Wrote ./.trove/shelf.json (shelf 'billing-service', 0 books)
  Commit this file so your team and agents share the same shelf contract.

Errors

MessageFix
./.trove/shelf.json already exists. Edit it directly, or run `trove shelf sync` to reconcile it with the cloud.Edit the file, or sync.
Nothing to initialize from — no active shelf in this directory.Pass --from or --name.
    trove shelf | Trove