smartcommit is an AI-powered CLI tool that transforms the way commit messages are crafted. By analyzing staged changes and engaging users with clarifying questions, it generates structured, semantic commit messages that adhere to Conventional Commits standards. Streamline documentation and make your coding process more efficient.
smartcommit is an AI-powered command-line interface (CLI) tool designed to enhance coding practices by ensuring that developers write clear and structured commit messages. By leveraging intelligent analysis, smartcommit helps coders adhere to the Conventional Commits format, improving both code documentation and collaboration.
Key Features
- AI-Powered Analysis: Automatically examines your staged
git diffto determine what changes have been made, providing context for commit messages. - Interactive Q&A: Engages users with specific questions to capture insights about the intent behind the code modifications, ensuring that the "why" is understood and documented.
- Multiple AI Providers:
- OpenAI (GPT-4o): Offers high accuracy and performance for commit message generation.
- Ollama (Llama 3.1): Allows for a privacy-focused option by enabling local model execution at no cost.
- Conventional Commits Compliance: Ensures that all commit messages strictly follow the Conventional Commits guidelines (using types like
feat,fix,chore, etc.) for improved readability and automation. - User-Friendly TUI: Features a responsive and easy-to-navigate Terminal User Interface built with Bubble Tea, streamlining the experience of generating commit messages.
How It Works
Step-by-Step Usage
- Stage Changes: Begin by staging your changes using:
git add . - Run smartcommit: Execute the smartcommit tool:
smartcommit - Follow the Interface:
- On first use, select your preferred AI provider (OpenAI or Ollama) and set up the configuration.
- The AI analyzes the staged changes and prompts with relevant questions to gather necessary context.
- Review the AI-generated commit message which is easily editable before confirming the commit.
Manual Mode
Developers who prefer to write their own messages can opt for manual mode, selecting "I already know what to write" from the main menu to utilize their default git editor.
Configuration and Environment Variables
smartcommit saves configuration settings in a local file, typically located at ~/.smartcommit/config.json. Additionally, it supports environment variables like OPENAI_API_KEY, which can streamline setup processes.
Contribution Opportunities: Contributions are welcomed, with guidelines available for submitting pull requests to enhance the project further.
No comments yet.
Sign in to be the first to comment.