Skip to content

feat(cli): improve ergonomics with output modes, doctor command, and generated docs#91

Merged
electather merged 5 commits intorefactor/internal-seerr-clientfrom
feat/cli-ergonomics
Mar 16, 2026
Merged

feat(cli): improve ergonomics with output modes, doctor command, and generated docs#91
electather merged 5 commits intorefactor/internal-seerr-clientfrom
feat/cli-ergonomics

Conversation

@electather
Copy link
Owner

Summary

Closes #85

Stacks on #90. Adds three user-facing ergonomics improvements:

  1. --output/-o flag — commands that return structured data can now render as json (default), yaml, or table. Proof-of-concept on movies get and search multi; the pattern is documented for future commands.
  2. doctor command — runs five checks in order (server configured → reachable → API key configured → API key valid → server version) with short-circuit on failure. Outputs a human-readable table or --output json array.
  3. docs generate command — generates full CLI reference as Markdown files using cobra/doc.

Also updates CLAUDE.md with output conventions and seerrclient usage guidance.

Changes

  • cmd/apiutil/output.goOutputMode, AddOutputFlag, GetOutputMode, PrintOutput, PrintRawOutput, table renderer
  • cmd/movies/get.go — wired --output flag
  • cmd/search/multi.go — wired --output flag
  • cmd/doctor/doctor.go + check.go — doctor command with 5 checks, Run() exported for tests
  • cmd/docs/docs.go + generate.go — docs generate command
  • cmd/root.go — added doctor and docs commands; exempt from server validation in PersistentPreRunE
  • tests/output_mode_test.go — 3 new tests
  • tests/doctor_test.go — 4 new tests
  • CLAUDE.md — output conventions section

Test plan

  • go test -v ./... passes
  • go fmt ./... produces no diff
  • go build succeeds

Manual verification:

seerr-cli doctor
seerr-cli doctor --output json | jq .
seerr-cli movies get 550 --output yaml
seerr-cli movies get 550 --output table
seerr-cli search multi -q "matrix" --output table
seerr-cli docs generate --output-dir /tmp/cli-docs && ls /tmp/cli-docs/

Tests (TDD):

go test -v ./tests/ -run "TestDoctor|TestMoviesGet|TestSearchMultiTable"

Checklist

  • New tests added for new behaviour
  • Documentation updated (CLAUDE.md, command --help, comments)
  • No unrelated changes included

@electather electather merged commit 929f38f into refactor/internal-seerr-client Mar 16, 2026
@electather electather deleted the feat/cli-ergonomics branch March 16, 2026 18:29
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