tee

Installation
SKILL.md

tee - Enhanced Output Redirection

The tee module executes a command and writes its output to both stdout and a specified file. Unlike traditional pipes, it preserves the original command's exit code and environment modifications.

When to Activate

  • When logging build, test, or deployment outputs for CI/CD pipelines.
  • When capturing both stdout and stderr while needing to react to command failures.
  • When a command modifies environment variables that need to be maintained.

Core Principles & Rules

  • Exit Code Integrity: Crucial for scripts where the following logic depends on the success of the logged command.
  • Command Separation: Use the -- separator to distinguish between the output file and the command to run.
  • Append Mode: Support for -a to append to the log file instead of overwriting.

Patterns & Examples

Log Build Output

# Capture build logs while ensuring the script stops on failure
Related skills

More from x-cmd/skill

Installs
3
Repository
x-cmd/skill
GitHub Stars
20
First Seen
Apr 10, 2026