Skip to main content

Commify: You Should Commit Yourself.

Project description

Commify

Commify is a command-line interface (CLI) tool that generates meaningful, structured commit messages for Git repositories using AI. By analyzing the staged changes (diff) in your repository, it creates commit messages that follow conventional commit guidelines, optionally including emojis for better context and readability. See Commify website to know more. Don't forget to ⭐ the project!

Ollama provider can be slow without a good GPU or a very large AI model. It's not a Commify optimization problem.

Latest version: PyPI version
Stats: Downloads Downloads


✨ Features

  • AI-Powered Commit Messages: Generate concise and structured commit messages using the ollama local AI provider, G4F AI provider or Openai AI provider (Openai provider requires an apikey).
  • Emoji Support: Optionally include relevant emojis in commit messages.
  • Language Support: Generate commit messages in the language of your choice.
  • Customizable Providers: Specify the AI provider to use (g4f, ollama or openai).
  • Interactive Review System: Review and approve generated messages or request new ones.
  • Customizable Models: Specify the AI model to use.

🛠️ Installation

Windows

Make sure you have installed Git, python3.10+ and ollama (ollama is optional) Run the following:

pip install Commify

Linux

Make sure you have installed Git, python3.10+, pipx and ollama (ollama is optional) If you don't, use this command:

sudo apt install git
sudo apt install pipx

And install Commify:

pipx install Commify
pipx ensurepath

After that, restart your terminal and you will already have Commify installed.


🏗️ Usage

Run the commify CLI with the desired options:

commify <path_to_repo> [--lang <language>] [--emoji <True/False>] [--model <AI_model>] [--provider <AI_PROVIDER>] [--apikey <API_KEY>]

Examples

[!WARNING] In the future this section will be moved to docs/example-usage

Using Ollama Provider:

commify /path/to/repo --lang english --emoji True --model llama3.1 --provider ollama

Using G4F Provider:

commify /path/to/repo --lang english --emoji True --model gpt-4o --provider g4f

Using Openai Provider:

commify /path/to/repo --lang english --emoji True --model gpt-4o --provider openai

Using Openai Provider Without Saving an Apikey:

commify /path/to/repo --lang english --emoji True --model gpt-4o --provider openai --apikey sk_...

Using Groq Provider:

commify /path/to/repo --lang english --emoji True --model llama-3.3-70b-versatile --provider groq

Using Groq Provider Without Saving an Apikey:

commify /path/to/repo --lang english --emoji True --model llama-3.3-70b-versatile --provider groq --apikey gsk_...

Setting an Apikey for Groq Provider:

commify --save-apikey groq gsk_...

Setting an Apikey for Openai Provider:

commify --save-apikey openai sk_...

Modify an Apikey for Groq Provider:

commify --mod-apikey groq gsk_...

Modify an Apikey for Openai Provider:

commify --mod-apikey openai sk_...

Without Specifying The Repository Path:

cd /path/to/repo
commify --lang english --emoji True --model llama3.1 --provider ollama

Using in Debug Mode:

commify /path/to/repo --debug --lang english --emoji True --model llama3.1 --provider ollama

