Chatblade is a versatile command-line interface (CLI) tool designed to interact with OpenAI's ChatGPT. It accepts piped input, arguments, or both, and allows you to save common prompt preambles for quick usage. Additionally, Chatblade provides utility methods to extract JSON or Markdown from ChatGPT responses.
You can do that by either passing --openai-api-key KEY or by setting an env variable OPENAI_API_KEY (recommended). The examples below all assume an env variable is set.
The piped input is placed above the query and sent to ChatGPT. In this example, we also use the -c 4 flag to select ChatGPT-4 (the default is ChatGPT-3.5).
We can also save common prompt configs for easy reuse. Any yaml file we place under ~/.config/chatblade/ will be picked up by the command.