Skip to content

Add --status and --version flags to display account, credit information and client version#194

Merged
pedjaradenkovic merged 2 commits into
mainfrom
feat/add-status
May 25, 2026
Merged

Add --status and --version flags to display account, credit information and client version#194
pedjaradenkovic merged 2 commits into
mainfrom
feat/add-status

Conversation

@pedjaradenkovic

Copy link
Copy Markdown
Contributor

Implements a new --status flag that displays:

  • User information (name, email, organization owner)
  • API key label
  • Rendering credits (plan credits and purchased credits)
  • Progress bars showing credit usage
  • Expiration dates
  • Warning messages when credits are exhausted
  • Outdated client version warnings in red

Changes:

  • Add cli_output/ module for non-interactive CLI output formatting
    • status.py: Status display with progress bars
    • dry_run.py: Dry run output (moved from plain2code_utils.py)
    • render_summary.py: Render exit summary (moved from plain2code.py)
  • Add --status argument to plain2code_arguments.py
  • Add status() method to codeplain_REST_api.py
  • Update plain2code.py to handle --status early-exit
  • Add comprehensive unit tests in test_cli_output.py (23 tests)
  • Update CLAUDE.md documentation

Features:

  • Handles both timezone-aware and naive datetimes from API
  • Shows red/bold text for outdated client versions
  • Displays "expired" vs "expires" based on date
  • Handles null/empty credit states gracefully
  • Mutually exclusive with --dry-run and --full-plain

Testing:

  • 23 unit tests covering all status display functions
  • Edge cases: expired credits, timezone handling, null values
  • Mock API responses for isolated testing

Implements a new --status flag that displays:
- User information (name, email, organization owner)
- API key label
- Rendering credits (plan credits and purchased credits)
- Progress bars showing credit usage
- Expiration dates
- Warning messages when credits are exhausted
- Outdated client version warnings in red

Changes:
- Add cli_output/ module for non-interactive CLI output formatting
  - status.py: Status display with progress bars
  - dry_run.py: Dry run output (moved from plain2code_utils.py)
  - render_summary.py: Render exit summary (moved from plain2code.py)
- Add --status argument to plain2code_arguments.py
- Add status() method to codeplain_REST_api.py
- Update plain2code.py to handle --status early-exit
- Add comprehensive unit tests in test_cli_output.py (23 tests)
- Update CLAUDE.md documentation

Features:
- Handles both timezone-aware and naive datetimes from API
- Shows red/bold text for outdated client versions
- Displays "expired" vs "expires" based on date
- Handles null/empty credit states gracefully
- Mutually exclusive with --dry-run and --full-plain

Testing:
- 23 unit tests covering all status display functions
- Edge cases: expired credits, timezone handling, null values
- Mock API responses for isolated testing
@pedjaradenkovic pedjaradenkovic requested a review from NejcS May 22, 2026 14:15
@pedjaradenkovic pedjaradenkovic self-assigned this May 22, 2026

@NejcS NejcS left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good but I didn't test locally. Do you want testing?

Comment thread cli_output/dry_run.py

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔥

Comment thread cli_output/status.py
- Add --version argument to display 'codeplain version X.X.X'
- Update filename validation to allow --version without filename
- Add unit test for --version flag
- Version flag takes precedence (checked first in main())
@pedjaradenkovic pedjaradenkovic merged commit 1d4289e into main May 25, 2026
10 checks passed
@pedjaradenkovic pedjaradenkovic deleted the feat/add-status branch May 25, 2026 12:27
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.

2 participants