commando 1.0.0

An interactive CLI tool to help you write conventional commit messages with ease.
commando-1.0.0 is not a library.

Grit

A modern, interactive Git commit message tool written in Rust

Grit is a command-line tool that helps developers write better Git commit messages by providing an interactive interface with support for Conventional Commits format. Built with Rust for performance and reliability.

Features

  • 🎯 Interactive Mode - Step-by-step guided commit message creation
  • ✏️ Editor Mode - Open your favorite text editor with a pre-filled template
  • Direct Mode - Quick commits from command line arguments
  • 🎨 Custom Syntax - Domain-specific language (DSL) for commit message templates
  • 📝 Conventional Commits - Built-in support for the Conventional Commits specification
  • 🔄 Git Integration - Seamless integration with Git workflow
  • 🏗️ Hexagonal Architecture - Clean, maintainable, and testable codebase

Quick Start

Installation

# Using the install script (Unix-like systems)
curl -fsSL https://raw.githubusercontent.com/tgenericx/commando/main/install.sh | sh

# Using PowerShell (Windows)
iwr -useb https://raw.githubusercontent.com/tgenericx/commando/main/install.ps1 | iex

# Building from source
cargo install commando

Basic Usage

# Interactive mode (default)
commando

# Editor mode
commando

# Direct mode
commando -m "feat: add new feature"

# With scope
commando -m "fix(api): resolve authentication issue"

Project Structure

commando/
├── src/
│   ├── adapters/       # External interfaces (Git, UI)
│   ├── compiler/       # DSL lexer, parser, and AST
│   ├── domain/         # Core business logic
│   ├── input/          # Input collection strategies
│   ├── ports/          # Interface definitions (traits)
│   ├── app.rs          # Application orchestration
│   ├── cli.rs          # CLI argument parsing
│   └── main.rs         # Entry point
├── docs/               # Comprehensive documentation
└── Cargo.toml          # Project configuration

Documentation

Key Concepts

Conventional Commits

Grit follows the Conventional Commits specification:

<type>(<scope>): <subject>

<body>

<footer>

Supported types:

  • feat - A new feature
  • fix - A bug fix
  • docs - Documentation changes
  • style - Code style changes (formatting, semicolons, etc.)
  • refactor - Code refactoring
  • perf - Performance improvements
  • test - Adding or updating tests
  • build - Build system changes
  • ci - CI configuration changes
  • chore - Other changes that don't modify src or test files
  • revert - Reverts a previous commit

Input Modes

  1. Interactive Mode - Prompts user through each commit message section
  2. Editor Mode - Opens configured editor with a template
  3. Direct Mode - Accepts complete message from command line

Architecture Highlights

Grit uses Hexagonal Architecture (Ports & Adapters):

graph TB
    CLI[CLI Interface]
    App[Application Core]
    Domain[Domain Logic]
    
    GitPort[Git Port]
    UIPort[UI Port]
    InputPort[Input Port]
    
    GitAdapter[Git Adapter]
    TerminalAdapter[Terminal Adapter]
    InteractiveInput[Interactive Input]
    EditorInput[Editor Input]
    DirectInput[Direct Input]
    
    CLI --> App
    App --> Domain
    App --> GitPort
    App --> UIPort
    App --> InputPort
    
    GitPort -.implements.- GitAdapter
    UIPort -.implements.- TerminalAdapter
    InputPort -.implements.- InteractiveInput
    InputPort -.implements.- EditorInput
    InputPort -.implements.- DirectInput

Development

# Clone the repository
git clone https://github.com/tgenericx/commando.git
cd commando

# Build the project
cargo build

# Run tests
cargo test

# Run with logging
RUST_LOG=debug cargo run

# Install locally
cargo install --path .

Contributing

Contributions are welcome! Please read our Development Guide for details on:

  • Code structure and organization
  • Testing practices
  • Pull request process
  • Code style guidelines

License

LICENSE

Credits

Built with ❤️ using:

  • Rust
  • Clap - Command line argument parsing

Related Projects