Skip to content

Add json output#28

Merged
veerendra2 merged 9 commits intomainfrom
27-output-is-adaptive-to-terminal-column-which-is-annoyingstupid
Mar 28, 2026
Merged

Add json output#28
veerendra2 merged 9 commits intomainfrom
27-output-is-adaptive-to-terminal-column-which-is-annoyingstupid

Conversation

@veerendra2
Copy link
Copy Markdown
Owner

@veerendra2 veerendra2 commented Mar 28, 2026

Summary

  • Add --json / -j flag for minimized, token-efficient JSON output (table fields only, no spinner)
  • Add --raw-json / -r flag for full raw Fitbit API response as compact JSON
  • Add output.py with table_display, json_display, and raw_json_display functions
  • Update all display_* functions in formatter.py with as_json=False parameter; JSON branch returns a plain snake_case dict, table branch unchanged
  • Simplify main.py to branch on output mode
  • Drop Python 3.10/3.11 support; require 3.12+
  • Add AGENTS.md with full contributor and agent guidance

@veerendra2 veerendra2 linked an issue Mar 28, 2026 that may be closed by this pull request
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 28, 2026

Tests Skipped Failures Errors Time
15 0 💤 0 ❌ 0 🔥 0.143s ⏱️

@veerendra2 veerendra2 requested a review from Copilot March 28, 2026 14:15
@veerendra2 veerendra2 marked this pull request as ready for review March 28, 2026 14:15
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds machine-readable JSON output modes to fitbit-cli and refactors display logic so the CLI can emit either rich tables or JSON for the same endpoints.

Changes:

  • Introduces --json and --raw-json output modes and routes output selection through a new fitbit_cli/output.py module.
  • Updates formatter.py display functions to support as_json dict returns in addition to table rendering.
  • Updates packaging/docs (version bump, Python requirement to 3.12+, README + new AGENTS guidance).

Reviewed changes

Copilot reviewed 9 out of 10 changed files in this pull request and generated 12 comments.

Show a summary per file
File Description
setup.py Updates metadata (license classifier) and raises python_requires to >=3.12.
fitbit_cli/output.py New output-mode layer for table vs JSON vs raw JSON output.
fitbit_cli/main.py Simplifies main flow to select output mode.
fitbit_cli/formatter.py Adds as_json branches to return plain dicts; table output remains via rich.
fitbit_cli/cli.py Adds --json/--raw-json flags and adjusts “no args” validation logic.
fitbit_cli/init.py Bumps package version to 1.6.0.
README.md Documents the new JSON modes and updates usage output snippet.
AGENTS.md Adds contributor/agent guidance (but currently includes duplicated/conflicting sections).
.gitignore Adds ignores for local/dev directories.
.envrc Adds a direnv/pyenv layout pin (may be problematic to commit).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 10 changed files in this pull request and generated 6 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 10 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 10 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@veerendra2 veerendra2 merged commit 0ff96f3 into main Mar 28, 2026
6 checks passed
@veerendra2 veerendra2 deleted the 27-output-is-adaptive-to-terminal-column-which-is-annoyingstupid branch March 28, 2026 15:12
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.

output is adaptive to terminal column, which is annoying(stupid)

2 participants