Metadata-Version: 2.4
Name: tiaga
Version: 1.0.5
Summary: A CLI tool
Author: Seems kushwaha
Requires-Python: >=3.12
Description-Content-Type: text/markdown
License-File: LICENSE.md
Requires-Dist: deep-translator>=1.11.4
Requires-Dist: duckduckgo-search>=8.1.1
Requires-Dist: click>=8.3.2
Requires-Dist: httpx>=0.28.1
Requires-Dist: openai>=1.0.0
Requires-Dist: platformdirs>=4.3.8
Requires-Dist: pydantic>=2.12.5
Requires-Dist: python-dotenv>=1.1.1
Requires-Dist: tiktoken>=0.12.0
Requires-Dist: tomli>=2.4.1
Requires-Dist: youtube-transcript-api>=1.2.4
Requires-Dist: ddgs>=9.13.0
Requires-Dist: fastmcp>=3.2.3
Requires-Dist: rich>=14.1.0
Requires-Dist: questionary>=2.1.0
Requires-Dist: twine>=7.0.0
Provides-Extra: dev
Requires-Dist: pytest>=9.0.3; extra == "dev"
Requires-Dist: ruff>=0.12.0; extra == "dev"
Provides-Extra: anthropic
Requires-Dist: anthropic>=0.30.0; extra == "anthropic"
Provides-Extra: gemini
Requires-Dist: google-generativeai>=0.8.0; extra == "gemini"
Provides-Extra: all-providers
Requires-Dist: anthropic>=0.30.0; extra == "all-providers"
Requires-Dist: google-generativeai>=0.8.0; extra == "all-providers"
Provides-Extra: multi-lang
Requires-Dist: tree-sitter>=0.21.0; extra == "multi-lang"
Requires-Dist: tree-sitter-python>=0.21.0; extra == "multi-lang"
Requires-Dist: tree-sitter-javascript>=0.21.0; extra == "multi-lang"
Requires-Dist: tree-sitter-java>=0.21.0; extra == "multi-lang"
Requires-Dist: tree-sitter-go>=0.21.0; extra == "multi-lang"
Requires-Dist: tree-sitter-rust>=0.21.0; extra == "multi-lang"
Requires-Dist: tree-sitter-cpp>=0.21.0; extra == "multi-lang"
Dynamic: license-file

# ⚡ Tiaga CLI

> **The AI Coding Assistant and Cloud Platform CLI for Modern Python**  
> *Vibe-code on the web, hack locally in your terminal, and ship instantly to production.*

---

## 🌟 Overview

**Tiaga** is a developer-first terminal CLI and AI pair programmer. Designed with modern UX principles (collapsing inline spinners, scrollback-friendly terminal UI, fuzzy session restoration), Tiaga bridges the gap between AI code synthesis and cloud deployments:

- 🤖 **Interactive AI Assistant**: Powered by local or cloud LLMs (Gemma, Claude, GPT, Ollama) with tool execution (file editing, terminal commands, web search, sandboxing).
- 🔐 **Unified Authentication**: Single Sign-On (SSO) with **Trivia** and **Blockhost Cloud** with built-in 6-digit email OTP verification.
- ⚡ **Zero-Config Dev Server**: `tiaga dev` runs with automatic reload, file watching, and intelligent port collision detection.
- 🚀 **Instant Cloud Deployments**: `tiaga deploy` packages your project and deploys to Blockhost PaaS with auto-provisioned Let's Encrypt SSL via Caddy.
- 📜 **Contextual Persistence**: Project-scoped conversation history in SQLite with fuzzy session resumption (`tiaga resume`).

---

## 📦 Installation

```bash
# Clone the repository
git clone https://github.com/seems/Tiaga.git
cd Tiaga

# Install editable via uv or pip
uv pip install -e .
```

Verify installation:
```bash
tiaga --help
```

---

## 🚀 Quick Start

### 1. Authenticate with Your Cloud Account
```bash
tiaga login
```
If your email is not yet verified, Tiaga will automatically prompt you for your 6-digit verification code:
```text
▲ Tiaga CLI • Blockhost Cloud Platform
! No active login found. Please sign in to your Trivia / Blockhost account:

? Email: developer@example.com
? Password: ••••••••••••

! Email Verification Required
A 6-digit verification code has been sent to developer@example.com.

? Enter 6-digit verification code: 554952
✔ Logged in as Developer <developer@example.com>
```

Check your identity anytime:
```bash
tiaga whoami
```