Arguments

  • path: Path to the Git repository. (If the repository path is not specified, the path Commify is running from will be used)
  • --lang: Language for the commit message (default: english).
  • --provider: AI provider to use for generating messages (default: ollama). (required)
  • --emoji: Include emojis in the commit message (True or False, default: True).
  • --model: AI model to use for generating messages (default: llama3.1). (required)
  • --help: Display all available parameters and their descriptions.
  • --version: Display the installed Commify version.
  • --debug: Run Commify in Debug Mode. (It is not recommended if you don't know what you are doing.)
  • --apikey: A temporary apikey use for Openai or Groq API key to use (default: sk-).
  • --save-apikey: Save API key for a provider. Ex: --save-apikey openai sk-...
  • --mod-apikey: Modify API key for a provider. Ex: --mod-apikey groq gsk-...

💡 Features in Detail

Commit Message Review

Once a message is generated, you'll be prompted to:

  • Accept the message (y).
  • Reject the message will be generated again (n).
  • Cancel the message (c).

Commify Providers

Commify currently supports only 4 providers:

  • ollama: ollama is an open-source project that serves as a powerful and user-friendly platform for running LLMs on your local machine.
  • gpt4free: gpt4free is an AI-Based Software Package that Reverse-Engineers APIs to Grant Anyone Free Access to Popular and powerful AI Models.
  • openai: openAI is a cutting-edge research organization that works to push the limits of artificial intelligence in a variety of domains.
  • groq: Groq is an extremely fast AI response engine that can write factual and quoted responses in hundreds of words in less than a second.

Feel free to submit a pull request or open an issue to add more providers!

Apikey Saving

Commify allows you to save and modify API keys for certain providers (openai and groq). This can be useful if you frequently use these providers and want to avoid entering the API key each time you run Commify.

Saving an API Key

To save an API key for a provider, use the --save-apikey option followed by the provider name and the API key. For example:

commify --save-apikey openai sk-...

This will save the API key for the openai provider. You can also save an API key for the groq provider:

commify --save-apikey groq gsk-...

The saved API key will be stored in a file located at ~/.commify_env and will be automatically used in future Commify runs.

Modifying an API Key

If you need to update an existing API key, use the --mod-apikey option followed by the provider name and the new API key. For example:

commify --mod-apikey openai sk-...

This will update the saved API key for the openai provider. Similarly, you can update the API key for the groq provider:

commify --mod-apikey groq gsk-...

Using a Temporary API Key

If you prefer not to save the API key, you can provide it directly when running Commify using the --apikey option. For example:

commify /path/to/repo --provider openai --apikey sk-...

This will use the provided API key for the current run without saving it.

Feel free to submit a pull request or open an issue if you have any suggestions or improvements for this feature!


🧩 Testing Information

Confirmed successful runs (with no errors) on the following:

  • OS:

    • Windows 11
    • Windows 10
    • Ubuntu24.04.1 LTS
    • Linux Mint 22
  • Python:

    • Python 3.11.9
    • Python 3.12.3
  • AI Models:

    • llama3.2-vision Ollama
    • llama3.1 Ollama
    • dolphin-llama3 Ollama
    • gpt-4o G4F
    • gpt-4o-mini G4F
    • deepseek-r1 Ollama
    • Phi3.5 Ollama
    • llama-3.3-70b-versatile Groq

Let us know if it runs on your machine too!


💻 Developer Information

Commify is developed and maintained by Matuco19.


📑 License

License-MATCO Open Source V1

This project is open-source and available under the MATCO-Open-Source License. See the LICENSE file for details.


👋 Contributions

Contributions are welcome! Feel free to open an issue or submit a pull request on GitHub.


Start making commits with Commify today! 🎉

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

commify-1.6.tar.gz (10.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

Commify-1.6-py3-none-any.whl (11.5 kB view details)

Uploaded Python 3

File details

Details for the file commify-1.6.tar.gz.

File metadata

  • Download URL: commify-1.6.tar.gz
  • Upload date:
  • Size: 10.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.21

File hashes

Hashes for commify-1.6.tar.gz
Algorithm Hash digest
SHA256 35447459a71d2997cf7f411788aa077f3c715e0738d511784339c3784bc6d41c
MD5 6ed9bbfad688d4d460e4dd4d619defc1
BLAKE2b-256 ef2ed251240aa6f9f69d269f9bc3466a3260cec9d97a2cf9d60417ad5e970aaf

See more details on using hashes here.

File details

Details for the file Commify-1.6-py3-none-any.whl.

File metadata

  • Download URL: Commify-1.6-py3-none-any.whl
  • Upload date:
  • Size: 11.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.21

File hashes

Hashes for Commify-1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 b8cb5c4f008fbbcfd77b8c67b694e2d523006a41843ea8917b8b93e92dd8487c
MD5 37af8c5e2aacd1567878a026c3648dea
BLAKE2b-256 233e59faa1db2ba226ff2d744622b9989587c8293faeab75975f1fdb10f3502b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page