GithubHelp home page GithubHelp logo

lguzzon-scratchbook / aish Goto Github PK

View Code? Open in Web Editor NEW

This project forked from chr15m/aish

0.0 0.0 0.0 164 KB

Shell script one-liners right in your terminal prompt

License: MIT License

Shell 100.00%

aish's Introduction

Instant shell script solutions from AI right in your prompt.

SVG screencast of aish in action

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

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.

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:

  • which process is running on port 8000
  • numeric for loop boilerplate going from 5 to 15
  • restart openssh
  • start a simple webserver using python3
  • rename every file in ./images from .jpg to .png
  • resize all of images in ./images to a maximum of 100 pixels in any dimension
  • create a small webserver with netcat
  • get the ips that amazon.com resolves to and ping each one
  • list all network interfaces and their ip addresses
  • print out the source of function __git_ps1
  • delete all unused docker images
  • concatenate two .mkv video files
  • use ffmpeg to shrink an mp4 file's size
  • use imagemagick change the white background in screenshot.png to transparent

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 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"
# Override the ChatGPT model to use
AISH_MODEL="gpt-3.5-turbo-0301"

aish's People

Contributors

chr15m avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.