Coder Social home page Coder Social logo

tak-bro / aicommit2 Goto Github PK

View Code? Open in Web Editor NEW
85.0 3.0 3.0 30.44 MB

A Reactive CLI that generates git commit messages with Ollama, ChatGPT, Gemini, Claude, Mistral and other AI

Home Page: https://www.npmjs.com/package/aicommit2

License: MIT License

TypeScript 100.00%
aicommit commit huggingface openai anthropic chatgpt claude gemini cli command-line

aicommit2's People

Contributors

bhodrolok avatar eltociear avatar semantic-release-bot avatar tak-bro avatar ubranch avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

aicommit2's Issues

Support for Codestral

Feature request

Thanks for making this tool! Been enjoying tinkering around with it.

I think aicommit2 can be further extended to support Mistral AI's new coding-focused genAI model, Codestral.

Why?

Codestral is a 22 billion parameter model, which was released end of last month by Mistral AI, which is optimized for assisting developers.
Cool thing about this model is that the API, available at codestral.mistral.ai, is free to use/consume until August 1.
Additionally it will give the user another option in terms of choosing a different model for selecting the generated commit message.

Alternatives

I tried to implement the feature myself and managed to get it working, albeit in a hacky way.
Here is the repo with my changes: https://github.com/bhodrolok/aicommit2-codestral

The main thing I noticed is that the API key for using Codestral is different from the one used for Mistral AI's other models.
Also there is no endpoint for listing all available Mistral AI models for the main Codestral domain (codestral.mistral.ai) and as such the regular Mistral AI domain (api.mistral.ai) has to be used (alongside the regular API key MISTRAL_KEY).

I have been trying to refactor it such that it works in a single MistralService class but keep running into the Invalid AI type error.

I can open a PR so you can take a look at it!

Additional context

  • Link to Codestral docs: https://docs.mistral.ai/capabilities/code_generation/
  • A Codestral API key can be obtained from here
  • Currently only one Codestral model is available: codestral-2405 (which codestral-latest points to).
  • The API has a rate limit of 30 requests per minute and a daily limit of 2000 requests.

"No commit messages were generated"

Bug description

I'm using the local model (ollama with codellama) to generate a commit. It works sometimes and fails sometimes with the warning information: "⚠ No commit messages were generated."
截屏2024-05-19 11 33 49

And if I enable OLLAMA_STREAM, after streaming for a while, a new error message is displayed: Failed to extract messages from response.
截屏2024-05-19 11 35 32

aicommit2 version

1.8.6

Environment

System:
    OS: macOS 14.4.1
    CPU: (10) arm64 Apple M2 Pro
    Memory: 252.88 MB / 32.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 21.5.0 - ~/.asdf/installs/nodejs/21.5.0/bin/node
    npm: 10.2.4 - ~/.asdf/plugins/nodejs/shims/npm
    pnpm: 9.0.4 - ~/.asdf/shims/pnpm

Can you contribute a fix?

  • I’m interested in opening a pull request for this issue.

OpenAI path

Feature request

I appreciate the effort of extending the aicommit base repository. However, I do have a question.

If I need to not only replace the base URL, but also change the path as well. Like for example - https://hello.com/cats/v1/conversation.. Would it work if I would change OPENAI_URL to hello.com/cats/ ?

I hope I made myself clear.

Why?

Nothing here

Alternatives

Additional context

No response

Error when running `aicommit2 config set GEMINI_KEY=<your key>`

Bug description

When attempting to set the GEMINI_KEY using the command aicommit2 config set GEMINI_KEY=, an error is encountered.

Steps to Reproduce:

  1. Open terminal/command prompt.
  2. Run the command: aicommit2 config set GEMINI_KEY=<your key>.

Error Message:

(node:14544) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead. (Use `node --trace-deprecation ...` to show where the warning was created)

aicommit2 version

v1.9.8

Environment

System:
    OS: android
    CPU: Unknown
    Memory: 2.31 GB / 7.43 GB
  Binaries:
    Node: 22.2.0 - /data/data/com.termux/files/usr/bin/node
    npm: 10.7.0 - /data/data/com.termux/files/usr/bin/npm

Can you contribute a fix?

  • I’m interested in opening a pull request for this issue.

Multiline response parsing

Feature request

I think it would be helpful to handle newline output from the response.

Why?

To get clearer more robust message structure.

Alternatives

No response

Additional context

I love the work done on this library by the way! good work. Currently my response for the commit message is a single line.

Notes:

  • using -c to copy to clipboard
  • using openai gpt-4o
  • using custom prompt: "Prepend fix: to the first line in lowercase. Avoid overly verbose descriptions or unnecessary details. Start with a short sentence in imperative form, no more than 50 characters long. Then leave an empty line and continue with a more detailed explanation. Write only one sentence for the first part, and two to five sentences at most for the detailed explanation. Use bullet points for multiple changes when possible."

My prompt should generate something like

fix: update Node.js version to 20.15.0 in Dockerfile

- Updated Node.js version from 20.13.1 to 20.15.0 in the Dockerfile.
- Ensures consistency and compatibility with the specified Node.js version

images

Feature request

  • how to get huggingface cookie
how-to-get-cookie
  • how to get clovax cookie
cookie-clovax
  • demo
    demo2

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.