Skip to main content

CLI with OpenAI integration

Project description

Ghost in the Shell

AI 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

Install via pip

pip install ghost-in-the-shell

Clone & Install

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.

2. Set OpenAI API Key

You need an OpenAI API key to use this tool.

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

🚀 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 suggests: 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


❤️ Credits

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

ghost_in_the_shell-0.1.6.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

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

ghost_in_the_shell-0.1.6-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

Details for the file ghost_in_the_shell-0.1.6.tar.gz.

File metadata

  • Download URL: ghost_in_the_shell-0.1.6.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.11

File hashes

Hashes for ghost_in_the_shell-0.1.6.tar.gz
Algorithm Hash digest
SHA256 62133574877f2538de6cc881c3527c6e1e3a100a8a4c91d65010ee35c33d9d9e
MD5 0191d65df38a5e5e96930e211f3c63db
BLAKE2b-256 c1a2a4ed51dc7d55ef0252494deb91eb2f3466913a8e07c65d4b58c153a360e8

See more details on using hashes here.

File details

Details for the file ghost_in_the_shell-0.1.6-py3-none-any.whl.

File metadata

File hashes

Hashes for ghost_in_the_shell-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 919e2fe32367ab33f83c6e57aa5dc5a100f75fe6b6866f1e6c4e9cbee69cde17
MD5 8cb04844e6d180aaaf3fd1bf5afbdb4c
BLAKE2b-256 00578ce16af7b5d07c45395f7a8e1c0fda2be6c51432566159512bd199854464

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