Metadata-Version: 2.3
Name: tato_code
Version: 0.1.0
Summary: Add your description here
Author-email: somewonesomewone@gmail.com
Requires-Dist: deepagents>=0.7.8
Requires-Dist: inquirer>=3.4.1
Requires-Dist: prompt-toolkit>=3.0.0
Requires-Dist: langchain>=1.3.16
Requires-Dist: langchain-openai>=0.3.0
Requires-Dist: httpx>=0.27.0
Requires-Dist: python-dotenv>=1.2.3
Requires-Python: >=3.14
Description-Content-Type: text/markdown

# tato_code

CLI coding agent that runs against a hosted proxy (see
[`tato-code-backend/`](tato-code-backend)). The CLI only needs the
proxy URL and a shared token — real LLM and Tavily API keys live on the
server.

## Setup

```bash
# 1. Install
pip install -e .

# 2. Configure (one-time)
cp .env.example .env
# Edit .env and set:
#   TATO_PROXY_URL   = https://your-service.onrender.com
#   TATO_PROXY_TOKEN = the same PROXY_TOKEN you set on the server

# 3. Run
tato
```

## Architecture

```
┌────────────┐   bearer (TATO_PROXY_TOKEN)   ┌──────────────────────┐
│  tato CLI  │ ───────────────────────────▶ │ tato-code-backend    │
│  (user)    │                               │  (Render, secrets)   │
└────────────┘                               │   ├─ /v1/chat/...    │ ─▶ OpenRouter
                                             │   ├─ /tools/web_...  │ ─▶ Tavily
                                             │   └─ /tools/fetch_.. │ ─▶ Tavily
                                             └──────────────────────┘
```

The CLI uses `langchain_openai.ChatOpenAI` pointed at the proxy's
`/v1` base URL, and the `@tool` wrappers in `src/tato_code/tools/tools.py`
POST to `/tools/web_search` and `/tools/fetch_url`. From the CLI's
perspective, OpenRouter and Tavily are just an OpenAI-compatible
endpoint and a couple of HTTP routes.

## Why a proxy?

Distributing the CLI as a package would otherwise mean shipping the
real `OPENROUTER_API_KEY` and `TAVILY_API_KEY` to every user. The proxy
keeps both keys on the server and gives the CLI a single, token-gated
endpoint to talk to.

## Configuration reference

| Env var            | Required | Notes                                              |
|--------------------|----------|----------------------------------------------------|
| `TATO_PROXY_URL`   | yes      | Base URL of the backend, no trailing slash.        |
| `TATO_PROXY_TOKEN` | yes      | Shared bearer token. Must match the server.        |

See [`tato-code-backend/README.md`](tato-code-backend/README.md) for
the server-side setup and Render deployment steps.
