hive.terminal-tools-foundations

Teaches correct usage of shell terminal tools including envelopes, background jobs, and semantic exit codes.

11.0k|5.7k|Updated Jan 12, 2026
One-click install
npx skills add https://github.com/aden-hive/hive --skill hive-terminal-tools-foundations
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: hive.terminal-tools-foundations
Source: https://github.com/aden-hive/hive/tree/main/core/framework/skills/_preset_skills/terminal-tools-foundations
Command: npx skills add https://github.com/aden-hive/hive --skill hive-terminal-tools-foundations

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Agents using shell tools often misinterpret results: they panic over benign grep exit-1 codes, lose truncated output, orphan long-running background jobs, or write bash idioms that silently break on Windows PowerShell. This Skill provides the foundational mental model for operating terminal tools correctly.

Core Features & Use Cases

  • Standard envelope interpretation: Explains every field returned by terminal_exec (exit_code, stdout, output_handle, semantic_status, warning, auto_backgrounded, job_id, shell_kind) so results are read correctly.
  • Auto-promotion model: Documents how commands exceeding the 30-second budget become background jobs that you poll with terminal_job_logs instead of treating as failures.
  • Semantic exit codes: Clarifies that grep/rg/find/diff/test exit 1 is informational, not an error, and that semantic_status should be checked first.
  • Cross-platform shell guidance: Covers the bash-only-on-POSIX policy and how to adapt commands when shell_kind is powershell or cmd on Windows.
  • Use Case: An agent runs a long build with terminal_exec, receives auto_backgrounded=true with a job_id, polls terminal_job_logs until completion, and paginates truncated output via terminal_output_get without losing data.

Quick Start

Read this skill before using any shell_* or terminal_* tool so you handle envelopes, background jobs, and exit codes correctly.

Frequently Asked Questions about hive.terminal-tools-foundations

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run long-running shell commands with terminal_exec?▼

Just call terminal_exec normally; commands exceeding the 30-second auto-background budget are promoted to background jobs automatically. When the envelope returns auto_backgrounded=true with a job_id, poll with terminal_job_logs using wait_until_exit to block until completion.

Why does grep return exit code 1 and is it an error?▼

Grep exit code 1 means no matches were found, which is not an error. The same applies to find, diff, and test. Always check the envelope's semantic_status field first; it reports "ok" for these informational exit-1 cases.

How do I retrieve truncated command output from terminal_exec?▼

When stdout_truncated_bytes is greater than zero, the full output is stored under output_handle for 5 minutes. Paginate it with terminal_output_get, tracking next_offset across calls until eof is true.

Does terminal_exec use bash or the user's default shell on macOS?▼

On POSIX systems including macOS, terminal_exec always invokes /bin/bash regardless of the user's $SHELL. Explicit zsh requests are rejected for security reasons, and ZDOTDIR and ZSH_* environment variables are stripped before execution.

Why do my bash commands fail on Windows with terminal tools?▼

On Windows the shell resolves to Git Bash, PowerShell, or cmd in priority order, reported in the envelope's shell_kind field. If shell_kind is not bash, avoid coreutils idioms like grep or 2>/dev/null and use portable commands or PowerShell-native syntax.

What does the warning field mean for rm -rf or git push --force?▼

The warning field flags commands matching known destructive patterns like rm -rf, DROP TABLE, or terraform destroy. The command still executed; the warning is informational, prompting you to verify the destructive action was intended before trusting dependent steps.