Metadata-Version: 2.4
Name: lzycli
Version: 1.0.0
Summary: Translate natural language commands into Linux bash commands.
Author-email: Ricardo Borges <ricardoborges@gmail.com>
License: MIT License
        
        Copyright (c) 2025 Ricardo
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pydantic>=2.11.4
Requires-Dist: pydantic-ai>=0.1.11
Requires-Dist: python-dotenv
Requires-Dist: rich
Dynamic: license-file

# 🐧 Lzy – Natural Language to Bash CLI

**Lzy** is a command-line tool that uses AI to translate natural language into Linux bash commands, explains what the command does, and lets you choose whether to run, edit, or abort the execution.

---

## ✨ Features

- 🔁 Translates natural language into valid Bash commands.
- 📘 Explains each command in natural language.
- 🛠️ Lets you review or edit the command before execution.
- 🔐 Works with multiple AI providers.
- 🎨 Fancy terminal output with `rich`.

---

## 🎥 Demo

[![Watch the demo](https://img.youtube.com/vi/W9jMvZKNo4M/0.jpg)](https://www.youtube.com/watch?v=W9jMvZKNo4M)

Click the image above or [watch on YouTube](https://www.youtube.com/watch?v=W9jMvZKNo4M).

---

## 🚀 Installation

```bash
pip install lzy
```

---

## 🔧 Environment Variables

Lzy uses environment variables to configure the AI provider and its corresponding API key.

### Required

| Variable           | Description                                          |
|--------------------|------------------------------------------------------|
| `CLI_PROVIDER`     | Which provider to use: `gemini`, `openai`, `together`,... |
| `*_API_KEY`        | The API key for the chosen provider (see below)      |

### Supported Providers

| CLI_PROVIDER | Required Variable      |
|--------------|------------------------|
| `gemini`     | `GEMINI_API_KEY`       |
| `openai`     | `OPENAI_API_KEY`       |
| `together`   | `TOGETHER_API_KEY`     |
| `nvidia`     | `NVIDIA_API_KEY`       |
| `anthropic`   | `ANTHROPIC_API_KEY`   |
| `groq`        | `GROQ_API_KEY`        |
| `mistral`     | `MISTRAL_API_KEY`     |

### Optional

| Variable           | Description                              |
|--------------------|------------------------------------------|
| `.env` file        | You can use a `.env` file to load variables automatically (via `python-dotenv`) |

### Example `.env` file:

```env
CLI_PROVIDER=gemini
GEMINI_API_KEY=your_google_api_key_here
```

---

## 🧪 Usage

```bash
lzy "find all PDF files in the current directory"
```

You’ll get a result like this:

```
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Command                             ┃ Description                                  ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ find . -name '*.pdf'                │ Searches for all PDF files in the current    │
│                                     │ directory and its subdirectories.            │
└─────────────────────────────────────┴──────────────────────────────────────────────┘
```

Then you're prompted to choose:

- `y`: run the command
- `e`: edit it first
- `n`: cancel

---

## 🧩 Dev Tip

You can also run directly via Python for debugging:

```bash
python lzy/cli.py "delete all .DS_Store files in this folder"
```

---

## 📜 License

MIT License
