https://github.com/henomis/ai-shell-go
Ai shell helper written in go
https://github.com/henomis/ai-shell-go
ai chatgpt go openai shell
Last synced: about 2 months ago
JSON representation
Ai shell helper written in go
- Host: GitHub
- URL: https://github.com/henomis/ai-shell-go
- Owner: henomis
- License: mit
- Created: 2023-04-07T07:45:53.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-04-07T15:40:31.000Z (about 3 years ago)
- Last Synced: 2025-06-22T18:05:28.184Z (about 1 year ago)
- Topics: ai, chatgpt, go, openai, shell
- Language: Go
- Homepage: https://simonevellei.com
- Size: 192 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 🤖 ai-shell-go
[](https://github.com/henomis/ai-shell-go/actions/workflows/release.yml) [](https://godoc.org/github.com/henomis/ai-shell-go) [](https://goreportcard.com/report/github.com/henomis/ai-shell-go) [](https://github.com/henomis/ai-shell-go/releases)
This is a simple AI shell helper written in GO. It uses OpenAI API to generate a plausible shell command from a given prompt.
As soon as the command is generated, the user can choose to execute it or revise it adding more context.

## Installation
Be sure to have a working Go environment, then run the following command:
```
$ go install github.com/henomis/ai-shell-go@latest
```
### From source code
Clone the repository and build the binary:
```
$ make
```
### Pre-built binaries
Pre-built binaries are available for Linux and macOS on the [releases page](https://github.com/henomis/ai-shell-go/releases/latest).
## Usage
⚠️ ai-go-shell requires an OpenAI API key as `OPENAI_API_KEY` environment variable.
```
$ ai-shell-go print first 3 lines of each file in a directory
```
### Output
```
🤖 Here is your command line:
$ head -n 3 *
--
This command uses the `head` utility to print the first 3 lines of each file in the current directory (`*` is a wildcard that matches all files in the directory). The `-n 3` flag specifies that it should print only the first 3 lines.
[E]xecute, [R]evise, [Q]uit? >
```