Skip to content

Add pipe-friendly plain-text defaults to list commands - #21

Merged
polymorcodeus merged 2 commits into
mainfrom
more-formatting
Aug 30, 2026
Merged

Add pipe-friendly plain-text defaults to list commands#21
polymorcodeus merged 2 commits into
mainfrom
more-formatting

Conversation

@polymorcodeus

Copy link
Copy Markdown
Owner

Summary

Adds plain-text default output to non-interactive list commands so book composes with fzf, jq, and shell pipelines without requiring --format. Structured JSON/TOML output remains available via --format.

What's new

  • Plain-text defaults - shelf list, collection list, mark list, and mark list --trash now print one item per line when --format is omitted.
  • Removed format enforcement - the Before hooks that hard-errored on missing --format are gone; --format is now opt-in structured output.
  • Consistent mark formatting - normal and trashed mark lists both default to title URL per line, matching mark search.
  • Documentation updates - README and AGENTS.md now describe the plain-text default and the optional --format flag.

Usage

Command Purpose
book shelf list List shelf names, one per line
book collection list --shelf <name> List collection names, one per line
book mark list --shelf <name> --collection <name> List marks as title URL
book mark list --trash List trashed marks as title URL
book <list command> --format json Opt into JSON output
book <list command> --format toml Opt into TOML output

Behavior changes / guardrails

  • Interactive mode is unchanged; --format only affects non-interactive list output.
  • Empty --format now yields plain text instead of an error.
  • The existing JSON/TOML output format and content are unchanged.

Testing

  • Smoke-tested plain-text defaults and structured JSON/TOML output for shelf list, collection list, and mark list.
  • make check runs fmt, vet, lint, and tests; all green.

@polymorcodeus
polymorcodeus merged commit 38baa6a into main Aug 30, 2026
4 checks passed
@polymorcodeus
polymorcodeus deleted the more-formatting branch August 30, 2026 01:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant