Metadata-Version: 2.4
Name: letx
Version: 1.1.0
Summary: The developer utility toolkit — debug smarter, fix faster.
License: GPL-3.0-only
Keywords: developer,debug,cli,tools,utilities
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Debuggers
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: rich>=13.0
Dynamic: license-file

<div align="center">

# ⚡ letx

**The developer utility toolkit — debug smarter, fix faster.**

*Built by [Ammaar Bakshi](https://github.com/AMMAAR-IC)*

[![PyPI version](https://img.shields.io/pypi/v/letx.svg)](https://pypi.org/project/letx/)
[![Python](https://img.shields.io/pypi/pyversions/letx.svg)](https://pypi.org/project/letx/)
[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)

</div>

---

`letx` is a modular Python CLI toolkit built for **everyone** — beginners who need plain-English error explanations, and experienced developers who want fast, no-noise tooling straight from the terminal.

No more staring at raw tracebacks. No more hunting through files to remove comments. Just run a command and get things done.

---

## 📦 Installation

```bash
pip install letx
```

Or install from source:

```bash
git clone https://github.com/AMMAAR-IC/letx.git
cd letx
pip install -e .
```

---

## 🛠 Tools

### `letxDebug` — Smart Debugger

Runs your Python file and gives you clean, useful output instead of a wall of red text.

| Command | What it does |
|---|---|
| `letxDebug file.py` | Run and show clean debug output |
| `letxDebug -e file.py` | Explain the error in plain English |
| `letxDebug -s file.py` | Suggest a fix / solution |
| `letxDebug -a file.py` | Everything: explain + solution |

**Example:**

```bash
$ letxDebug -a my_script.py

⚡ letx › letxDebug
Debugging → my_script.py

🔴 Traceback
  NameError: name 'pritn' is not defined

💬 Error Explanation
  You used a variable or function that Python doesn't know about yet.

🔧 Suggested Fix
  1. Check the spelling of the variable name
  2. Make sure you defined the variable before using it
  3. If it's a function from a module, did you import it?
```

---

### `letxFix` — Code Fixer

Clean up your Python files with one command.

#### Remove Comments

```bash
# Remove ALL comments from a file
letxFix -rm -cmt file.py

# Remove ALL comments from an entire folder
letxFix -rm -cmt src/

# Remove only single-line comments (#)
letxFix -rm -cmt -s file.py

# Remove only multi-line comments (triple-quoted)
letxFix -rm -cmt -m file.py

# Dry run — preview changes without modifying any files
letxFix -rm -cmt --dry-run src/
```

---

### `letx` — List all tools

```bash
$ letx

⚡ letx › The developer utility toolkit
┌────────────┬───────────────────────────────────────────────────────┐
│ Command    │ Description                                           │
├────────────┼───────────────────────────────────────────────────────┤
│ letxDebug  │ Smart Python debugger — run, explain, and fix errors  │
│ letxFix    │ Code fixer and cleaner                                │
└────────────┴───────────────────────────────────────────────────────┘

Run <command> --help for usage details.
```

---

## 🔌 Extending letx

`letx` is built to grow. Adding a new tool takes exactly 4 steps:

**1. Create `letx/modules/mymodule.py`**

```python
from letx.core.base import LetxModule
from argparse import ArgumentParser

class MyModule(LetxModule):
    @property
    def name(self): return "letxMy"

    @property
    def description(self): return "Does something awesome"

    def register_args(self, parser: ArgumentParser):
        parser.add_argument("file", help="Target file")
        parser.add_argument("-x", action="store_true", help="Do X")

    def run(self, args) -> int:
        # your logic here
        return 0
```

**2. Register it in `letx/modules/__init__.py`**

```python
from letx.modules.mymodule import MyModule

REGISTRY = {
    ...
    "letxMy": MyModule(),
}
```

**3. Add an entry point in `letx/cli.py`**

```python
def letx_my():
    run_module("letxMy")
```

**4. Register in `pyproject.toml`**

```toml
[project.scripts]
letxMy = "letx.cli:letx_my"
```

Then reinstall with `pip install -e .` and your new command is live. ✔

---

## 📁 Project Structure

```
letx/
├── pyproject.toml
├── README.md
├── LICENSE
└── letx/
    ├── cli.py              ← entry points
    ├── core/
    │   └── base.py         ← LetxModule base class
    ├── modules/
    │   ├── __init__.py     ← module registry
    │   ├── debug.py        ← letxDebug
    │   └── fix.py          ← letxFix
    └── utils/
        ├── printer.py      ← rich terminal output
        └── runner.py       ← subprocess file executor
```

---

## 👤 Author

**Ammaar Bakshi**
— Built `letx` to make Python debugging less painful for everyone.

🔗 GitHub: [https://github.com/AMMAAR-IC/letx](https://github.com/AMMAAR-IC/letx)

If you find it useful, consider giving it a ⭐ on GitHub.

---

## 📄 License

This project is licensed under the **GNU General Public License v3.0** — see the [LICENSE](LICENSE) file for details.
