Metadata-Version: 2.4
Name: devobin
Version: 1.0.0
Summary: AI Engineering Context Compiler and Prompt Architect CLI — reads your code, builds the perfect prompt
Project-URL: Homepage, https://github.com/mobinhasanghasemi/devobin
Project-URL: Repository, https://github.com/mobinhasanghasemi/devobin
Project-URL: Issues, https://github.com/mobinhasanghasemi/devobin/issues
Author-email: Mobin Hasanghasemi <mobin@devobin.ai>
License-Expression: MIT
License-File: LICENSE
Keywords: ai,claude,cli,codex,coding-agent,context-compilation,cursor,developer-tools,prompt-engineering
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Software Development :: Code Generators
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
Classifier: Topic :: Software Development :: Quality Assurance
Requires-Python: >=3.12
Requires-Dist: aiofiles>=23.2.0
Requires-Dist: anthropic>=0.18.0
Requires-Dist: arabic-reshaper>=3.0.0
Requires-Dist: google-genai>=1.0.0
Requires-Dist: httpx>=0.27.0
Requires-Dist: openai>=1.10.0
Requires-Dist: platformdirs>=4.2.0
Requires-Dist: pydantic-settings>=2.1.0
Requires-Dist: pydantic>=2.5.0
Requires-Dist: python-bidi>=0.6.0
Requires-Dist: rich>=13.7.0
Requires-Dist: textual>=0.40.0
Requires-Dist: typer>=0.12.0
Provides-Extra: dev
Requires-Dist: pytest-asyncio>=0.23.0; extra == 'dev'
Requires-Dist: pytest>=8.0.0; extra == 'dev'
Requires-Dist: ruff>=0.2.0; extra == 'dev'
Description-Content-Type: text/markdown

<div dir="ltr">

# DevObin AI

> **AI Engineering Context Compiler & Prompt Architect**

DevObin is a CLI-based prompt engineering system that autonomously reads your project code and produces customized engineering prompts for AI coding agents. It does NOT write code — it crafts the perfect prompt so Codex, Claude, Cursor, or any AI agent builds exactly what you need.

---

## What DevObin Does

```
You: "Add caching to my provider calls"
   │
   ▼
DevObin scans your project → reads your actual code → understands your architecture
   │
   ▼
DevObin writes: caching_feature_prompt.md  (in your directory)
   │
   ▼
Give the file to Codex/Claude/Cursor → they implement it perfectly
```

**Key difference:** DevObin reads YOUR code and produces a prompt based on YOUR actual architecture — not a generic template.

---

## Installation

```bash
pip install devobin
```

Or from source:

```bash
git clone https://github.com/mobinhasanghasemi/devobin.git
cd devobin
pip install -e .
```

---

## Quick Start

### 1. Launch DevObin

```bash
cd your-project/
devobin
```

### 2. Connect an AI Provider

```
> /connect
```

| Provider | Key Format | Example Model |
|----------|-----------|---------------|
| OpenAI | `sk-...` | `gpt-4o` |
| Anthropic | `sk-ant-...` | `claude-sonnet-4-20250514` |
| Google | `AIza...` | `gemini-2.0-flash` |
| Ollama | (no key) | `llama3` |

### 3. Describe What You Want

```
> Add a caching layer to the provider calls
```

### 4. DevObin Does Everything

1. **Scans** your workspace automatically
2. **Asks permission** to read your files
3. **Reads** every important source file
4. **Understands** your real architecture
5. **Writes** the prompt file to your directory
6. **Tells you** "Created: caching_prompt.md"

**You never type /export.** DevObin creates the file itself.

### 5. Give the File to a Coding Agent

```bash
# The file is in your current directory
cat caching_prompt.md

# Give it to Codex, Claude, Cursor, or any AI agent
```

---

## How It Works

### Agent System

DevObin has an autonomous agent that explores your codebase using tools:

| Tool | What It Does |
|------|-------------|
| `[TOOL:glob:**/*.py]` | Find files by pattern |
| `[TOOL:grep:regex]` | Search file contents |
| `[TOOL:read:path]` | Read a file completely |
| `[TOOL:ls:path]` | List directory contents |
| `[TOOL:write:name.md]` | Create the prompt file |

The agent runs up to **10 rounds** of tool calls to thoroughly understand your project before producing the prompt.

### Permission System

Before reading your files, DevObin asks permission:

```
┌─ File Access Permission ─────────────┐
│ DevObin found 44 files.             │
│ Allow file access?                  │
│                                    │
│ [Yes — Read All Files]             │
│ [Ask Before Each File]             │
│ [No — Skip File Reading]           │
└────────────────────────────────────┘
```

### Grounding Check

After generating the prompt, DevObin verifies it doesn't hallucinate technologies:

