by y49
Terminal Live — monitor and chat with AI coding agents (Claude Code, Codex) from Telegram, Discord & Feishu
# Add to your Claude Code skills
git clone https://github.com/y49/tlivename: tlive description: | IM bridge for AI coding tools — chat with Claude Code / Codex from Telegram, Discord, or Feishu. Approve permissions, get streaming responses, manage sessions from your phone. Use for: starting IM bridge, configuring IM platforms, checking status, diagnosing issues. Trigger phrases: "tlive", "IM bridge", "消息桥接", "手机交互", "启动桥接", "连接飞书", "连接Telegram", "诊断", "查看日志", "配置". Do NOT use for: building bots, webhook integrations, or general coding tasks. argument-hint: "setup | stop | status | logs [N] | reconfigure | doctor" allowed-tools:
You are managing the TLive IM Bridge — bidirectional chat with AI coding tools from Telegram, Discord, or Feishu.
The Bridge uses the Claude Agent SDK (or Codex SDK) to interact with the AI coding tool. It is completely independent from the optional Go Core web terminal server.
User data: ~/.tlive/
| User says (examples) | Subcommand |
|---|---|
| (no args), start, 启动, 启动桥接 | start |
| setup, configure, 配置, 帮我连接 Telegram | setup |
| stop, 停止, 关闭 | stop |
| status, 状态, 运行状态 | status |
| logs, logs 200, 查看日志 | logs |
| reconfigure, 修改配置, 换个 bot, 改 token | reconfigure |
| doctor, diagnose, 诊断, 挂了, 没反应了 | doctor |
| help, 帮助, 怎么用 | help |
Disambiguation: status vs doctor — Use status when the user just wants to check if the bridge is running. Use doctor when the user reports a problem or suspects something is broken. When in doubt and the user describes a symptom (e.g., "没反应了", "挂了"), prefer doctor.
AskUserQuestion available → Claude Code → interactive wizardsetup)Before any command except setup, check ~/.tlive/config.env:
setup wizard. Codex: show ~/.tlive/docs/config.env.example and stop./tlive (no args) or start — Start Bridge1. Check config.env → if missing, auto-start setup
2. Check Bridge PID → if running, show status instead
3. Start Bridge: tlive start (uses TL_RUNTIME from config, default: claude)
4. Wait 2s, verify alive: tlive status
5. Report runtime, channels + web terminal status
setupInteractive wizard. Collect one field at a time, confirm each (mask secrets to last 4 chars).
Before asking for platform credentials, read ~/.tlive/docs/setup-guides.md internally. Only mention the specific next step the user needs — don't dump the full guide. Show the relevant guide section only if the user asks for help.
Step 1 — Choose IM platforms:
AskUserQuestion: "Which IM platforms to enable?
1. Telegram — streaming preview, inline permission buttons
2. Discord — team use, channel-level access control
3. Feishu (飞书) — streaming cards, tool progress
Enter numbers (e.g., 1,3):"
Step 2 — Collect credentials per platform:
Step 3 — General settings:
Step 4 — Write config and validate:
~/.tlive/docs/config.env.example as the template — use its exact variable names (e.g., TL_TG_* for Telegram, TL_DC_* for Discord, TL_FS_* for Feishu). Do NOT invent variable names.mkdir -p ~/.tlive/{data,logs,runtime}~/.tlive/config.env using the template's variable names, then chmod 600~/.tlive/docs/token-validation.md for exact commands per platformreconfigure~/.tlive/config.env~/.tlive/docs/setup-guides.md only if asked)/tlive stop then /tlive start to apply changes."stoptlive stop
statustlive status
logsExtract optional line count N from arguments (default 50).
tlive logs [N]
doctorRun diagnostics and suggest fixes. For complex issues, read ~/.tlive/docs/troubleshooting.md.
tlive doctor
Then validate IM tokens if configured — read ~/.tlive/docs/token-validation.md for commands.
helpShow a clear overview of the TLive system and available commands:
TLive — Three features, use any combination:
In Claude Code (/tlive):
/tlive Start IM Bridge (chat from phone)
/tlive setup Configure IM platforms (AI-guided)
/tlive reconfigure Modify specific config fields
/tlive stop Stop Bridge
/tlive status Show Bridge + Web Terminal + Hooks status
/tlive logs [N] Show last N log lines
/tlive doctor Diagnose issues + suggest fixes
In terminal (tlive):
tlive <cmd> Wrap command with web terminal (e.g. tlive claude)
tlive setup Configure IM platforms (interactive)
tlive install skills Install /tlive skill + hooks to Claude Code
tlive hooks pause Auto-allow permissions, no IM notifications
tlive hooks resume Resume IM approval flow
In IM (from phone):
/new Start new conversation
/model <name> Switch model (e.g. claude-sonnet-4-6)
/runtime claude|codex Switch AI provider
/settings user|full|isolated Claude settings scope
/perm on|off Permission prompts on/off
/effort low|medium|high|max Thinking depth
/stop Interrupt execution
/verbose 0|1 Detail level (quiet/terminal card)
/sessions List recent sessions
/session <n> Switch to session
/hooks pause|resume Toggle hook approval
/status Check status
/help Show commands
tlive <cmd> in a terminal, not by this skill~/.tlive/config.env — shared by both Bridge and Go CoreTerminal Live — monitor and chat with AI coding agents (Claude Code, Codex) from Telegram, Discord & Feishu.
Three features, use any combination:
| Feature | What it does | Access from |
|---------|-------------|-------------|
| Web Terminal | tlive <cmd> — wrap any command with a web-accessible terminal | Browser / Phone |
| IM Bridge | /tlive — chat with Claude Code from your phone | Telegram / Discord / Feishu |
| Hook Approval | Approve Claude Code permissions from your phone | Telegram / Discord / Feishu |
# 1. Install
npm install -g tlive
# 2. Configure your IM platform (interactive wizard)
tlive setup
# 3. Register hooks + Claude Code skill
tlive install skills
# 4. In Claude Code, start the bridge
/tlive
Recommended: Run
/tlive setupinside Claude Code for an AI-guided setup experience that walks you through each step.
Platform setup guides: Telegram · Discord · Feishu · Full Getting Started Guide
Wrap any long-running command. Access from your phone's browser.
tlive claude # Wrap Claude Code
tlive python train.py # Wrap a training script
tlive npm run build # Wrap a build
$ tlive claude --model opus
TLive Web UI:
Local: http://localhost:8080?token=abc123
Network: http://192.168.1.100:8080?token=abc123
Session: claude (ID: a1b2c3)
Multiple sessions in one dashboard. Daemon auto-starts, auto-shuts down after 15 minutes idle.
Chat with Claude Code from your phone. Start new tasks, get streaming responses with real-time tool visibility.
You (Telegram): "Fix the login bug in auth.ts"
TLive: ● Read(auth.ts)
● Grep("validateToken" in src/)
● Edit(auth.ts)
├ Applied
● Bash(npm test)
├ All 42 tests passed
━━━━━━━━━━━━━━━━━━
Fixed the login bug. The token validation
was missing the expiry check...
📊 12.3k/8.1k tok | $0.08 | 2m 34s
Verbose levels: /verbose 0|1 — quiet (final answer only) / terminal card (tool calls + results + response).
Approve Claude Code tool permissions from your phone. Never get blocked by a [y/N] prompt again.
Claude Code runs normally in your terminal (no wrapper needed)
│
├── Claude wants to run a command
│ → Hook fires → Go Core receives → Bridge sends to your phone:
│
│ 🔒 Permission Required
│ Tool: Bash
│ ┌──────────────────────────┐
│ │ rm -rf node_modules && │
│ │ npm install │
│ └──────────────────────────┘
│ [✅ Yes] [✅ Allow Bash(npm *)] [❌ No]
│
├── You tap [Yes] → Claude Code continues
│
└── Walk away. Claude keeps working.
Phone buzzes only when approval needed.
Safe by design:
Pause when you're at your desk:
tlive hooks pause # Auto-allow everything
tlive hooks resume # Back to IM approval
| | Telegram | Discord | Feishu |
|---|----------|---------|--------|
| IM Bridge | ✅ | ✅ | ✅ |
| Hook Approval | ✅ | ✅ | ✅ |
| Streaming responses | Edit-based | Edit-based | CardKit v2 |
| Tool visibility | ✅ | ✅ | ✅ |
| Typing indicator | ✅ | ✅ | — |
| Reactions | ✅ | ✅ | ✅ |
| Permission buttons | Inline keyboard | Button components | Interactive card |
| Text approval (allow/deny) | ✅ | ✅ | ✅ |
| Thread/Topic support | Forum topics | Auto-thread | — |
| Pairing mode | ✅ | — | — |
| Webhook mode | ✅ | — | WebSocket |
| Content redaction | ✅ | ✅ | ✅ |
| Multi-provider (Claude/Codex) | ✅ | ✅ | ✅ |
| Graduated permission buttons | ✅ | ✅ | ✅ |
tlive <cmd> # Web terminal
tlive setup # Configure IM platforms
tlive install skills # Register hooks + Claude Code skill
tlive start # Start Bridge daemon
tlive stop # Stop daemon
tlive status # Check status
tlive logs [N] # Show last N lines of bridge log
tlive doctor # Run diagnostics
tlive hooks # Show hook status
tlive hooks pause # Pause hooks (auto-allow)
tlive hooks resume # Resume hooks (IM approval)
/tlive # Start IM Bridge
/tlive setup # AI-guided configuration
/tlive stop # Stop Bridge
/tlive status # Check status
/tlive doctor # Diagnostics
/model <name> # Switch model (e.g. claude-sonnet-4-6)
/runtime claude|codex # Switch AI provider
/settings user|full|isolated # Claude settings scope
/perm on|off # Permission prompts
/effort low|medium|high|max # Thinking depth
/stop # Interrupt execution
/verbose 0|1 # Detail level
/new # New conversation
/sessions # List sessions
/session <n> # Switch to session
/hooks pause|resume # Toggle hook approval
/approve <code> # Approve Telegram pairing
/pairings # List pending pairings
/help # Show all commands
IM Commands: These slash commands also appear in Telegram's native bot menu automatically.
Single config file ~/.tlive/config.env (created by tlive setup):
TL_PORT=8080
TL_TOKEN=auto-generated
TL_HOST=0.0.0.0
TL_PUBLIC_URL=https://example.com
TL_ENABLED_CHANNELS=telegram,discord
# Telegram
TL_TG_BOT_TOKEN=...
TL_TG_CHAT_ID=...
TL_TG_REQUIRE_MENTION=true # @bot required in groups
TL_TG_DISABLE_LINK_PREVIEW=true # cleaner messages
# Discord
TL_DC_BOT_TOKEN=...
# Proxy (for regions where Telegram/Discord is blocked)
# TL_PROXY=http://127.0.0.1:7890
# Feishu
TL_FS_APP_ID=...
TL_FS_APP_SECRET=...
# Claude Code settings scope (default: user)
# user = auth/model only · full = +CLAUDE.md/MCP/skills · isolated = none
TL_CLAUDE_SETTINGS=user
See config.env.example for all options.
Settings scope: By default, bridge only loads
~/.claude/settings.json(API key, model config). SetTL_CLAUDE_SETTINGS=user,project,localor use/settings fullin chat to also load project CLAUDE.md, MCP servers, and skills.
To access the web terminal from outside your LAN (e.g. via frpc, Cloudflare Tunnel, ngrok):
8080 (or your TL_PORT) through the tunnelTL_PUBLIC_URL to your tunnel domain:
TL_PUBLIC_URL=https://your-domain.com
IM messages will use this URL for web terminal links instead of the LAN IP.Security notes: The tunnel exposes full terminal access. Make sure:
TL_TOKEN is set (auto-generated by tlive setup) — all requests require this bearer tokenTL_TG_ALLOWED_USERS, TL_DC_ALLOWED_USERS, etc.) ┌──────────────────────┐
│ Claude Code (local) │
│ │
│ PreToolUse Hook ────────────┐
│ Notification Hook ──────────┤
└──────────────────────┘ │
▼
┌─ Go Core (tlive) ───────────────────────────────────────────┐
│ │
│ ┌──────────┐ ┌──────────────┐ ┌────────────────────────┐│
│ │ PTY Mgr │ │ Web UI │ │ Hook Manager ││
│ │ (wrap │ │ (dashboard + │ │ (receive hooks, ││
│ │ cmds) │ │ xterm.js) │ │ long-poll, resolve) ││
│ └──────────┘ └──────────────┘ └────────────────────────┘│
│ │
│ HTTP API: /api/status, /api/sessions, │
│ /api/hooks/permission, /api/hooks/pending │
│ WebSocket: /ws/session/:id, /ws/status │
└──────────────────────────┬───────────────────────────────────┘
│ Bridge polls /api/hooks/pending
▼
┌─ Node.js Bridge ────────────────────────────────────────────┐
│ │
│ ┌─────────────┐ ┌──────────────┐ ┌────────────────────┐ │
│ │Claude/Codex │ │ Telegram │ │ Hook Poll │ │
│ │ SDK │ │ Discord │ │ (forward to IM, │ │
│ │ │ │ Feishu │ │ resolve on click) │ │
│ └─────────────┘ └──────────────┘ └────────────────────┘ │
└──────────────────────────────────────────────────────────────┘
│
▼
┌──────────────┐
│ Your Phone │
No comments yet. Be the first to share your thoughts!