一键导入
tmux
Remote control tmux sessions for interactive CLIs, background tasks, and services.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Remote control tmux sessions for interactive CLIs, background tasks, and services.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Web search, online search, real-time search, internet search, Google alternative, Bing alternative, DuckDuckGo alternative, search the web, lookup online, find information, research,查询,搜索,搜索结果,网页搜索,联网搜索,实时搜索,网络查询,资料查找,信息检索,最新资讯,新闻搜索, Tavily Search API for optimized, real-time web search results for RAG. A pre-configured, cost-effective search tool.
在 macOS 上使用 osascript 执行 AppleScript 或 JavaScript for Automation (JXA) 实现系统自动化。当用户需要控制 macOS 应用(Finder、Safari、Mail、Calendar、Keynote、Numbers、Pages 等)、操作系统 UI、显示对话框/通知、读写剪贴板、自动化重复任务、或任何涉及 osascript/AppleScript/JXA 的需求时,必须使用本技能。即使用户只说"帮我自动化这个"或"在 Mac 上操作 XXX",也应优先考虑本技能。
Model configuration editor for ~/.pi/agent/models.json - 使用 Bun 脚本管理模型配置
读取和写入输出风格目录的工具技能。当用户需要:(1)读取输出风格文件,(2)写入/创建输出风格文件,(3)管理输出风格目录,(4)解析风格文件格式时使用。
Best practices for writing and maintaining high-quality role memories.
Periodic maintenance of role memory: dedup, tidy, consolidate, and pending management.
| name | tmux |
| description | Remote control tmux sessions for interactive CLIs, background tasks, and services. |
| license | MIT |
Socket: /tmp/pi-tmux-sockets/pi.sock (private, no conflicts with personal tmux)
Session Naming: pi-{category}-{name}-{timestamp}
task (temporary), service (long-running), agent (agent-specific)Session States: running | idle | exited
Persistence: /tmp/pi-tmux-sessions.json
Auto-cleanup: Inactive sessions > 24h removed (configurable)
bun ~/.pi/agent/skills/tmux/lib.ts <command>
create <name> <command> [category] # Create session, prints monitoring command
list [filter] # List sessions with status
status <id> # Session details
send <id> <keys> # Send keystrokes (literal mode, safe)
capture <id> [lines] # Capture pane output (default: 200)
kill <id> # Terminate session
cleanup [hours] # Remove old sessions (default: 24h)
attach <id> # Print attach command
sync # Sync session state with tmux
TUI: bun ~/.pi/agent/skills/tmux/tui.ts (visual management, shortcuts: r/n/c/s/a/k/q)
import { TmuxManager } from "~/.pi/agent/skills/tmux/lib.ts";
const tmux = new TmuxManager({ autoCleanup: false }); // optional config
// Session lifecycle
const session = await tmux.createSession(name, command, category);
await tmux.killSession(session.id);
// Output handling
const output = await tmux.capturePane(target, lines);
const success = await tmux.waitForText(target, pattern, { timeout: 60 });
// State management
const sessions = await tmux.listSessions(filter);
const status = await tmux.getSessionStatus(id);
await tmux.sync();
await tmux.cleanup(hours);
Always print monitoring command after session creation:
tmux -S /tmp/pi-tmux-sockets/pi.sock attach -t {session-id}
Use send for interactive tools (Python REPL, gdb, databases):
# Python REPL: always use PYTHON_BASIC_REPL=1
bun ~/.pi/agent/skills/tmux/lib.ts create python "PYTHON_BASIC_REPL=1 python3 -q" task
bun ~/.pi/agent/skills/tmux/lib.ts send pi-task-python-* "print('Hello')"
Category selection:
task: compilation, testing, temporary operationsservice: dev servers, databases, persistent servicesagent: training, data processing, agent-specific tasksSafe key injection: send uses literal mode (-l), no shell escaping needed
Session recovery: Run sync if session not found
# Wait for text pattern with timeout
./scripts/wait-for-text.sh -t session:0.0 -p 'pattern' [-F] [-T 20] [-i 0.5] [-l 2000]
# List sessions with metadata
./scripts/find-sessions.sh -S "$SOCKET"
./scripts/find-sessions.sh --all