14 releases

0.3.7 Dec 6, 2023
0.3.6 Nov 4, 2023
0.3.4 Sep 8, 2023
0.3.3 Aug 26, 2023
0.1.3 Mar 25, 2023

#1359 in Command line utilities

Download history 220/week @ 2024-02-18 17/week @ 2024-02-25 1/week @ 2024-03-03 23/week @ 2024-03-10 4/week @ 2024-03-17 1/week @ 2024-03-24 89/week @ 2024-03-31

117 downloads per month

MIT license

22KB
423 lines

openai-cli

Crates.io

openai-cli is a command line interface to interact with the OpenAI API. It aims to provide most features the API does.

Chat mode

demo

Chat mode commands

  • !system: Write a system message, e.g., "You will translate text to french".
  • !save: Save a conversation.
  • !load: Load a converstation.
  • !history: Show the converstation history.
  • !model: Set the model you want to use, e.g., !model gpt-3.5-turbo.
  • !clear: Clear the current conversation history.
  • !undo: Undo last message.

I also intend to add support for completing promts from stdin or files for use in scripting.

Keybinds

By defeault openai-cli uses emacs style keybinds.

However by using the --vim flag, you can use vim style keybinds instead.

You can write newlines using ALT+ENTER.

Edit Mode

You can edit files using the edit subcommand. edit demo

Installation

Installation can be done via cargo install openai-cli.

Dependencies

~13–29MB
~458K SLoC