Metadata-Version: 2.4
Name: nishtha-ai-shell-agent
Version: 1.0.0
Summary: An AI-powered PowerShell assistant that converts natural language into PowerShell commands using Gemini and LangChain.
Project-URL: Homepage, https://github.com/Nishtha-06/ai-shell-agent
Project-URL: Repository, https://github.com/Nishtha-06/ai-shell-agent
Project-URL: Issues, https://github.com/Nishtha-06/ai-shell-agent/issues
Author: Nishtha Modi
License: MIT
License-File: LICENSE
Keywords: ai,automation,cli,gemini,langchain,powershell,shell
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: Microsoft :: Windows
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Topic :: Software Development
Classifier: Topic :: Utilities
Requires-Python: >=3.11
Requires-Dist: langchain-core>=1.4.9
Requires-Dist: langchain-google-genai>=4.2.7
Requires-Dist: langchain>=1.3.14
Requires-Dist: python-dotenv>=1.0.0
Description-Content-Type: text/markdown

# 🤖 AI Shell Agent

An AI-powered command-line assistant that converts natural language into Windows PowerShell commands using **Google Gemini** and **LangChain**. Before executing any command, the agent validates it and asks for user confirmation to ensure safe execution.

---

## ✨ Features

- 🤖 Natural language to PowerShell command generation
- 🧠 Powered by Google Gemini using LangChain
- 🛡️ Command validation before execution
- ✅ User confirmation before running commands
- ⚡ Automatic PowerShell command execution
- 💻 Interactive command-line interface
- 🪟 Designed for Windows PowerShell

---

## 🏗️ Project Architecture

```
User Input
     │
     ▼
 AI Shell Agent
     │
     ▼
 LangChain + Gemini
     │
     ▼
 PowerShell Command
     │
     ▼
 Command Validator
     │
     ▼
 User Confirmation
     │
     ▼
 Command Executor
     │
     ▼
 Windows PowerShell
```

---

## 📂 Project Structure

```
ai-shell-agent/
│
├── app/
│   ├── __init__.py
│   ├── main.py
│   ├── agent.py
│   ├── llm.py
│   ├── validator.py
│   ├── executor.py
│   └── prompts.py
│
├── README.md
├── LICENSE
├── pyproject.toml
├── .env.example
└── .gitignore
```

---

## ⚙️ Tech Stack

- Python 3.11+
- LangChain
- Google Gemini API
- python-dotenv
- subprocess (Python Standard Library)
- PowerShell

---

## 🚀 Installation

Clone the repository:

```bash
git clone https://github.com/Nishtha-06/ai-shell-agent
cd ai-shell-agent
```

Install dependencies using **uv**:

```bash
uv sync
```

or using pip:

```bash
pip install -e .
```

---

## 🔑 Environment Variables

Create a `.env` file in the project root.

```
GEMINI_API_KEY=your_gemini_api_key
```

You can get an API key from:

https://aistudio.google.com/app/apikey

---

## ▶️ Running the Agent

Run the application:

```bash
ai-shell
```

or

```bash
python -m app.main
```

---

## 💬 Example

```
You > Create a folder named Project

Generated Command:
mkdir Project

Execute this command? (y/n): y

Command executed successfully.
```

---

## 🔄 Workflow

```
Natural Language
        │
        ▼
Gemini (LangChain)
        │
        ▼
PowerShell Command
        │
        ▼
Validator
        │
        ▼
Confirmation
        │
        ▼
Executor
        │
        ▼
PowerShell
```

---

## 🛡️ Safety

Before executing any generated command, the agent:

- Validates the generated PowerShell command
- Blocks potentially unsafe commands (based on validator rules)
- Requests user confirmation before execution

This helps prevent accidental execution of harmful commands.

---

## 📌 Current Limitations

- Supports Windows PowerShell only
- Requires a Google Gemini API key
- Executes one command at a time
- Does not maintain conversation memory between commands

---

## 🚀 Future Improvements

- Conversation memory
- LangGraph integration
- Tool calling
- Command history
- Plugin support
- Persistent shell session
- Linux and macOS support
- Rich terminal interface

---

## 👩‍💻 Author

**Nishtha Modi**

---

## 📄 License

This project is licensed under the MIT License.