Skip to content

A command line utility that generates your commands

License

Notifications You must be signed in to change notification settings

TastefulElk/clai

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CLAI

CLAI is a command line utility that'll generate, and optionally, execute CLI commands for you based on your input.

Installation

go install github.com/tastefulelk/clai

Requirements

You need an OpenAI API key, which can be obtained for free by following the instructions here.

Usage

First, you need to set your OpenAI API key as an environment variable:

export CLAI_OPENAI_KEY=your-key

Then run clai:

$ clai "Find all rows in log.txt that contains the words 'error' or 'warn'"
Here's the suggested command(s) to run:
grep -Ei 'error|warn' log.txt
Do you want to run it directly? y/N

Use it, for example, to help you with searching, modifying files, or getting out of a git mess.

usage

Options

  • -m|--model: Specify the model to use. (Default gpt-4o)
  • -h|--help: Show help message.
  • -v|--verbose: Show verbose output.
  • -t|--api-token: Specify OpenAI API token. This will take priority over the CLAI_OPENAI_KEY environment variable.
  • --version: Show clai version

Disclaimer

The user is solely responsible for reviewing and executing the generated commands. Please carefully review each command before running it, especially commands that modify system settings, files, or data. The creators of this tool are not liable for any damage or unintended consequences resulting from the execution of these commands.

Disclaimer 2

I've never written a single of go before, don't judge me 🙈

About

A command line utility that generates your commands

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages