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
-ato append to the log file instead of overwriting.