Metadata-Version: 2.4
Name: sshi-py
Version: 0.2.0
Summary: Python 3 async client & AI agent SDK for sshx.io collaborative terminals
Author: Fire162
Project-URL: Homepage, https://github.com/Fire162/sshi
Project-URL: Repository, https://github.com/Fire162/sshi
Keywords: sshx,terminal,ai-agent,collaboration,pty,e2ee
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: OS Independent
Classifier: Topic :: Terminals
Classifier: Topic :: System :: Networking
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: argon2-cffi>=23.1.0
Requires-Dist: cryptography>=41.0.0
Requires-Dist: cbor2>=5.5.0
Requires-Dist: websockets>=12.0

# sshi-py (Python SDK & Agent Client)

> Async Python 3 client and AI Agent SDK for [sshx.io](https://sshx.io) collaborative terminals.

---

## Installation

```bash
pip install sshi-py
```

Or install from source:

```bash
git clone https://github.com/Fire162/sshi.git
cd sshi/python && pip install .
```

---

## Python Async API (For AI Agents)

Connect to any live `sshx` terminal session using async context managers:

```python
import asyncio
from sshi import SSHISession

async def main():
    target = "https://sshx.io/s/hr2hQ8YKuf#lFRwv8c7cZhJRd"

    async with SSHISession(target, name="ai-assistant") as session:
        # Run command and get output
        output = await session.run("uname -a && uptime")
        print("Command output:\n", output)

        # Inspect participants
        for user in session.users:
            print(f"User: {user.name} (can_write={user.can_write})")

        # Broadcast a chat message to everyone in the room
        await session.chat("Hello from Python AI agent!")

asyncio.run(main())
```

---

## Python CLI Usage

```bash
# Run command remotely
sshi-py run "hr2hQ8YKuf#lFRwv8c7cZhJRd" "python3 -c 'print(1337 * 2)'"

# Inspect session in JSON
sshi-py info "hr2hQ8YKuf#lFRwv8c7cZhJRd" --json

# Broadcast chat message
sshi-py chat "hr2hQ8YKuf#lFRwv8c7cZhJRd" "Hello room!"
```
