Metadata-Version: 2.5
Name: promptli
Version: 0.1.0
Summary: Python SDK and CLI for Promptli Comms: email, SMS and phone calls for AI agents
Project-URL: Homepage, https://comms.promptli.com
Project-URL: Documentation, https://comms.promptli.com/docs
Project-URL: Repository, https://github.com/promptli-dev/promptli-comms
Project-URL: Issues, https://github.com/promptli-dev/promptli-comms/issues
Author: Promptli
License-Expression: MIT
Keywords: ai-agents,email,llm,sms,telephony,voice
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Communications
Classifier: Typing :: Typed
Requires-Python: >=3.11
Requires-Dist: httpx>=0.27
Requires-Dist: pydantic[email]>=2.7
Requires-Dist: rich>=13
Requires-Dist: typer>=0.15
Requires-Dist: websockets>=13
Provides-Extra: cli
Description-Content-Type: text/markdown

# promptli-comms

SDKs, CLI and the agent-plugin gateway for **Promptli Comms**: email, SMS and phone calls for AI agents.

| Path | What |
|---|---|
| `sdk/python` | `pip install promptli`: async-first client (`AsyncPromptli`) + sync `Promptli`, typed models, webhook verification, Agent Link client, `promptli` CLI |
| `gateway` | `promptli-gateway`: runtime-agnostic plugin core (Agent Link → per-contact agent sessions, setup/bootstrap/doctor, autostart) |
| `spec` | Synced from the server's `contracts/` (OpenAPI, errors, Agent Link protocol, signing vectors); never edit by hand |

## Quick start
```python
from promptli import Promptli

with Promptli() as p:  # PROMPTLI_API_KEY from the environment
    glow = p.identity("glow")
    glow.send_email("jane@example.com", "Your booking", text="Confirmed for 3pm")
    glow.provision_phone_number(region="NY")
    glow.send_text("+15551234567", "Reminder: 3pm tomorrow")
```

```python
import asyncio
from promptli import AsyncPromptli


async def main():
    async with AsyncPromptli() as p:
        async with p.identity("glow").link(instance="laptop") as link:  # outbound WebSocket, no public URL
            async for event in link:
                print(event["type"], event["data"])
                await link.ack(event)


asyncio.run(main())
```

CLI: `promptli login`, `promptli whoami`, `promptli email send -i glow --to jane@example.com --subject Hi --text Hello`,
`promptli text send -i glow --to +15551234567 --text Hi`, `promptli events tail -i glow`, `promptli doctor -i glow`.

Webhooks: `from promptli import verify_webhook` → `verify_webhook(raw_body, headers, "whsec_…")`.

## Development
```bash
uv sync
./scripts/generate_models.sh        # after syncing spec/
uv run pytest                       # unit + conformance
PROMPTLI_API_KEY=psk_test_… PROMPTLI_BASE_URL=http://localhost:8000 uv run pytest -m live tests/live
```
