RomanHotsiy / commitgpt

Automatically generate commit messages using ChatGPT
1.57k stars 92 forks source link

Doesn't work after new OpenAI Cloudflare protections #22

Closed Galz648 closed 1 year ago

Galz648 commented 1 year ago

Description

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

Expected Behavior

expected the access token to be accepted

Actual Behavior

I get a "invalid token" message.

Environment

Darwin 21.6.0

gaui commented 1 year ago

Same here. I get:

Invalid token. Please try again.

RomanHotsiy commented 1 year ago

More details here https://github.com/transitive-bullshit/chatgpt-api#update-december-12-2022 and here https://github.com/transitive-bullshit/chatgpt-api/issues/96

sapirgolan commented 1 year ago

Duplicate of #21

RomanHotsiy commented 1 year ago

I closed #21 because this one is linked from the readme.

davidlj95 commented 1 year ago

I managed to workaround the issue by using chatgpt lib. It opens a browser window so you can authenticate as usual. And then proceeds to send the diff to get the commit message suggestions. It's a poor man's workaround, as you have to login every time you run the command with the browser. Buut, it's something

Check it out here: https://github.com/davidlj95/commitgpt/tree/use-chatgpt-lib-with-puppeteer-to-bypass-cloudflare-restrictions

A win is there though: no need to copy / paste from the DevTools, as chatgpt lib grabs that info automagically. We just need to enter our email and pwd. So the process can be automated a bit more and we don't have to fill that in the browser each time.

RomanHotsiy commented 1 year ago

Thanks for suggestion @davidlj95.

I believe it won't work anymore but I have plan to look into what can be done on the weekend.

friuns2 commented 1 year ago

https://github.com/transitive-bullshit/chatgpt-api

Update February 1, 2023 This package no longer requires any browser hacks – it is now using the official OpenAI completions API with a leaked model that ChatGPT uses under the hood. 🔥

amatzen commented 1 year ago

New paid ChatGPT API released by @openai. Maybe switch to that instead of any "hacks" or unofficial sources.

farhadsoft commented 1 year ago

image Something is wrong: Invalid token. Please try again.

michael-sumner commented 1 year ago

I am also experiencing the same issue Invalid token. Please try again.. Has anyone fixed their issue?

JeanRessouche commented 1 year ago

Same (with GPT paid account) :(

hadees commented 1 year ago

can't it just us the official api now?

lucaszdev commented 1 year ago

@RomanHotsiy Fix this please

Screenshot 2023-04-11 at 16 15 12
RomanHotsiy commented 1 year ago

Fixed in 2.0.0 by https://github.com/RomanHotsiy/commitgpt/pull/27