Skip to content

Subcommand flag is --json (boolean) instead of --format (markdown|json|csv) #22

Closed

Description

@DTTerastar

Severity

major

Summary

Every export subcommand exposes a boolean --json flag rather than the contract's --format markdown|json|csv. As a result:

  • Users can't request markdown at all (it's not the default and there's no flag for it).
  • The documented behaviour in prime / README — --format json, --format csv — does not work on the shipped binary.
  • Cross-CLI shell scripts that pass --format json to every quantcli tool fail here.

Reproduce

$ withings-export activity --help
Flags:
  --json           Output as JSON instead of CSV
  --since string   ...
$ withings-export activity --format json
Error: unknown flag: --format
$ withings-export activity --format markdown
Error: unknown flag: --format

Same on sleep, workouts, measurements, intraday.

Expected

Per the contract and the source's own validateFormat helper in cmd/shared.go:

--format markdown   (default)
--format json       (pretty-printed JSON array; epoch seconds for timestamps)
--format csv        (spreadsheet-friendly columnar output)

Implemented on main (PR #7) — missing from v0.2.1 (see #14). If --json needs to live on for backwards compat, alias it to --format json and mark it deprecated.

Activity

  1. DTTerastar commented on Apr 25, 2026

    @DTTerastar
    ContributorAuthor

    Does not reproduce against HEAD b580683. activity|sleep|workouts|measurements|intraday --help all show --format string Output format: markdown (default, fitdown-style), json, or csv (default "markdown") and the bool --json is gone. --format markdown|json|csv all work. Fixed by PR #7. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions