Coder Social home page Coder Social logo

commitgpt's People

Contributors

adamaltman avatar erfanium avatar ipanasenko avatar kkfuri avatar romanhotsiy avatar shrx 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

commitgpt's Issues

No "imperative" commit message mode

Really by default, commit messages should appear in the imperative: instead of "Added logging", the subject should read "Add logging". See:

https://www.freecodecamp.org/news/how-to-write-better-git-commit-messages/
https://cbea.ms/git-commit/
https://reflectoring.io/meaningful-commit-messages/
https://www.gitkraken.com/learn/git/best-practices/git-commit-message

And many similar. The -c flag seems to already do that (unless it happened randomly during my tests), but many (most ?) people use simple, capitalized imperative subjects outside of conventional commits - basically, like the existing default, but with the imperative mood.

Could be a new mode, a flag, or simply a change to the default behaviour.

Otherwise: wow, this is so neat! Thank you!

error: pathspec on windows git bash

I'm using that tool on Win git bash.
Got this error:
√ Pick a message · Update route to use IP
error: pathspec 'route' did not match any file(s) known to git
error: pathspec 'to' did not match any file(s) known to git
error: pathspec 'use' did not match any file(s) known to git
error: pathspec 'IP'' did not match any file(s) known to git
Aborted.
Error: Command failed: git commit -m 'Update route to use IP'
at checkExecSyncError (node:child_process:841:11)
at execSync (node:child_process:912:15)
at file:///XXXXXXXXXXXXXXXX/commitgpt/dist/index.js:122:25
at step (file://XXXXXXXXXXXXXX/commitgpt/dist/index.js:33:23)
at Object.next (file:///xxxxxxxxxxxxxxxxxxxx/commitgpt/dist/index.js:14:53)
at fulfilled (file:///XXXXXXXXXXXXXXXXXXXX/commitgpt/dist/index.js:5:58)
at processTicksAndRejections (node:internal/process/task_queues:96:5) {
status: 1,
signal: null,
output: [ null, null, null ],
pid: 12552,
stdout: null,
stderr: null
}

Update README

Just a couple of suggestions to fix in the README.md.

  1. In config.ts , the config file that is being looked at is ~/{HOME_DIR}/.commit-gpt.json. There isn't any mention of a config.json mentioned in the code base like it says in the README
  2. The key that it's looking for is sessionKey not the snake case version session_key
  3. Huge nitpick so ignore but your code runs git diff --cached which I just learned is no different than git diff --staged. However, maybe consider updating so it matches?

All nitpicks as I was having trouble getting this working without digging into the code to figure out what was expected.

For point 1 and 2, I know that if the config file doesn't exist, the it'll prompt to paste in the session key. This may be a separate issue but my terminals hung when trying to paste it in. I didn't want to create a separate issue yet until I confirmed it's not an issue I'm only experiencing.

Allow custom commit prefix

Something that many companies use to track commits related to a Jira ticket would also be helpful. For example, our commit messages looks like this,

APT-1234: Commit message

Here is APT-1234 is the ticket number.

Thanks in advance,
Jinesh

issue: the example in the README is wrong

Hi,

In the example in the readme you have :

suggest 10 commit messages based on the following diff:
{{diff}}
commit messages should:
 - follow conventional commits
 - message format should be: <type>[scope]: <description>

examples:
 - fix(authentication): add password regex pattern
 - feat(storage): add new test cases

The format should be <type>(scope): <description> with parentheses instead of brackets.

🐛 New generated __Secure-next-auth.session-token are not accepted

I've tried running the app for the first time now,
I copied the value of __Secure-next-auth.session-token and pasted into the terminal and I get an error message:

Invalid token. Please try again.

I think it happens since OpenAI has added cloudflare to protect their services
Using version 1.0.5

Feature Request: Interactive mode

You may want to add a bit of intent to the commit message that comes out.
How about adding an interactive mode to accomplish this?

error: commit message has single quote

I'm using this tool in WSL2.

Got the some error:

✔ Pick a message · feat: implement dijkstra's algorithm
/bin/sh: 1: Syntax error: Unterminated quoted string
Aborted.
Error: Command failed: git commit -m 'feat: implement dijkstra\'s algorithm'
    at checkExecSyncError (node:child_process:828:11)
    at execSync (node:child_process:899:15)
    at file:///home/jimmyhealer/.npm/_npx/de3899c053a47706/node_modules/commitgpt/dist/index.js:122:25
    at step (file:///home/jimmyhealer/.npm/_npx/de3899c053a47706/node_modules/commitgpt/dist/index.js:33:23)
    at Object.next (file:///home/jimmyhealer/.npm/_npx/de3899c053a47706/node_modules/commitgpt/dist/index.js:14:53)
    at fulfilled (file:///home/jimmyhealer/.npm/_npx/de3899c053a47706/node_modules/commitgpt/dist/index.js:5:58)
    at processTicksAndRejections (node:internal/process/task_queues:96:5) {
  status: 2,
  signal: null,
  output: [ null, null, null ],
  pid: 2295,
  stdout: null,
  stderr: null
}
Error: Command failed: git commit -m 'feat: implement dijkstra\'s algorithm'

This command fails because the backslash does not successfully escape the character.

Invalid token. Please try again.

Every time I try. I follow the instructions to the letter, no idea why it isn't working. Anything I can do to help debug, please let me know.

Error: 429 too many requests

Hello, i'm trying to run npx commitgpt on my branch to test it with a valid token and I seem to be getting a 429 error and no real idea as to why, the diff is not large at all.

image

Token is lost on new launch of PyCharm instance - "OpenAI token is not set"

I can use the plugin just fine, but after restarting my PyCharm, the plugin would lose my OpenAI token in the settings. I can adjust other settings just fine and they will stay saved, but the OpenAI token has to be entered on every new launch of PyCharm. Have tried reinstalling the plugin and it's the same issue.

Failed to fetch - Unauthorized

yesterday Im using commitgpt and success get the recommendations commit, but today i can't get recommendation because the error:

> npx commitgpt -c
Error: Failed to fetch - Unauthorized

Error: Forbidden

This error comes right after executing commitgpt even when my token doesn't wrong. No further logs appear.

ss3

Doesn't work after new OpenAI Cloudflare protections

Description

Using this cli tool for the first time, posting the session token doesn't work.

  • I believe there should be a feature to set it as a local variable as it is easier to debug.

Steps to Reproduce

  • use the tool for the first time (maybe try to delete the existing token if you already used it)
  • copy the token from the browser
  • paste it into the terminal window

Expected Behavior

expected the access token to be accepted

Actual Behavior

I get a "invalid token" message.

Environment

Darwin 21.6.0

Unclear readme.md

Hi,

I've copied the content of the readme.md in chat GPT 4 asking him:

Can you understand where I should write this command? npx commitgpt

:D

Here its answer (I guess he is right but it would be great if you could clarify those instructions inside the readme. Most of people, and even dev, have no idea what npx is for example):

You should write the command npx commitgpt in your terminal or command prompt. Here's how you can do it:

Open a terminal (on macOS or Linux) or command prompt (on Windows).
Navigate to the directory where your Git repository is located. You can use the cd command followed by the directory path. For example:

cd path/to/your/git/repo

Run the npx commitgpt command:

npx commitgpt

This command will execute the commitgpt tool, which will automatically generate commit messages for your staged changes using

ChatGPT.

Note that you need to have Node.js and npm installed on your system to use the npx command.

A way to force new session token propmpt

Sometimes something is wrong with the session token in a way that it's able to get the access token but requests are blocked.

Would be convenient to have ability to re-login: #15

Hopefully this is not needed when OpenAI adds official support.

Unable to authenticate - the request is blocked

Pasting the auth token into commitgpt returns the message: "Invalid token. Please try again."

I did an equivalent curl request and the response is:

curl -H "__Secure-next-auth.session-token=$TOKEN" "https://chat.openai.com/api/auth/session"
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'><html xmlns='http://www.w3.org/1999/xhtml'><head><meta content='text/html; charset=utf-8' http-equiv='content-type'/><style type='text/css'>body { font-family:Arial; margin-left:40px; }img  { border:0 none; }#content { margin-left: auto; margin-right: auto }#message h2 { font-size: 20px; font-weight: normal; color: #000000; margin: 34px 0px 0px 0px }#message p  { font-size: 13px; color: #000000; margin: 7px 0px 0px 0px }#errorref { font-size: 11px; color: #737373; margin-top: 41px }</style><title>Microsoft</title></head><body><div id='content'><div id='message'><h2>The request is blocked.</h2></div><div id='errorref'><span>0YvqOYwAAAAAiMEPW7daTQ7ok4jSan+1sRlJBMzFFREdFMDkxNwBlNjZiOGIwMy0wNzkzLTQ0MDktOTc3My0yZTYxMmU3MWExZTM=</span></div></div></body></html>%  

Pathspec issue on windows

Does the Commit message need to include the filenames included in the commit?

I have ran commitgpt a few times for this commit and none of the suggestions include the filename.
But it looks as if the filename is required in the commit message.

√ Pick a message · Update password reset duration to 60 minutes
error: pathspec 'password' did not match any file(s) known to git
error: pathspec 'reset' did not match any file(s) known to git
error: pathspec 'duration' did not match any file(s) known to git
error: pathspec 'to' did not match any file(s) known to git
error: pathspec '60' did not match any file(s) known to git
error: pathspec 'minutes'' did not match any file(s) known to git
Aborted.
Error: Command failed: git commit -m 'Update password reset duration to 60 minutes'
    at checkExecSyncError (node:child_process:871:11)
    at execSync (node:child_process:943:15)
    at file:///C:/Users/xxxxxx/AppData/Local/npm-cache/_npx/de3899c053a47706/node_modules/commitgpt/dist/index.js:122:25
    at step (file:///C:/Users/xxxxxx/AppData/Local/npm-cache/_npx/de3899c053a47706/node_modules/commitgpt/dist/index.js:33:23)
    at Object.next (file:///C:/Users/xxxxxx/AppData/Local/npm-cache/_npx/de3899c053a47706/node_modules/commitgpt/dist/index.js:14:53)
    at fulfilled (file:///C:/Users/xxxxxx/AppData/Local/npm-cache/_npx/de3899c053a47706/node_modules/commitgpt/dist/index.js:5:58)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  status: 1,
  signal: null,
  output: [ null, null, null ],
  pid: 22868,
  stdout: null,
  stderr: null
}

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.