Skip to content

feat: wire up --version and fail gracefully without a TTY - #20

Merged
kunjee17 merged 1 commit into
mainfrom
feat/cli-polish-and-docs
Aug 2, 2026
Merged

feat: wire up --version and fail gracefully without a TTY#20
kunjee17 merged 1 commit into
mainfrom
feat/cli-polish-and-docs

Conversation

@kunjee17

@kunjee17 kunjee17 commented Aug 2, 2026

Copy link
Copy Markdown
Owner

Two small CLI gaps plus the doc update for headless/MCP.

--version

#[command(version)] was never set, so --version errored and was absent from --help. Now irona --version prints irona 0.5.0.

No-TTY failure

Bare irona in a pipe or CI job called enable_raw_mode() and died with No such device or address (os error 6). Now it checks stdin/stdout up front and exits 1 with:

irona: the interactive TUI needs a terminal, but stdin or stdout is not a TTY.
       For non-interactive use:
         irona --clean <path>   delete artifacts and print a one-line summary
         irona --mcp            run as a Model Context Protocol server over stdio

The check sits after the --mcp and --clean branches, so both headless modes still run fine without a TTY (verified by piping each).

README

  • Usage section now covers all three modes with a flag table, replacing the TUI-only key list
  • Fixed the stale claim that irona "scans your home directory" — it scans PATH, default .
  • MCP section documents both tools' inputs and returned fields, their readOnlyHint/destructiveHint annotations, and that scan_artifacts includes gitignore-only matches (opposite of --clean's default)
  • Added claude mcp add irona -- irona --mcp
  • Fixed the Claude Code Stop hook example, which used a flat {"command": ...} that the real settings.json schema does not accept

Testing

83 tests pass (4 new: version flag, TTY precondition matrix, hint content). fmt and clippy clean.

--version was never enabled, so it was absent from --help and errored out.
Bare `irona` with no TTY died with a raw "No such device or address
(os error 6)" from enable_raw_mode; now it explains the problem and points
at --clean and --mcp, which both still work headless.

README documents all three modes, the full flag set, the MCP tool
schemas, and fixes the Claude Code Stop hook example to the real
settings.json shape.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@kunjee17
kunjee17 merged commit 570a4dc into main Aug 2, 2026
1 check passed
@kunjee17
kunjee17 deleted the feat/cli-polish-and-docs branch August 2, 2026 05:54
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