Skip to main content

shai 🤖

AI-powered shell command suggestions

Overview

shai is a command-line tool that converts natural language into shell commands using AI. Simply describe what you want to do, and shai will suggest the appropriate commands. You can use OpenAI or a local LLM as long as it follows the same format and supports the structured output feature. vLLM models are tested and supported.

Installation

Using pip

pip install onprem-shai

Quick Start

First, set your model to use:

export SHAI_BASE_URL='model-host'
export SHAI_MODEL_NAME='model-name-to-use'
export SHAI_API_KEY='your-api-key'
export SHAI_DEFAULT_SUGGESTIONS=2

Then use shai:

shai run docker test

Usage

Basic Usage

shai create a new python virtual environment

Examples

  1. Docker operations:
$ shai run nginx container with port 80
1. docker run -p 80:80 nginx
2. docker run -d -p 80:80 nginx
Choose a command to execute (or 0 to cancel):
  1. File operations:
$ shai find all pdf files in current directory
1. find . -name "*.pdf"
2. find . -type f -name "*.pdf"
Choose a command to execute (or 0 to cancel):
  1. Git operations:
$ shai "undo last git commit"
1. git reset --soft HEAD~1
2. git reset --hard HEAD~1
Choose a command to execute (or 0 to cancel):

Features

  • 🌟 Natural language command generation
  • 🎯 Multiple command suggestions
  • ✅ Command execution confirmation
  • 🔄 Interactive command selection
  • 🛡️ Safe execution with confirmation
  • 📝 Clear and helpful suggestions

How It Works

  1. You describe what you want to do in plain English
  2. shai sends your request to LLM to generate command suggestions
  3. You choose which command to execute
  4. shai executes the selected command after confirmation

Requirements

  • Python 3.9 or higher
  • Running LLM (Local or OpenAI model)

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Security

  • 🔒 Commands are never executed without explicit confirmation
  • 🔑 API keys are handled securely via environment variables
  • ⚠️ Always review suggested commands before execution

Limitations

  • Requires active internet connection
  • Depends on the LLM availability
  • May incur API usage costs
  • Suggestions may not always be perfect

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

  • "Attention is all you need" paper
  • The Python community for amazing tools and libraries
  • All contributors who help improve this project

Made with ❤️ by Islam Almersawi

Metadata

Release files for onprem-shai 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for onprem-shai 0.1.2
File Size Uploaded Provenance
onprem_shai-0.1.2.tar.gz 4.3 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for onprem-shai 0.1.2
File Interpreter ABI Platform
onprem_shai-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 9.1 kB

Release files / onprem_shai-0.1.2.tar.gz

Download URL onprem_shai-0.1.2.tar.gz
Size 4.3 kB
Tags Source
SHA-256 checksum
How to use checksums
76ffc78668de856086ab3407287966e49813f94ddf704525a72f9763eb748f79
BLAKE2b-256 checksum
How to use checksums
e3e6ad8e85d9f66b666db7bd62bade520620fce480ad4e47723868df55aa99f3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.3

Release files / onprem_shai-0.1.2-py3-none-any.whl

Download URL onprem_shai-0.1.2-py3-none-any.whl
Size 4.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
743d8c4e4f5f20f856d5a5c7c012b67d964728f9f364dba4d32fc2e52b82e994
BLAKE2b-256 checksum
How to use checksums
842e4d63ff6b8381e81d73949ca260bae8075c4cb3df73999b7ecfb33ff2c836
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.3

Security for onprem-shai 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page