Client Guides
Artic provides three client interfaces. All are thin presentation layers that communicate exclusively through the Hub SDK (hub/client.py).
TUI (Terminal UI)
The richest client experience. Built with the Textual framework.
Setup
cd clients/tui
pip install textual
python -m tui
Screens
The TUI has 5 screens:
| Screen | Purpose |
|---|---|
| Dashboard | Agent overview, status cards, live P&L |
| CreateAgent | Agent creation form with all config options |
| LogViewer | Real-time log streaming with level filtering |
| Theme | Color theme customization |
| AgentDetail | Deep dive into a single agent's state, trades, and logs |
Key Features
- Live polling: Agent status refreshes every 2 seconds
- All hub calls through HubClient — no raw HTTP in screen code
- Keyboard-first: Full keyboard navigation and shortcuts
CLI
Command-line interface for scripting and automation. Built with Typer.
Setup
cd clients/cli
pip install typer
python -m cli
Commands
# Authentication
artic login --email user@example.com --password secret
artic generate-key
# Agent management
artic agents list
artic agents create --symbol BTC/USDT --strategy momentum_breakout
artic agents stop <agent-id>
artic agents delete <agent-id>
# Monitoring
artic agents status <agent-id>
artic agents logs <agent-id>
# Secrets
artic secrets set OPENAI_API_KEY
artic secrets list
JSON Output
Every command supports --json for machine-readable output:
artic agents list --json | jq '.[] | .symbol'
Conventions
- Every command has
--jsonflag for scripting - No interactive prompts in non-TTY mode
- All calls go through Hub SDK
Telegram Bot
Monitor and control agents from Telegram.
Setup
- Create a bot via @BotFather
- Set
TELEGRAM_BOT_TOKENin your secrets - Run the bot:
cd clients/telegram
python -m telegram
Commands
| Command | Action |
|---|---|
/start | Initialize bot and authenticate |
/agents | List all your agents |
/status <id> | Get agent status and P&L |
/stop <id> | Stop an agent |
/logs <id> | Recent log summary |
Features
- Real-time notifications: Trade events, P&L alerts
- Commands mirror Hub SDK 1:1
- Summarized output — never raw logs (Telegram-formatted)
- Bot token stored in USER_SECRETS — never hardcoded
REST API
For building custom integrations. See Hub API Reference.
Quick Example
import httpx
HUB = "http://localhost:9000"
# Login
resp = httpx.post(f"{HUB}/auth/login", json={
"email": "trader@example.com",
"password": "secret"
})
token = resp.json()["access_token"]
headers = {"Authorization": f"Bearer {token}"}
# List agents
agents = httpx.get(f"{HUB}/api/agents", headers=headers).json()
# Create agent
httpx.post(f"{HUB}/api/agents", headers=headers, json={
"symbol": "ETH/USDT",
"strategy_name": "rsi_signal",
"live_mode": False
})
WebSocket Streaming
import websockets
import asyncio
async def stream():
uri = f"ws://localhost:9000/ws?token={token}"
async with websockets.connect(uri) as ws:
async for message in ws:
print(message) # agent_status, trade, log events
asyncio.run(stream())
