Metadata-Version: 2.4
Name: openpa
Version: 0.1.7
Summary: OpenPA — open personal assistant server and CLI
Project-URL: Homepage, https://github.com/openpa/openpa
Project-URL: Issues, https://github.com/openpa/openpa/issues
Author: OpenPA contributors
License: MIT
License-File: LICENSE
Classifier: Environment :: Console
Classifier: Operating System :: MacOS
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Communications :: Chat
Requires-Python: >=3.13.9
Requires-Dist: a2a-sdk[http-server,sql]<1.0,>=0.3.10
Requires-Dist: aiosqlite>=0.21.0
Requires-Dist: alembic>=1.13.0
Requires-Dist: anthropic>=0.52.0
Requires-Dist: asyncpg>=0.29
Requires-Dist: chromadb>=0.5.0
Requires-Dist: dynaconf>=3.2.0
Requires-Dist: fastmcp>=2.12.5
Requires-Dist: google-api-python-client>=2.0.0
Requires-Dist: google-auth>=2.0.0
Requires-Dist: groq>=0.33.0
Requires-Dist: httpx-sse>=0.4
Requires-Dist: httpx[http2]>=0.27
Requires-Dist: jinja2>=3.1.6
Requires-Dist: jsonschema>=4.23.0
Requires-Dist: loguru>=0.7.3
Requires-Dist: markitdown[all]>=0.1.0
Requires-Dist: openai>=2.6.0
Requires-Dist: pandas>=3.0.1
Requires-Dist: playwright>=1.52.0
Requires-Dist: prompt-toolkit>=3.0.47
Requires-Dist: psycopg[binary]>=3.1
Requires-Dist: pydantic>=2.12.3
Requires-Dist: pyjwt>=2.8.0
Requires-Dist: python-dotenv>=1.1.1
Requires-Dist: python-multipart>=0.0.9
Requires-Dist: python-telegram-bot>=21.0
Requires-Dist: pywinpty>=2.0; sys_platform == 'win32'
Requires-Dist: pyyaml>=6.0
Requires-Dist: qdrant-client>=1.9.0
Requires-Dist: qrcode>=7
Requires-Dist: rich>=13
Requires-Dist: sentence-transformers>=3.0.0
Requires-Dist: starlette<1.0,>=0.52.1
Requires-Dist: telethon>=1.36.0
Requires-Dist: tenacity>=8.2.0
Requires-Dist: tiktoken>=0.12.0
Requires-Dist: toml>=0.10.2
Requires-Dist: typer>=0.12
Requires-Dist: uvicorn>=0.41.0
Requires-Dist: watchdog>=4.0.0
Requires-Dist: websockets>=13.0
Provides-Extra: dev
Requires-Dist: autopep8>=2.0.0; extra == 'dev'
Requires-Dist: pre-commit>=3.6.0; extra == 'dev'
Description-Content-Type: text/markdown

# OpenPA

Personal AI Assistant — server + CLI.

## Install

```bash
pip install openpa
```

After install, the `openpa` command is on your PATH. Run `openpa --help` for the
full command tree.

## Run the server

```bash
# Local dev — uses .env / dynaconf settings + SQLite at ~/.openpa/storage/openpa.db
openpa serve

# Bind explicitly
openpa serve --host 0.0.0.0 --port 1112
```

## Use the CLI against a running server

The CLI is configured via environment variables:

| Variable        | Default                  | Purpose                                |
| --------------- | ------------------------ | -------------------------------------- |
| `OPENPA_SERVER` | `http://localhost:1112`  | Server base URL                        |
| `OPENPA_TOKEN`  | (unset)                  | JWT bearer token for the OpenPA server |
| `OPA_OUTPUT`    | `table`                  | `table` or `json` output mode          |
| `OPA_NO_COLOR`  | (unset)                  | When set, disable ANSI colors          |

Obtain a JWT either from `openpa-ui` after first-run setup, or from
`openpa setup complete` (which posts the setup payload and prints a token):

```bash
export OPENPA_SERVER="http://localhost:1112"
export OPENPA_TOKEN="..."

openpa me                       # whoami
openpa tools list               # list registered tools
openpa conv list                # list conversations
openpa chat                     # interactive chat REPL
openpa proc attach <pid>        # attach to a long-running PTY process
```

## Development setup

```bash
# Install everything for local development.
uv sync --all-groups

# Now you can run both the server and the CLI from the project venv:
uv run openpa serve          # in one terminal
uv run openpa me             # in another, after exporting OPENPA_TOKEN
```

## DBeaver SQLite Configuration

In DBeaver, foreign key enforcement is off by default for SQLite. To enable
cascade deletes:

1. Right-click your SQLite connection → **Edit Connection**
2. Go to **Connection Settings** → **Initialization**
3. Add `PRAGMA foreign_keys=ON;` to the **Bootstrap queries** (or "Keep-Alive"
   section depending on your DBeaver version)
4. Reconnect

## Architecture

The CLI lives in [`app/cli/`](app/cli/) and ships in the same wheel as the
server. It communicates with the running server over HTTP / SSE /
WebSocket — there is no in-process backdoor for client commands; only
`openpa serve` imports the server modules directly.

| Layer                    | Path                                              |
| ------------------------ | ------------------------------------------------- |
| typer entry point        | [`app/cli/main.py`](app/cli/main.py)              |
| Subcommands              | [`app/cli/commands/`](app/cli/commands/)          |
| HTTP / SSE / WS clients  | [`app/cli/client/`](app/cli/client/)              |
| Output (rich / TSV / JSON) | [`app/cli/output/`](app/cli/output/)            |
| Streaming pipeline       | [`app/cli/streaming.py`](app/cli/streaming.py)    |
| Chat TUI (prompt_toolkit) | [`app/cli/tui/`](app/cli/tui/)                  |
| Raw TTY + QR helpers     | [`app/cli/io/`](app/cli/io/)                      |
