gptsh

command module
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2023 License: MIT Imports: 10 Imported by: 0

README

gptsh

Gpt3/4 on your CLI. Takes stdin + cli args and prints to stdout. Does not (yet) have any network or file system access.

Some silly saturday morning gpt shell stuff. Written by GPT4 + github copilot. Uses GPT3.5-turbo by default. The results are pretty bad with gpt3.x, so I definitely recommend using gpt4.

Unfortunately I don't have a gpt4 API key (the waitlist seems long), but I've verified using chatgpt with GPT that gpt4 produces much better results.

Usage

Given a directory with 2 files (file1.txt and file2.bin):

ll . | gptsh "reverse line order" | gptsh "output as prettified json with some useful field names"

produces:

[
  {
    "permissions": "-rw-r--r--",
    "owner": "johan",
    "group": "johan",
    "size": "0",
    "date": "Apr 29 14:45",
    "name": "file2.bin"
  },
  {
    "permissions": "-rw-r--r--",
    "owner": "johan",
    "group": "johan",
    "size": "0",
    "date": "Apr 29 14:45",
    "name": "file1.txt"
  }
]

Installation

go install github.com/gigurra/gptsh@<check-latest-git-tag>

Environment variables

  • OPENAI_APIKEY - Required. Your OpenAI API key.
  • GPT_VERSION - Optional. The GPT model to use. Defaults to "3". Optionally you can set it to "4".

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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