Skip to content

Evgenii-Zinner/ez_commit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ez_commit

Interactive CLI tool for generating conventional commit messages with AI assistance.

A simple, fast, and human-in-the-loop commit workflow. Select files, let AI analyze your changes, review the message, and commit—all from the terminal.

Features

Interactive file selection - TUI-based multi-select of changed files
🤖 AI-powered messages - GitHub Copilot integration for smart commit messages
📝 Conventional Commits - Automatically formats to type(scope): description
✏️ Manual review - Edit the generated message before committing
Fallback analyzer - Works without Copilot with built-in smart analysis
🔍 Verbose mode - Debug details with -v flag

Quick Start

# Build
cargo build --release

# Run
./target/release/ez_commit

# With verbose output
./target/release/ez_commit -v

Usage

  1. Select files - Arrow keys to navigate, Space to toggle, Enter to confirm
  2. Review message - AI generates a commit message with summary + bullet points
  3. Edit (optional) - Your editor opens for final tweaks
  4. Commit - Changes are committed with your reviewed message

Example Workflow

🚀 ez_commit v0.1.0

📝 Found 3 file(s) with changes
  • src/main.rs
  • src/ai.rs
  • src/analyzer.rs

→ Select files to commit

✓ 2 file(s) selected

⚙️  Analyzing changes... done

🤖 Generating commit message... done

📄 Generated commit message:
  feat(ai): add support for detailed messages
  - Enhanced prompt structure
  - Improved extraction logic

✏️  Opening editor for review...

✅ Commit created successfully!

Architecture

Modules

  • git.rs - Git operations (status, diff, staging, commits)
  • tui.rs - Interactive terminal UI for file selection
  • ai.rs - Copilot CLI integration with smart extraction
  • analyzer.rs - Fallback analyzer (works without Copilot)
  • editor.rs - Opens user's editor for message review
  • main.rs - Orchestrates the workflow

Workflow

Git Status → TUI Selection → Diff Analysis → AI Message → Editor Review → Commit

Requirements

  • Rust 1.70+ (build time only)
  • Git installed
  • GitHub Copilot CLI (optional, uses fallback if unavailable)

GitHub Copilot Setup (Optional)

For AI-powered messages, install the new Copilot CLI:

# macOS
brew install gh-copilot

# Windows (winget)
winget install GitHub.Copilot.CLI

# Verify
copilot --version

See: https://github.com/github/copilot-cli

Options

USAGE:
    ez_commit [OPTIONS]

OPTIONS:
    -d, --diff-limit <DIFF_LIMIT>      Limit diff size (chars) [default: 5000]
    -t, --tree-depth <TREE_DEPTH>      Max depth for project tree [default: 3]
    -v, --verbose                      Show debug output
    -h, --help                         Print help

Commit Message Format

Generated messages follow Conventional Commits:

feat(scope): short description (max 72 chars)

- What was changed and why
- Another change
- Reason for change

Types

  • feat - New feature
  • fix - Bug fix
  • refactor - Code restructuring
  • chore - Maintenance (deps, docs, config)
  • test - Adding tests
  • style - Formatting changes
  • docs - Documentation updates

How It Works

With GitHub Copilot

  1. Analyzes your diff and project structure
  2. Sends to Copilot with structured prompt
  3. Extracts clean message from response using markers
  4. Falls back to analyzer if Copilot unavailable

Without Copilot (Fallback)

Smart analyzer detects:

  • Change type from diff patterns (feat/fix/refactor/etc.)
  • Scope from modified file paths
  • Description from context (function names, imports, etc.)

Dependencies

All dependencies use permissive licenses (MIT or Apache 2.0):

  • git2 - Git library
  • ratatui - Terminal UI framework
  • crossterm - Cross-platform terminal control
  • clap - CLI argument parsing
  • log / env_logger - Logging
  • tokio - Async runtime
  • anyhow / thiserror - Error handling
  • serde / serde_json - Serialization
  • tempfile - Temporary file handling

License

MIT License - See LICENSE file

Copyright (c) 2025 Evgenii Zinner

About

CLI tool for fast commiting using GitHub copilot

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages