OpenCommit

Category :
OpenCommit logo

Author

Auto-generate meaningful commits in a second

Killing lame commits with AI

Current version

Winner of GitHub 2023 hackathon

OpenCommit example

All the commits in this repo are authored by OpenCommit — look at the commits to see how OpenCommit works. Emojis and long commit descriptions are configurable, basically everything is.

How to Setup OpenCommit as a CLI Tool

You can use OpenCommit by simply running it via the CLI like this:

In 2 seconds, your staged changes are committed with a meaningful message. Here’s how to get started:

  • Step 1: Install OpenCommit globally to use in any repository:
  • npm install -g opencommit
  • Step 2: Get your API key from OpenAI or other supported LLM providers (we support them all). Make sure that you add your OpenAI payment details to your account, so the API works.
  • Step 3: Set the key to OpenCommit config:
  • oco config set OCO_API_KEY=your_api_key

Your API key is stored locally in the ~/.opencommit config file.

Using OpenCommit

Generating Commit Messages

You can call OpenCommit with the oco command to generate a commit message for your staged changes:

git add files...
oco

Running git add is optional because oco will do it for you.

Running Locally with Ollama

You can also run it with a local model through Ollama:

  1. Install and start Ollama.
  2. Run ollama run mistral (do this only once to pull the model).
  3. Run in your project directory:
  4. git add files...
    oco config set OCO_AI_PROVIDER=ollama OCO_MODEL=llama3:8b

Default model is mistral. If you have Ollama set up in docker on another machine with GPUs (not locally), you can change the default endpoint URL using:

oco config set OCO_API_URL=http://192.168.1.10:11434/api/chat

Where 192.168.1.10 is an example endpoint URL where you have Ollama set up.

Troubleshooting OpenCommit

If you encounter issues, consider the following troubleshooting steps:

  • Ensure that your API key is configured correctly and appears in the correct config file.
  • Check your network connection, as OpenCommit relies on external APIs.
  • Verify that you have installed all prerequisites, such as Node.js and npm.
  • Review logs for any error messages that can point toward the underlying issue.

For more insights, updates, or to collaborate on AI development projects, stay connected with fxis.ai.

Conclusion

At fxis.ai, we believe that such advancements are crucial for the future of AI, as they enable more comprehensive and effective solutions. Our team is continually exploring new methodologies to push the envelope in artificial intelligence, ensuring that our clients benefit from the latest technological innovations.

Stay Informed with the Newest F(x) Insights and Blogs

Tech News and Blog Highlights, Straight to Your Inbox

Latest Insights

© 2024 All Rights Reserved

×