Home

Awesome

Instant shell script solutions from AI right in your prompt.

<p dir="auto" align="center" width="100%"> <img src="https://raw.githubusercontent.com/chr15m/aish/main/screencast.svg" alt="SVG screencast of aish in action" style="max-width: 100%;"> </p>

aish is a single file shell script for getting one-liner solutions from AI right into your terminal where you need them. It asks OpenAI for a one-liner solution to your problem, shows it to you, and inserts it into your history if you confirm. Once it's in your history you can press "up" and then run or edit the one-liner as you like.

Install

curl https://raw.githubusercontent.com/chr15m/aish/main/aish > ~/bin/aish && chmod 755 ~/bin/aish

Then you can simply run aish to get started:

. aish show me which process is running on port 8000

Note: Make sure you set the environment variable OPENAI_API_KEY to your OpenAI API key. You can add the key to ~/.aish if it's not in your environment already.

See the configure section below for details on configuring model (defaults to gpt-3.5-turbo-0301), server URL, etc.

By default aish will detect your current shell and OS and ask the AI for solutions for that combination but this can be configured.

WARNING: Always carefully check the output from the AI for bugs or other issues. Do not run the output unless you completely understand what it is doing. You are fully responsible for any commands you run. This software comes with ABSOLUTELY NO WARRANTY, to the extent permitted by applicable law. Please see LICENSE.txt for more details.

Examples

Prefix these queries with . aish in your terminal to try them out:

Configure

You can create a file ~/.aish that will be sourced by the script. You can use this to override the defaults sent to the AI.

Here are some examples of configuration variables you can set:

# Set or override the OpenAI API key
OPENAI_API_KEY=...your key...
# Override the ChatGPT model to use
AISH_MODEL="gpt-3.5-turbo-0301" # the default model but `gpt-4` is recommended.
# Override the shell the AI will create solutions for
# (default is to autodetect whatever shell you are in)
AISH_SHELL="zsh"
# Override the OS the AI will create solutions for
# (default is to autodetect the OS you are using)
AISH_OS="Mac OSX"
# Use a different OpenAI API compatible server (e.g. locally hosted)
AISH_URL=https://localhost:8000/