Skip to main content

CLI with OSS LLM integration

Project description

Ghost in the Shell

Ghost in the Shell is a cross-platform command-line assistant that lets you use natural language to run shell commands. Whether you’re on macOS, Linux, or Windows, just type what you want to do — AI Shell will suggest the correct shell command, ask for your confirmation, and optionally execute it.

Supports both:

  • One-shot mode: ai "archive.tar" → returns shell command
  • Interactive mode: ai -i → opens a terminal chat with the AI

✨ Features

  • Natural Language to Shell Command (via OpenAI API)
  • Works on macOS, Linux, and Windows (Python-based)
  • Confirmation before execution
  • Interactive chat mode for iterative CLI tasks
  • Colored terminal output for better readability
  • Optional tmux split-pane workflow (chat left, shell right)

Installation

Option 1: Install via Homebrew (recommended for macOS)

brew tap codingmoh/ghost-in-the-shell
brew install ghost-in-the-shell

Option 2: Install via pip (any OS)

pip install ghost-in-the-shell

Option 3: Clone & Install locally

git clone https://github.com/codingmoh/ghost_in_the_shell.git
cd ghost_in_the_shell
pip install .

Now you can use the ai command globally.


🔑 Set OpenAI API Key

You need an OpenAI API key to use this tool:

export OPENAI_API_KEY="your-api-key-here"

You can also add this line to your .bashrc, .zshrc, or .bash_profile.


Usage

One-shot prompt

ai "untar backup.tar.gz"

✅ AI suggests a shell command
✅ Asks for confirmation
✅ Runs the command if you approve


Interactive mode

ai -i

🧠 Open a chat session right in the terminal.
💬 Type natural language instructions like:

You: compress all PNGs in this folder
AI: tar -czvf images.tar.gz *.png

Type exit or quit to leave.


🪟 tmux Split Mode (optional)

Want to split your terminal into chat + shell?

tmux
# Then split horizontally:
Ctrl-B %
# In left pane:
ai -i
# In right pane:
use your normal shell

🛡️ Security Notice

Always review AI-generated commands before executing them.


🧱 Future Plans

  • Voice input via Whisper
  • Local LLM support (e.g., llama.cpp)
  • Fancy TUI with textual or rich
  • Command history and undo
  • Plugin system for workflows

Contributing

PRs welcome! Ideas, issues, improvements — all appreciated.


📝 License

MIT


❤️ Built with love and caffeine by codingmoh.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

open_codex-0.1.8.tar.gz (5.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

open_codex-0.1.8-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

Details for the file open_codex-0.1.8.tar.gz.

File metadata

  • Download URL: open_codex-0.1.8.tar.gz
  • Upload date:
  • Size: 5.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.12

File hashes

Hashes for open_codex-0.1.8.tar.gz
Algorithm Hash digest
SHA256 49abd9a9ff9cd4e21e7934d8c1474773a9c8faa0959045f61451cbc084c60bed
MD5 e70bb449b45c3b42c7794657246c7093
BLAKE2b-256 195bfebb124033d20055c3e60f8560d2eb620af524bb22a7fe300e9cdc188c26

See more details on using hashes here.

File details

Details for the file open_codex-0.1.8-py3-none-any.whl.

File metadata

  • Download URL: open_codex-0.1.8-py3-none-any.whl
  • Upload date:
  • Size: 6.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.12

File hashes

Hashes for open_codex-0.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 6283b1dc95e4135e0015071cd9253e2f5e6e61ab6084e75bec4b55f5ce7075bd
MD5 438b0357bb298d0e8ca926baef215849
BLAKE2b-256 14823b8b9293258d091786905d3135bfa02e3cc68b33641c67a21519622bb671

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page