Skip to content

feat: add 'prime' subcommand for LLM agent orientation#21

Merged
DTTerastar merged 2 commits into
mainfrom
feat/prime-command
Apr 25, 2026
Merged

feat: add 'prime' subcommand for LLM agent orientation#21
DTTerastar merged 2 commits into
mainfrom
feat/prime-command

Conversation

@DTTerastar
Copy link
Copy Markdown
Collaborator

Summary

  • Adds the prime subcommand per quantcli shared contract §6 — a one-screen, LLM-targeted primer covering output formats, auth, date flags, every subcommand's JSON shape, and ready-to-run jq recipes.
  • Fixes three small gaps that the prime exposed when its examples were exercised end-to-end:
    • bodyweights list now accepts --format json (the prime's bodyweight-delta example uses it).
    • workouts stats --format json emits [] on empty windows instead of plain-text No workouts found..
    • printJSON no longer encodes nil slices as null — they're [], matching the prime contract.

Test plan

  • liftoff-export prime prints the primer.
  • Every prime example runs end-to-end and returns real data: workouts show today, workouts stats --since 30d --format json | jq '.[]|select(.type=="WR")...', workouts stats --exercise bench --since 1y --format json, bodyweights list --since 90d --format json | jq ....
  • bodyweights list --format json returns [{"date":"YYYY-MM-DD","weight":N}, ...].
  • workouts stats --since 2024-01-01 --until 2024-01-01 --format json[].
  • workouts list --since 2024-01-01 --until 2024-01-01 --format json[].

🤖 Generated with Claude Code

DTTerastar and others added 2 commits April 25, 2026 18:17
Per quantcli shared contract §6, every CLI exposes 'prime' printing a
one-screen primer aimed at LLM agents calling the CLI as a tool. Same
section structure across all three repos (WHAT IT IS / OUTPUT FORMATS /
AUTH / DATE FLAGS / SUBCOMMANDS / EXAMPLES / GOTCHAS) so an agent that
has read crono's prime knows where to look in liftoff's.
https://github.com/quantcli/common/blob/main/CONTRACT.md#6-the-prime-subcommand

Liftoff-specific content covers:
- workouts list/show/stats and bodyweights list/stats
- Local-zone date semantics
- LIFTOFF_API_BASE override for the periodic API host rotation
- jq recipes for volume math and bodyweight delta

Also extends the rootCmd Long description so 'liftoff-export --help'
points agents at 'prime' from the top.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Three small gaps the new 'prime' subcommand surfaced when its examples
were exercised end-to-end:

- 'bodyweights list' had no --format flag at all, but the prime's
  bodyweight-delta example pipes 'bodyweights list --since 90d --format
  json' into jq. Add --format json (markdown stays default) emitting
  [{"date":"YYYY-MM-DD","weight":N}, ...].

- 'workouts stats' printed plain-text "No workouts found." even when the
  caller asked for --format json, breaking jq pipelines on empty
  windows. Emit '[]' instead.

- printJSON encoded nil slices as 'null'. Match the prime's "JSON is
  '[]'" promise by special-casing nil slices via reflect.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@DTTerastar
Copy link
Copy Markdown
Collaborator Author

@claude rebase on main

@DTTerastar DTTerastar merged commit fbfae84 into main Apr 25, 2026
1 check passed
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