https://github.com/ddddddeon/a
CLI tool to generate code from GPT3
https://github.com/ddddddeon/a
Last synced: 14 days ago
JSON representation
CLI tool to generate code from GPT3
- Host: GitHub
- URL: https://github.com/ddddddeon/a
- Owner: ddddddeon
- License: mit
- Created: 2023-02-28T00:47:17.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2025-01-07T02:09:09.000Z (4 months ago)
- Last Synced: 2025-03-07T20:47:00.576Z (about 2 months ago)
- Language: Rust
- Size: 76.2 KB
- Stars: 239
- Watchers: 2
- Forks: 10
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-ChatGPT-repositories - a - CLI tool to generate code from GPT3 (CLIs)
README
# a
CLI tool to generate code from ChatGPT that pretty-prints the output by language

## Installation
```
cargo install a-gpt# or to enable clipboard functionality:
# cargo install a-gpt --features clipboardexport OPENAI_API_KEY=sk-WEz... # from https://platform.openai.com/account/api-keys
```For local development:
```
make release
sudo make install
```If the `clipboard` feature is enabled and you are running Ubuntu/Debian, you may need to install the following packages:
```
sudo apt install xorg-dev libxcb-composite0-dev xclip
```## Usage
You will need an OpenAI API key, and to set the environment variable `OPENAI_API_KEY`.Invoke the `a` command followed by a prompt. If the first word in the prompt is a programming language or file-format the pretty-printer recognizes, it will syntax highlight the output.
```bash
a python script that fetches a url
a rust program that showcases its various features
a yaml manifest describing a kubernetes deployment
```Invoking the command with no arguments will read from stdin, accepting input interactively or from a pipe. You can choose to include or not include the word "a" at the beginning your input string.
```bash
echo "python script that fetches a url" | a
echo "a python script that fetches a url" | a
```If installed with the `clipboard` feature enabled, the output will be copied to the clipboard.