Kitten 会话管理
- 作者仓库星标 39
- 作者仓库 awesome-omni-skill
Kitten Terminal Remote Control
Control your Kitty terminal windows directly from the agent. See what's running in every terminal, send commands, and manage windows.
Quick Start: Get Oriented First
Always start with summary to see all your terminals at a glance:
python3 {{skill_dir}}/scripts/kitten_control.py summary
This gives you a complete markdown overview of ALL open terminals showing:
════════════════════════════════════════════════════════════════════════════════
## WINDOW 172 │ 🟡 ACTIVE │ ✅ READY │ 🐚 shell
════════════════════════════════════════════════════════════════════════════════
| Property | Value |
|----------|-------|
| **Window ID** | `172` |
| **Status** | ✅ READY - Can receive commands |
| **Process** | 🐚 shell |
| **CWD** | `/Users/me/workspace/myproject` |
| **Git Branch** | `main` |
| **Session Age** | 2d ago |
**Quick commands:**
- Send text: `send-text -w 172 -e "your command"`
- Send Ctrl+C: `send-key -w 172 ctrl+c`
```last 20 lines of terminal output...```
What Summary Shows You
| Annotation | Meaning |
|---|---|
| ✅ READY | Shell is at prompt, can receive commands |
| ⏳ BUSY | Running a process, may need Ctrl+C first |
| 🐚 shell | Idle shell |
| 🤖 agent | AI agent (codex, claude, etc.) |
| 🔗 ssh | SSH connection (shows target host) |
| 🔨 build | Build process (make, npm, cargo) |
| 🌐 server | Running server |
| 📝 editor | vim, nvim, etc. |
| Git Branch | Current branch in that directory |
| SSH Target | Remote host for SSH sessions |
Summary Options
# Default: 20 lines from each window
python3 {{skill_dir}}/scripts/kitten_control.py summary
# More context: 50 lines per window
python3 {{skill_dir}}/scripts/kitten_control.py summary -n 50
# Just last command output (cleaner)
python3 {{skill_dir}}/scripts/kitten_control.py summary -e last_cmd_output
# Full scrollback (large output)
python3 {{skill_dir}}/scripts/kitten_control.py summary -e all -n 100
Interacting With Windows
Once you've identified a window from the summary, use its Window ID to interact:
Send Commands
# Send a command and press Enter
python3 {{skill_dir}}/scripts/kitten_control.py send-text -w 172 -e "git status"
# Send text without Enter
python3 {{skill_dir}}/scripts/kitten_control.py send-text -w 172 "partial text"
# Send Ctrl+C to interrupt
python3 {{skill_dir}}/scripts/kitten_control.py send-key -w 172 ctrl+c
# Send other keys: escape, enter, tab, up, down, ctrl+d, etc.
python3 {{skill_dir}}/scripts/kitten_control.py send-key -w 172 escape
Read Output
# Get current screen content
python3 {{skill_dir}}/scripts/kitten_control.py get-text -w 172
# Get last command's output (cleanest)
python3 {{skill_dir}}/scripts/kitten_control.py get-text -w 172 -e last_cmd_output
# Get full scrollback
python3 {{skill_dir}}/scripts/kitten_control.py get-text -w 172 -e all
Window Management
# Focus a window
python3 {{skill_dir}}/scripts/kitten_control.py focus -w 172
# Close a window
python3 {{skill_dir}}/scripts/kitten_control.py close -w 172
# Launch new window in specific directory
python3 {{skill_dir}}/scripts/kitten_control.py launch --cwd /path/to/project
# Launch new tab with title
python3 {{skill_dir}}/scripts/kitten_control.py launch --type tab --title "Build"
Common Workflows
Check on a build/process
# 1. Get summary to find the window
python3 {{skill_dir}}/scripts/kitten_control.py summary -n 10
# 2. Found window 236 running a build, get its output
python3 {{skill_dir}}/scripts/kitten_control.py get-text -w 236 -e last_cmd_output
Run a command in an existing shell
# 1. Find a READY shell from summary
python3 {{skill_dir}}/scripts/kitten_control.py summary -n 5
# 2. Window 172 is ✅ READY, send command
python3 {{skill_dir}}/scripts/kitten_control.py send-text -w 172 -e "make test"
# 3. Check the result
python3 {{skill_dir}}/scripts/kitten_control.py get-text -w 172 -e last_cmd_output
Stop a runaway process
# Send Ctrl+C
python3 {{skill_dir}}/scripts/kitten_control.py send-key -w 236 ctrl+c
# Or send SIGINT signal
python3 {{skill_dir}}/scripts/kitten_control.py signal -w 236 SIGINT
Requirements
- Kitty terminal with
allow_remote_control yesin kitty.conf - The
kittencommand in PATH (comes with Kitty)
- 流狐分类
- 通用
- 作者声明 Agent
- 未找到明确声明;不据此推断已兼容或已测试
- 静态检查
- 88 / 100 · 启发式扫描,不代表运行安全
- 作者 / 版本 / 许可
- @diegosouzapw · 未声明 license
- 流狐 Token 估算
- 低消耗
- 流狐接入估算
- 需简单配置
- 是否需要外部 API Key
- 未发现要求
- 检测到的系统要求
- Windows
- 底层运行要求
- 未声明
- 检测到的文件与系统行为
-
- 只读
- Shell 执行
- 检测到的网络行为
- 仅限本地
- 安装命令数
- 无(仅作为资料)
档案由构建时根据 SKILL.md 与安装命令自动衍生,可能与作者实际意图存在差异。
需要注意: 未限定 allowed-tools,默认拥有全部工具权限。
# Read Output
# Get current screen content
python3 {{skill_dir}}/scripts/kitten_control.py get-text -w 172
# Get last command's output (cleanest)
python3 {{skill_dir}}/scripts/kitten_control.py get-text -w 172 -e last_cmd_output
# Get full scrollback
python3 {{skill_dir}}/scripts/kitten_control.py get-text -w 172 -e all Quick Start: Get Oriented First
Always start with summary to see all your terminals at a glance: This gives you a complete markdown overview of ALL open terminals showing:
Common Workflows
Common Workflows
Check on a build/process
Check on a build/process
# Kitten Terminal Remote Control
Control your Kitty terminal windows directly from the agent. See what's running in every terminal, send commands, and manage windows.
## Quick Start: Get Oriented First
**Always start with `summary` to see all your terminals at a glance:**
```bash
python3 {{skill_dir}}/scripts/kitten_control.py summary
```
This gives you a complete markdown overview of ALL open terminals showing:
```
════════════════════════════════════════════════════════════════════════════════
## WINDOW 172 │ 🟡 ACTIVE │ ✅ READY │ 🐚 shell
════════════════════════════════════════════════════════════════════════════════
| Property | Value |
|----------|-------|
| **Window ID** | `172` |
| **Status** | ✅ READY - Can receive commands |
| **Process** | 🐚 shell |
| **CWD** | `/Users/me/workspace/myproject` |
| **Git Branch** | `main` |
| **Session Age** | 2d ago |
**Quick commands:**
- Send text: `send-text -w 172 -e "your command"`
- Send Ctrl+C: `send-key -w 172 ctrl+c`
```last 20 lines of terminal output...```
```
### What Summary Shows You
| Annotation | Meaning |
|------------|---------|
| **✅ READY** | Shell is at prompt, can receive commands |
| **⏳ BUSY** | Running a process, may need Ctrl+C first |
| **🐚 shell** | Idle shell |
| **🤖 agent** | AI agent (codex, claude, etc.) |
| **🔗 ssh** | SSH connection (shows target host) |
| **🔨 build** | Build process (make, npm, cargo) |
| **🌐 server** | Running server |
| **📝 editor** | vim, nvim, etc. |
| **Git Branch** | Current branch in that directory |
| **SSH Target** | Remote host for SSH sessions |
### Summary Options
```bash
# Default: 20 lines from each window
python3 {{skill_dir}}/scripts/kitten_control.py summary
# More context: 50 lines per window
… 证据边界与执行链路
作者原文负责流程事实;流狐只索引当前章节、要点、文件与命令。
章节 -> Quick Start: Get Oriented First → WINDOW 172 │ 🟡 ACTIVE │ ✅ READY │ 🐚 shell → What Summary Shows You → Summary Options → Interacting With Windows → Send Commands
要点 -> Always start with summary to see all your terminals at a glance · Window ID · Status · Process · CWD · Git Branch · Session Age · Quick commands
文件/命令 -> summary · 172 · /Users/me/workspace/myproject · main · send-text -w 172 -e "your command" · send-key -w 172 ctrl+c · last 20 lines of terminal output... · allowremotecontrol yes
内容 SHA-256 -> 168d804174d3
方法与流程
适用与边界
原文中的明确线索
summary、172、/Users/me/workspace/myproject、main、send-text -w 172 -e "your command"、send-key -w 172 ctrl+c、last 20 lines of terminal output...、allowremotecontrol yes