hive.terminal-tools-foundations
为安全可靠地远程执行命令与管理长跑任务提供统一模式。
执行任意 shell 命令具有高风险,需注意权限控制与命令审查
介绍与代理可用的前后台终端执行、作业与输出封装的标准契约与使用模式。
把终端执行、后台作业和输出读取的约定讲清楚:terminal_exec 的前台/后台差别(超时后自动后台)、如何用 terminal_job_logs 轮询 job_id、以及输出信封(exit_code、stdout、output_handle)和分页取回方式。适合每次要用 shell_* 系列工具、做长时间命令或持久 PTY 操作前先看一遍。特别提醒哪些命令具有破坏性、优先用高层文件工具,以及 macOS 上 bash 的兼容策略。
▸ 展开 SKILL.md 英文原文
Required reading whenever any shell_* tool is available. Teaches the foreground/background dichotomy (terminal_exec auto-promotes past 30s, returns a job_id you poll with terminal_job_logs), the standard envelope shape (exit_code, stdout, stdout_truncated_bytes, output_handle, semantic_status, warning, auto_backgrounded, job_id), output handle pagination via terminal_output_get, when to read semantic_status instead of raw exit_code (grep/rg/find/diff/test exit 1 is NOT an error), the destructive-warning surface (rm -rf, git push --force, DROP TABLE), tool preference (use files-tools / gcu-tools / hive_tools before raw shell), and the bash-only-on-macOS policy. Skipping this leads to "tool returned no output" surprises, orphaned jobs, and panic over benign grep exit codes.
帮我安装这个 skill:https://raw.githubusercontent.com/aden-hive/hive/main/core/framework/skills/_preset_skills/terminal-tools-foundations/SKILL.mdcurl -fsSL "https://raw.githubusercontent.com/aden-hive/hive/main/core/framework/skills/_preset_skills/terminal-tools-foundations/SKILL.md"# terminal-tools — foundations
These tools give you a real terminal: foreground exec with smart envelopes, background jobs with offset-based log streaming, persistent PTY shells, and filesystem search. Bash-only on POSIX.
## Tool preference (read first)
Before reaching for terminal-tools, check whether a higher-level tool already covers the task. Shell is for system operations the other servers don't reach.
- **Reading files** → `files-tools.read_file` (handles size, paging, line-numbered output) — NOT `terminal_exec("cat ...")`
- **Editing files** → `files-tools.edit_file` (atomic patch with diff verification) — NOT `terminal_exec("sed -i ...")`
- **Writing files** → `files-tools.write_