- Replace 3 nearly-identical createPR branches (70+ lines each)
with a single function using PLATFORM_CLI lookup table
- Add BaseContext interface and have PRContext/ProjectContext
extend it to eliminate field duplication
Co-Authored-By: Claude <noreply@anthropic.com>
Unify duplicated diff-collection logic from explain.ts, review.ts,
suggest.ts into a single collectDiff() that handles staged, unstaged,
and piped stdin sources, interactive file selection, diff truncation,
and project context collection.
Co-Authored-By: Claude <noreply@anthropic.com>
Extract duplicated ask() from commit.ts and pr.ts, and extract
the 100+ line inline raw-mode editor editMessage() from commit.ts
into a reusable editLine() with proper escape sequence buffering.
Co-Authored-By: Claude <noreply@anthropic.com>
Add hideCursor, showCursor, clearLine, moveUp, clearScreen,
visibleLength, padRight as centralized exports to eliminate
duplication across menu.ts, config.ts, and index.ts.
Also cache isColorEnabled result to avoid repeated env checks.
Co-Authored-By: Claude <noreply@anthropic.com>
- tty: fix isStdoutTTY to use fstat first, fall back to TERM heuristic
- git: fix commit regex to handle root-commit output format
- git: fix parseNameStatus to handle edge cases (empty lines, missing tabs)
- ai: fix readStream to cancel reader instead of releaseLock
- cli: remove dead code resolveFlagName function
- clipboard: fix inconsistent indentation
Co-Authored-By: Claude <noreply@anthropic.com>
Major CLI redesign introducing a mole-style interactive menu with grouped categories. Added new AI-powered subcommands: explain, review, changelog, and suggest. Includes streaming output, pipe support, and updated brand logo. Refactored codebase into command modules for maintainability.
Reviewed-on: #6
Revamp the configuration UI with an interactive editor that supports inline text editing, navigation, and field validation, replacing the previous sequential prompts. Add GitLab pull request creation support via the `glab` CLI, and extend back navigation to all interactive menus for a consistent user experience.
Reviewed-on: #4
Extract duplicate menu rendering logic from `index.ts` into a new `src/menu.ts` module, providing generic `selectOne` and `selectMany` functions. This reduces code duplication, improves maintainability, and adds consistent UI controls display across the commit flow and platform selection.
Reviewed-on: #3
Add a new `gai pr` subcommand that generates pull request titles and descriptions using AI, then creates the PR via GitHub CLI (`gh`) or Gitea CLI (`tea`). This extends the existing commit-generation system by reusing retry logic and prompt infrastructure, and introduces a `callAI` function that returns raw output (instead of pre-cleaned messages) to support structured PR responses.
Reviewed-on: #2