什么是 shell-use?
让 agents 像人类一样使用 shell,执行命令、查看输出并完成终端操作。
README
shell-use
Let agents use the shell like a human.
Features
- Interact with any CLI application (vim, htop, gdb, etc.)
- Send special keys (Ctrl+C, Enter, arrow keys, etc.)
- Dockerized for easy deployment
Available Tools
| Tool | Description |
|---|---|
list_sessions() | Returns allowed session names |
capture(session, scroll_back?) | Captures terminal screen text |
send_keys(session, keys) | Sends key input (e.g., Enter, C-c) |
send_text(session, text, enter?) | Sends literal text (enter=True to press Enter) |
scroll(session, direction, amount?) | Scrolls through history |
exit_scroll_mode(session) | Exits copy-mode |
Setup
1. Build the Docker image
docker build -t shell-use:latest .
2. Create a tmux session
tmux new-session -s dev
2.1. Get the tmux socket path
SOCK="$(tmux display-message -p -F '#{socket_path}')"
[ -S "$SOCK" ] || { echo "tmux socket not found: $SOCK"; exit 1; }
3. Configure your MCP client
Claude Code:
claude mcp add shell-use \
-- docker run -i --rm \
-v "$SOCK":/tmux/tmux.sock \
-e SHELL_USE_SOCKET=/tmux/tmux.sock \
-e SHELL_USE_SESSIONS=dev \
shell-use:latest
Claude Desktop (claude_desktop_config.json):
{
"mcpServers": {
"shell-use": {
"command": "docker",
"args": [
"run", "-i", "--rm",
"-v", "/tmp/tmux-1000/default:/tmux/tmux.sock",
"-e", "SHELL_USE_SOCKET=/tmux/tmux.sock",
"-e", "SHELL_USE_SESSIONS=dev",
"shell-use:latest"
]
}
}
}
Replace
/tmp/tmux-1000/defaultwith the path fromtmux display-message -p -F '#{socket_path}'.
Environment Variables
| Variable | Description | Required |
|---|---|---|
SHELL_USE_SESSIONS | Comma-separated list of allowed session names | Yes |
SHELL_USE_SOCKET | Path to tmux socket (default: /tmux/tmux.sock in Docker) | No |
Acknowledgments
Inspired by browser-use.
常见问题
shell-use 是什么?
让 agents 像人类一样使用 shell,执行命令、查看输出并完成终端操作。
相关 Skills
PDF处理
by anthropics
遇到 PDF 读写、文本表格提取、合并拆分、旋转加水印、表单填写或加解密时直接用它,也能提取图片、生成新 PDF,并把扫描件通过 OCR 变成可搜索文档。
✎ PDF杂活别再来回切工具了,文本表格提取、合并拆分到OCR识别一次搞定,连扫描件也能变可搜索。
Word文档
by anthropics
覆盖Word/.docx文档的创建、读取、编辑与重排,适合生成报告、备忘录、信函和模板,也能处理目录、页眉页脚、页码、图片替换、查找替换、修订批注及内容提取整理。
✎ 搞定 .docx 的创建、改写与精排版,目录、批量替换、批注修订和图片更新都能自动化,做正式文档尤其省心。
PPT处理
by anthropics
处理 .pptx 全流程:创建演示文稿、提取和解析幻灯片内容、批量修改现有文件,支持模板套用、合并拆分、备注评论与版式调整。
✎ 涉及PPTX的创建、解析、修改到合并拆分都能一站搞定,连备注、模板和评论也能处理,做演示文稿特别省心。
相关 MCP Server
文件系统
编辑精选by Anthropic
Filesystem 是 MCP 官方参考服务器,让 LLM 安全读写本地文件系统。
✎ 这个服务器解决了让 Claude 直接操作本地文件的痛点,比如自动整理文档或生成代码文件。适合需要自动化文件处理的开发者,但注意它只是参考实现,生产环境需自行加固安全。
by wonderwhy-er
Desktop Commander 是让 AI 直接执行终端命令、管理文件和进程的 MCP 服务器。
✎ 这工具解决了 AI 无法直接操作本地环境的痛点,适合需要自动化脚本调试或文件批量处理的开发者。它能让你用自然语言指挥终端,但权限控制需谨慎,毕竟让 AI 执行 rm -rf 可不是闹着玩的。
EdgarTools
编辑精选by dgunning
EdgarTools 是无需 API 密钥即可解析 SEC EDGAR 财报的开源 Python 库。
✎ 这个工具解决了金融数据获取的痛点——直接让 AI 读取结构化财报,比如让 Claude 分析苹果的 10-K 文件。适合量化分析师或金融开发者快速构建数据管道。但注意,它依赖 SEC 网站稳定性,高峰期可能延迟。