/shai

Command-line assistant powered by AI

Primary LanguageRustApache License 2.0Apache-2.0



shai

 

Version Tests status


Command-line assistant powered by AI.

Shai helps you brainstorm commands and remember strange shell incantations.

$ shai command "File path of the largest file within ~/Documents"
find ~/Documents -type f -printf '%s %p\n' | sort -nr | head -1 | cut -d" " -f2-

$ find ~/Documents -type f -printf '%s %p\n' | sort -nr | head -1 | cut -d" " -f2-
/Users/me/Documents/Zoom/2030-11-12 12.54.55 My Zoom Meeting/video128341984.mp4

Features

  • Translate natural language to a shell one-liner

That's it! See As Compared to X for more featureful alternatives and Roadmap for where shai is heading.

Installation

Installation via Pre-built Binaries

Feel free to grab a pre-built binary on the GitHub Releases page.

Your platform doesn't have a binary for it? Check out installing from source below.

Installation via Source

Installing from source is pretty easy if you have Cargo setup:

$ git clone https://github.com/sullvn/shai.git
$ cargo install --path shai

Setup

Shai currently depends on OpenAI's API to work. You will have to make an OpenAI account and create an API key.

Then pass the API key to shai:

#
# Option A: One-time Configuration
#
$ shai configure --openai-api-key <YOUR API KEY>

#
# Option B: Zero Config via Environment Variable
#
$ OPENAI_API_KEY=<YOUR API KEY> shai "Path of the largest file on the system"

As Compared to X

Shai is pretty early along, so you will probably be better served by one of these:

  • aicmd is a very simple CLI frontend to ChatGPT, just like the current state of shai. It requires Node.js to run. shai is a native binary, so has no requirements.
  • AIChat is a native alternative, also made in Rust, that has multiple modes. Looks great!
  • ShellGPT is also a simple frontend to ChatGPT, but has a bunch of modes and configuration options. Python is required.
  • Chatblade is similar to ShellGPT. It has more of a "graphical" text interface. Python is required.
  • Bot Aquarium lets an LLM loose in a Linux Docker container. Actually very similar to the end goal of shai. The only difference is shai will safely automate tasks on your actual machine.
  • Auto-GPT lets an LLM loose on your actual computer, via high-level interactions and scripts. shai will remain focused on lower-level shell and program automation.
  • privateGPT runs a local LLMs through documents on your machine. You can ask questions of them in natural language.

Roadmap

  1. Integrate cowbox for Just Run It ™️ capabilities
  2. Bundle offline LLMs, like LLaMA
  3. Chat mode with history and refining queries
  4. Shell mode which integrates plain commands with AI queries

You May Also Like

  • cowbox – Safely run programs without your files getting borked
  • pvw – Command-line tool which interactively previews command outputs




👋😅