catgpt

command module
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 1, 2024 License: Apache-2.0 Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

catgpt

Because I'm lazy and this helps me be lazier.

This is a command-line tool that uses the OpenAI model to generate text based on user input.

Installation

To install catgpt, you can run the following command:

go install github.com/ibuildthecloud/catgpt@main

Usage

echo [MESSAGE] | catgpt [prompt]

Options:

  • api-key: OpenAI API Key (default: environment variable OPENAI_API_KEY)
  • base-url: OpenAI Base URL (default: https://api.openai.com/v1)
  • model: The OpenAI model to use (default: gpt-3.5-turbo)

Example

To use catgpt to generate text, you can pipe input from a file or from stdin. Here's an example:

echo "What is the meaning of life?" | catgpt

This will generate a response from the GPT-3.5 Turbo model based on the prompt "What is the meaning of life?".

A more complex example would be how this README was orignally generated

find -name "*.go" -print -exec cat {} \; | catgpt "Create a readme for this github project that has this go file content" > README.md

Or how I created the first commit message

git diff --staged | catgpt -m gpt-4 "Generate a git commit message"

License

This project is licensed under the Apache License 2.0.

Contributing

Contributions are welcome! If you would like to contribute to this project, please open an issue or submit a pull request.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址