Skip to main content
Topic: How correctly use terminal chatgpt (Read 533 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

How correctly use terminal chatgpt

How correctly use terminal chatgpt after got the key, as nooby using it first time ?

Code: [Select]
$ chatgpt
Welcome to chatgpt. You can quit with 'exit' or 'q'.

Enter a prompt:
tesla
Your request to Open AI API failed: invalid_request_error
You didn't provide an API key. You need to provide your API key in an Authorization header using Bearer auth (i.e. Authorization: Bearer YOUR_KEY), or as the password field (with blank username) if you're accessing the API from your browser and are prompted for a username and password. You can obtain an API key from https://platform.openai.com/account/api-keys

nor work put it with key, thanks before

 

Re: How correctly use terminal chatgpt

Reply #1
There must be a configuration file somewhere where you need to paste in your key.

Not knowing how you installed or where you got it, it's hard to track that information down,  but if you installed from the aur using yay or something you could do something like this:

sudo pacman -Ql <package_name>

This will list all the files included by the package, and in that list you may find a configuration file.

Alternatively if the package has a man file you could consult that with:

man <package_name>
or more likely:
man <executable>

Then if that doesn't work try:
chatgpt --help
or
chatgpt -h

To see if there is some help information built into the executable.

Edit:

A quick google (duckduckgo) found this:
https://linux.how2shout.com/shellgpt-install-and-use-chatgpt-in-ubuntu-linux-terminal/

But this is for a package called "ShellGPT" which might not be what you have, but it states the configuration file is here:
~/.config/shell_gpt/.sgptrc

And that the first line in the file is this:
OPENAI_API_KEY=your-API-key

... so I'd say look in your ~/.config folder for something pertaining to chatgpt and go from there.