- If your project has NO database → prompt won't mention PostgreSQL
- If your project has NO Dockerfile → prompt won't mention Docker
- If your project has NO frontend → prompt won't mention React

If hallucinations are detected, DevObin automatically rewrites the prompt.

### Session-Based History

Each chat conversation is stored separately:

```
.devobin/projects/myproject/sessions/
├── 2026-07-14T10-30-00.json
├── 2026-07-14T11-15-00.json
└── 2026-07-14T14-00-00.json
```

Use `/history` to browse past sessions.

---

## Commands

### Chat Commands

| Command | Description |
|---------|-------------|
| `/connect` | Set up an AI provider |
| `/model <name>` | Switch model |
| `/project create <name>` | Create project |
| `/project switch <name>` | Switch project |
| `/project list` | List projects |
| `/scan` | Re-scan workspace |
| `/history` | View past sessions |
| `/memory` | View saved memories |
| `/export [name]` | Manual export (rarely needed) |
| `/settings` | Show settings |
| `/clear` | Clear current chat |
| `/help` | Command palette |

### Shell Commands

| Command | Description |
|---------|-------------|
| `/run <cmd>` | Execute shell command |
| `/read <file>` | Read file |
| `/ls [path]` | List directory |
| `/git <args>` | Git commands |
| `/pip <args>` | Pip commands |
| `/python <args>` | Run Python |

### Keyboard Shortcuts

| Shortcut | Action |
|----------|--------|
| `Ctrl+K` | Command palette |
| `Ctrl+L` | Clear chat |
| `Ctrl+Q` | Quit |
| `/` alone | Command palette |

---

## Example Session

```
$ cd my-python-project
$ devobin

> /connect
  [Select: openai, enter API key, select gpt-4o]

> بچین کدها رو و یه پرامپت مهندسی شده بساز

  [Scanning workspace... 44 files found]
  [Permission: Read All Files]
  [Reading files... (round 1)]
  [Reading files... (round 2)]
  [Reading files... (round 3)]
  [Creating prompt file... (round 4)]
  Created: my_feature_prompt.md

> یه caching اضافه کن

  [Reading files... (round 1)]
  [Reading existing prompt... (round 2)]
  [Updating prompt file... (round 3)]
  Updated: my_feature_prompt.md
```

---

## Architecture

```
devobin/
├── main.py              # Typer CLI entry
├── app.py               # Textual TUI app
├── core/
│   ├── scanner.py       # Workspace scanner
│   ├── tools.py         # Agent tools (glob/grep/read/ls/write)
│   ├── validator.py     # Output + grounding validation
│   ├── prompt_builder.py # Template-based prompts (fallback)
│   ├── analyzer.py      # Tech detection
│   ├── researcher.py    # Knowledge base
│   ├── memory.py        # Cross-session memory
│   ├── optimizer.py     # Token compression
│   └── executor.py      # Shell & file ops
├── providers/
│   ├── __init__.py      # Provider registry
│   ├── openai_provider.py
│   ├── anthropic_provider.py
│   ├── google_provider.py
│   └── ollama_provider.py
├── ui/
│   ├── chat_screen.py   # Main screen + agent loop
│   ├── export_modal.py  # Export dialog
│   ├── ask_modal.py     # Question dialog
│   ├── permission_modal.py # Permission dialog
│   ├── history_modal.py # Session history
│   └── command_palette.py
├── config/
│   └── settings.py      # Config + local_data_dir()
└── storage/
    └── database.py      # .devobin/ + sessions
```

---

## Configuration

### Platform Config (providers, settings)

| Platform | Location |
|----------|----------|
| Windows | `%APPDATA%/devobin/` |
| Linux | `~/.config/devobin/` |
| macOS | `~/Library/Application Support/devobin/` |

### Project Data (history, memory)

Stored in `.devobin/` inside your project directory:

```
your-project/
├── .devobin/
│   └── projects/
│       └── myproject/
│           ├── memory.json
│           ├── meta.json
│           └── sessions/
│               ├── 2026-07-14T10-30-00.json
│               └── 2026-07-14T11-15-00.json
├── src/
│   └── ...
└── caching_prompt.md   ← DevObin created this
```

---

## Security

- API keys stored locally, never sent anywhere except the provider
- Tool `write` only allows `.md` files (no code execution)
- Directory traversal blocked
- File access requires explicit user permission
- Grounding check prevents hallucinated technology suggestions

---

## Dependencies

- Python ≥ 3.12
- Typer (CLI)
- Textual (TUI)
- Rich (rendering)
- openai / anthropic / google-genai (AI providers)
- httpx (HTTP client)
- platformdirs (config paths)
- arabic-reshaper + python-bidi (RTL support)

---

## License

MIT License

## Author

**Mobin Hasanghasemi**
- GitHub: [github.com/mobinhasanghasemi](https://github.com/mobinhasanghasemi)

</div>
