Metadata-Version: 2.4
Name: rapt0r-cli
Version: 1.0.0
Summary: Offline terminal prompt builder — answer a few questions, get a perfect AI prompt in your clipboard. Zero tokens spent on explanations.
Author: i73
License: MIT
Project-URL: Homepage, https://github.com/i73i73i73i73/RAPT0R
Project-URL: Repository, https://github.com/i73i73i73i73/RAPT0R
Project-URL: Issues, https://github.com/i73i73i73i73/RAPT0R/issues
Project-URL: Changelog, https://github.com/i73i73i73i73/RAPT0R/blob/main/CHANGELOG.md
Keywords: prompt,ai,cli,terminal,tui,prompt-engineering,llm,claude,openai,developer-tools
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development
Classifier: Topic :: Terminals
Classifier: Topic :: Utilities
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: InquirerPy<0.4,>=0.3.4
Requires-Dist: rich
Requires-Dist: pyperclip
Requires-Dist: PyYAML
Requires-Dist: Jinja2>=3.0
Provides-Extra: dev
Requires-Dist: pytest; extra == "dev"
Requires-Dist: ruff; extra == "dev"
Requires-Dist: build; extra == "dev"
Dynamic: license-file

<div align="center">

<img src="docs/rapt0r.png" alt="RAPT0R" width="100%"/>

<br>

**build fast. ship faster.**<br>
*prompt builder by i73*

[![Python](https://img.shields.io/badge/Python-3.9%2B-blueviolet?style=for-the-badge&logo=python)](https://python.org)
[![Terminal](https://img.shields.io/badge/CLI-Terminal-darkviolet?style=for-the-badge&logo=gnome-terminal)](https://github.com/i73i73i73i73/RAPT0R)
[![License](https://img.shields.io/badge/License-MIT-success?style=for-the-badge)](LICENSE)

![demo](docs/demo.gif)

</div>

---

> **Don't spend tokens explaining yourself — spend them on results.**

**RAPT0R** is a terminal prompt builder. Answer a few questions, get a battle-tested AI prompt in your clipboard, or execute it directly against an LLM. Offline by design — your context window goes entirely to the actual work.

## ✨ Features

- 🔌 **Offline by default** — build complex prompts with zero API calls, or optionally stream execution directly to OpenAI/Anthropic.
- ⚡️ **Fast** — answer 3-5 questions, the finished prompt is already in your clipboard.
- 📁 **Project context** — drop a `.rapt0r` file in your repo and your stack/rules/architecture get injected into every prompt automatically.
- 🔎 **Instant search** — press `f` anywhere to fuzzy-search templates across all categories.
- 🌳 **Branching** — smart templates ask follow-up questions based on your answers.
- 🛠 **Built-in manager** — create, edit, and delete templates right from the menu.
- 🎨 **Polished TUI** — custom colors, number hotkeys, icons, built on `InquirerPy` and `rich`.

---

## 🚀 Install

```bash
pip install rapt0r-cli
```

Run it:

```bash
rapt0r
```

<details>
<summary>Or run from source</summary>

```bash
git clone https://github.com/i73i73i73i73/RAPT0R.git
cd RAPT0R
pip3 install -e .
rapt0r          # or: python3 main.py
```
</details>

---

## 📁 Project context (`.rapt0r`)

Stop re-explaining your project to the AI in every prompt. Describe it once — RAPT0R appends it to every prompt it builds.

Create a `.rapt0r` file in your project root (any plain text or markdown):

```markdown
Stack: FastAPI + React + PostgreSQL
Style: type hints everywhere, no classes where functions do
Architecture: monorepo, backend in /api, frontend in /web
Rules: never touch migrations by hand, tests are pytest
```

Run `rapt0r` from anywhere inside the project — it finds the file by walking up the directory tree and adds a `## Project context` section to the generated prompt.

---

## ⌨️ Hotkeys

| Key | Action |
|-----|--------|
| `1-9` | Jump to item |
| `f` | Fuzzy search across all templates |
| `0` | Exit / back |
| `Ctrl+C` | Cancel current flow |

---

## 📝 Writing your own templates

Templates are plain Markdown with **YAML frontmatter**. Press `Create template` in the menu, or drop a `.md` file into a category folder:

```markdown
---
name: "✨ My awesome prompt"
questions:
  role: "What role should the AI play?"
  task: "Describe the task in one sentence:"
branch:
  question: "Add a constraints section?"
  y:
    questions:
      limits: "List the constraints, comma-separated:"
    body: "constraints_body"
---

You act as: {{role}}.
Your task: {{task}}.

{{constraints_body}}
```

### Syntax

- `name` — display name in the menu.
- `questions` — `key: "Question?"` pairs; keys become `{{variables}}` in the body. Add `choices:` for a pick-list.
- `branch` *(optional)* — yes/no fork that asks extra questions and switches the body.
- `{{variable}}` — replaced with your answers.

Where templates live: the repo's `rapt0r/templates/` when running from source, `~/.rapt0r/templates/` when installed via pip (seeded automatically on first run). Generated prompts are saved to `~/.rapt0r/prompts/` (or `prompts/temp/` in a source checkout).

---

## 🧠 Philosophy

> **Precise context = fewer tokens = better results.**

Every API call where you explain your project from scratch costs money and context window. RAPT0R forces the discipline of giving the AI exactly the inputs it needs — offline, for free, in seconds.

<div align="center">
  <sub>built with ❤️ for AI engineering</sub>
</div>
