CLI output formatting standards for worktrunk. Use when writing user-facing messages, error handling, progress output, hints, warnings, or working with the output system.
Worktrunk uses split file-based directive passing for shell integration:
mktemp (cd and exec)WORKTRUNK_DIRECTIVE_CD_FILE and WORKTRUNK_DIRECTIVE_EXEC_FILE--execute)cd -- "$(< file)" (no shell parsing)When neither directive env var is set (direct binary call), commands execute directly and shell integration hints are shown.
The output system handles shell integration automatically. Just call output functions — they do the right thing regardless of whether shell integration is active.
// NEVER DO THIS - don't check mode in command code
if is_shell_integration_active() {
// different behavior
}
// ALWAYS DO THIS - just call output functions
eprintln!("{}", success_message("Created worktree"));