Skip to content
Tiago Temporin edited this page Jun 10, 2024 · 1 revision

Welcome to the cli-bud wiki!

After install, the first thing to do is to set the OpenAI token using the command cb set-token YOU_TOKEN. This command will save the API Key on your machine.

To get a token, go to the API keys page and generate a new API key.


Global flags

There are only 3 global flags.

  1. -model: used to set the AI model (default is "gpt-3.5-turbo").
  2. -token: used to set the token to be used for the request. (if you have used set-token this flag will never be needed).
  3. -debug: in some cases, show more information about the request.

Commands

Create

Create a file with the response from ChatGPT.

  • cb create test -path [FILE|DIR]: Reads a file or each file from the directory, sends to the AI asking to write a unit test. After get a response, write a new file with the same name plus the suffix _test. If the flag -output wasn't set on the command, the file will be written in the same directory as the original.

  • cb create file -content "write a poem about cpu and memory" -output ~/cpu_mem.txt: This command will send the content of the flag -content to the AI and then write a file set on -output with the content of the response.

Do

Do something with a file.

  • cb do code-review -path ./category/utils.go: Reads the utils.go file and send to the AI asking for a code review. The response will be printed on your terminal.

Message

Send a single message to AI.

  • cb message can you sing?: Sends all words after "message" to the AI. The response will be printed on your terminal.

Chat

Starts a new chat with ChatGPT.

  • cb chat: Starts a new multi-turn chat with ChatGPT. To exit the chat, press ctrl + c.
Clone this wiki locally