### 2. Start Chatting with AI
```bash
tiaga
```
```text
╭──────────────────────────────────────────────────────────────────────────────╮
│           TIAGA  •  gemma4:31b-cloud  •  developer@example.com               │
╰──────────────────────────────────────────────────────────────────────────────╯

❯ create a FastAPI endpoint that parses markdown and returns HTML
```

Or pass a one-shot instruction:
```bash
tiaga "add CORS middleware to main.py"
```

---

## 🛠️ CLI Reference

### 🤖 AI Coding & Sessions
| Command | Description |
| :--- | :--- |
| `tiaga` | Launch the interactive coding assistant (enforces login). |
| `tiaga chat [PROMPT]` | Chat or run a single instruction. |
| `tiaga resume [SESSION_ID]` | Interactively pick and resume past conversations filtered by linked project. |

#### In-Chat Slash Commands
- `/exit`, `/quit` — Exit chat session.
- `/clear` — Clear terminal screen.
- `/new` — Start a fresh conversation session.
- `/resume` — Fuzzy pick a previous conversation.
- `/model [NAME]` — View or switch the active LLM.
- `/config` — Inspect current configuration.

---

### ☁️ Cloud & Ecosystem Commands

| Command | Description |
| :--- | :--- |
| `tiaga login` | Sign in with your Trivia / Blockhost credentials (supports inline OTP verification). |
| `tiaga logout` | Sign out and clear stored credentials (`~/.config/seems-tiaga/auth.json`). |
| `tiaga whoami` | Show authenticated user, email, and connected API endpoint. |
| `tiaga projects` (or `tiaga ls`) | List all your projects deployed on Blockhost Cloud. |
| `tiaga link` | Interactively link the current local directory to a cloud project. |
| `tiaga unlink` | Disconnect the current directory from its cloud project. |
| `tiaga pull` | Pull files from your Trivia web workspace into your local workspace. |
| `tiaga dev` | Start the local hot-reloading dev server with port collision detection. |
| `tiaga deploy` | Bundle and deploy your application directly to Blockhost PaaS. |
| `tiaga logs` | Stream live runtime logs from Blockhost containers. |

---

## 🏗️ Ecosystem Architecture

Tiaga operates as the terminal client within a unified 3-tier ecosystem:

```
┌────────────────────────────────────────────────────────┐
│              UNIFIED POSTGRESQL / USERS DB             │
│ id, email, auth_hash, nickname, email_verified_at, ... │
└───────────────────────────▲────────────────────────────┘
                            │
              ┌─────────────┴─────────────┐
              ▼                           ▼
 ┌───────────────────────────┐ ┌───────────────────────────┐
 │        TRIVIA API         │ │      BLOCKHOST PAAS       │
 │  • AI Code Generation     │ │  • Bare-Metal & Cloud VMs │
 │  • Workspaces & Sync      │ │  • Caddy Auto-SSL Routing │
 │  • 6-digit Email OTP Auth │ │  • Container Hypervisor   │
 └─────────────▲─────────────┘ └─────────────▲─────────────┘
               │                             │
               │        Tiaga CLI            │
               └──────────────┬──────────────┘
                              │
                    ┌─────────▼─────────┐
                    │    LOCAL SYSTEM   │
                    │ ~/.config/seems-  │
                    │ tiaga/auth.json   │
                    │ tiaga/sessions.db │
                    └───────────────────┘
```

1. **Trivia Web**: The visual canvas for vibe-coding and rapid prototyping.
2. **Tiaga CLI**: The hacker's terminal tool for local refinement, debugging, and terminal automation.
3. **Blockhost**: The compute engine that runs the containers, custom domains, and managed databases.

---

## ⚙️ Configuration

Tiaga stores state in standard user configuration directories:
- **Credentials**: `~/.config/seems-tiaga/auth.json`
- **Session History**: `~/.config/seems-tiaga/sessions.db` (SQLite)
- **Local Project Link**: `.tiaga/project.json` (inside linked project roots)

### Environment Variables
- `TRIVIA_API_URL` — Trivia API server (default: `https://trivia.ryzn.pro`).
- `BLOCKHOST_API_URL` — Blockhost control plane (default: `https://trivia.ryzn.pro`).
- `OPENAI_API_KEY` / `GEMINI_API_KEY` / `ANTHROPIC_API_KEY` — API keys for local inference fallback.

---

## 📄 License

MIT License. Designed with ❤️ by the Seems engineering team.
