Skip to content

feat(cli): add interactive payload explorer#471

Closed
jmtts wants to merge 3 commits into
mainfrom
codex/improve-cli-output-interactivity-j3920z
Closed

feat(cli): add interactive payload explorer#471
jmtts wants to merge 3 commits into
mainfrom
codex/improve-cli-output-interactivity-j3920z

Conversation

@jmtts
Copy link
Copy Markdown
Collaborator

@jmtts jmtts commented Sep 4, 2025

Summary

  • make CLI payload output interactive with arrow-key navigation
  • fix CLI logger initialization so module names aren't treated as log levels
  • handle BaseModel payloads so Pydantic responses can be explored field by field
  • guard against missing payloads so the explorer skips messages without structured data
  • ensure arrow keys correctly traverse siblings and parent/child levels in the explorer
  • handle raw terminal escape sequences so down-arrow navigation works reliably
  • keep parent nodes visible and block entering primitive values while navigating
  • polish explorer UI with breadcrumb path, expand/collapse icons, and inline key hints

Testing

  • python -m werk24.cli.werk24 --help
  • pytest

https://chatgpt.com/codex/tasks/task_e_68b98c00c4e48332a257c0e05b972e24

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

Codex Review: Here are some suggestions.

Reply with @codex fix comments to fix any unresolved comments.

About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you open a pull request for review, mark a draft as ready, or comment "@codex review". If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex fix this CI failure" or "@codex address that feedback".

Comment thread werk24/cli/commands/techread.py Outdated
Comment on lines +7 to +12
from pydantic import BaseModel
from rich.console import Console
from rich.pretty import Pretty
from rich.tree import Tree
from rich.text import Text
import termios
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[P1] Guard POSIX-only termios imports to keep CLI usable on Windows

The new interactive explorer pulls in termios/tty at module import time. Those modules are only present on Unix, so importing werk24.cli.commands.techread now raises ModuleNotFoundError on Windows before the CLI can even parse arguments, even when the interactive view is never used. This makes python -m werk24.cli.werk24 --help fail on Windows, whereas the previous implementation printed payloads fine. Consider importing these modules lazily inside the explorer logic and falling back to a non-interactive display when they are unavailable.

Useful? React with 👍 / 👎.

@werk24 werk24 closed this Feb 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants