• Stars
    star
    993
  • Rank 46,124 (Top 1.0 %)
  • Language
    Python
  • License
    MIT License
  • Created over 1 year ago
  • Updated 7 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

LangChain powered shell command generator and runner CLI

Shell-AI: Your Intelligent Command-Line Companion

PyPI version License: MIT Forks Stars

Shell-AI (shai) is a CLI utility that brings the power of natural language understanding to your command line. Simply input what you want to do in natural language, and shai will suggest single-line commands that achieve your intent. Under the hood, Shell-AI leverages the LangChain for LLM use and builds on the excellent InquirerPy for the interactive CLI.

demo-shell-ai

Installation

You can install Shell-AI directly from PyPI using pip:

pip install shell-ai

After installation, you can invoke the utility using the shai command.

Usage

To use Shell-AI, open your terminal and type:

shai run terraform dry run thingy

Shell-AI will then suggest 3 commands to fulfill your request:

  • terraform plan
  • terraform plan -input=false
  • terraform plan

Features

  • Natural Language Input: Describe what you want to do in plain English (or other supported languages).
  • Command Suggestions: Get single-line command suggestions that accomplish what you asked for.
  • Cross-Platform: Works on Linux, macOS, and Windows.
  • Azure Compatibility: Shell-AI now supports Azure OpenAI deployments.

Configuration

Environment Variables

  1. OPENAI_API_KEY: Required. Set this environment variable to your OpenAI API key. You can find it on your OpenAI Dashboard.

Optional Variables

  1. OPENAI_MODEL: Defaults to gpt-3.5-turbo. You can set it to another OpenAI model if desired.
  2. SHAI_SUGGESTION_COUNT: Defaults to 3. You can set it to specify the number of suggestions to generate.
  3. OPENAI_API_BASE: Defaults to https://api.openai.com/v1. You can set it to specify the proxy or service emulator.
  4. OPENAI_ORGANIZATION: OpenAI Organization ID
  5. OPENAI_PROXY: OpenAI proxy
  6. OPENAI_API_TYPE: Set to "azure" if you are using Azure deployments.
  7. AZURE_DEPLOYMENT_NAME: Your Azure deployment name (required if using Azure).
  8. AZURE_API_BASE: Your Azure API base (required if using Azure).

Configuration File

Alternatively, you can store these variables in a JSON configuration file:

  • For Linux/macOS: Create a file called config.json under ~/.config/shell-ai/ and secure it with chmod 600 ~/.config/shell-ai/config.json.
  • For Windows: Create a file called config.json under %APPDATA%\shell-ai\

Example config.json:

{
  "OPENAI_API_KEY": "your_openai_api_key_here",
  "OPENAI_MODEL": "gpt-3.5-turbo",
  "SHAI_SUGGESTION_COUNT": "3"
}

The application will read from this file if it exists, overriding any existing environment variables.

Run the application after setting these configurations.

Contributing

This implementation can be made much smarter! Contribute your ideas as Pull Requests and make AI Shell better for everyone.

Contributions are welcome! Please read the CONTRIBUTING.md for guidelines.

License

Shell-AI is licensed under the MIT License. See LICENSE for details.

More Repositories

1

gridstudio

Grid studio is a web-based application for data science with full integration of open source data science frameworks and languages.
JavaScript
8,875
star
2

gpt-code-ui

An open source implementation of OpenAI's ChatGPT Code interpreter
Python
3,539
star
3

x-ai-content-filter-groq

Filter X content using LLM API requests, configurable, based on Groq API
JavaScript
120
star
4

slack-ipython

A Python Jupyter Kernel in Slack. Just send Python code as a message.
Python
59
star
5

buildanything

Generate any HTML page/app and see it stream in real-time.
HTML
25
star
6

6PP-database-nederland

Repository met 6PP data van Nederland.
14
star
7

orchest-weaviate-tweakers-search

Jupyter Notebook
11
star
8

genetic-reinforcement-algorithms-in-js

This repository contains my experimental sandbox for Genetic Algorithms in JavaScript for reinforcement learning environments.
JavaScript
11
star
9

all-data-tools

All Data Tools
Python
10
star
10

twitter-sentiment-flask-python

HTML
8
star
11

malloy-node-red-flows

Malloy on DuckDB for ETL flows in Node-RED
Shell
7
star
12

orchest-dbt

This repo demonstrates how to combine dbt with Orchest using their `jaffle_shop` example.
Jupyter Notebook
6
star
13

orchest-coqui-tts

This repository demonstrates an Orchest pipeline that generates an audio fragment using the Quoki TTS engine and sends it as a message on Slack
Jupyter Notebook
6
star
14

html5pong

An HTML5 Pong game Canvas Experiment
JavaScript
5
star
15

openui-groq

TypeScript
3
star
16

funcchain-demo

Python
3
star
17

embedding-explorer

PCA for embedding exploration with OpenAI, Streamlit, scikit-learn and Plotly
Python
3
star
18

orchest-meilisearch-pywebio-hn

Search HN user comments through a PyWebIO interface backed by a Meilisearch DB
Jupyter Notebook
2
star
19

hello-wasp

Saying hi to the cool new wasp-lang.dev project!
JavaScript
2
star
20

collegerama-scrape

JavaScript
2
star
21

formula-1-lap-comparison-orchest

Jupyter Notebook
2
star
22

orchest-multi-language-pipeline

Orchest pipeline demonstrating use of multiple languages in a single pipeline
Jupyter Notebook
2
star
23

CSS3-test

2
star
24

ray_tutorial_orchest

Jupyter Notebook
2
star
25

orchest-questdb

Jupyter Notebook
1
star
26

langsmith-example

Python
1
star
27

orchest-hello-evidently

Jupyter Notebook
1
star
28

gitpod-playground

1
star
29

photon-orchest-pipeline

Python
1
star
30

two-phase-pipeline-streamlit

Python
1
star
31

orchest_pipelines_examples

Example pipelines to use in Orchest
Jupyter Notebook
1
star
32

popular-frontend-github

This repo contains an Orchest project with a pipeline that fetches trending frontend repos in a Notebook.
Jupyter Notebook
1
star
33

koehandel

ActionScript
1
star
34

nlp-talk-orchest

How to train an NLP model from scratch
Jupyter Notebook
1
star
35

thinkstudios-website

CSS
1
star
36

orchest-hello-spark

This repo shows how to run (Py)Spark in Orchest (locally)
Jupyter Notebook
1
star
37

pg-voiced

Website that has PG essays voiced by ElevenLabs. Iโ€™m out of credits, please make PRs
HTML
1
star
38

orchest-pycaret

Demonstration of how to use PyCaret for regression prediction in Orchest
Jupyter Notebook
1
star