From doc-tools
Prints iTerm2 terminal output to network printers, creates PDFs from session output, and provides workarounds for HP LaserJet AirPrint blank page issues.
How this skill is triggered — by the user, by Claude, or both
Slash command
/doc-tools:terminal-printThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Print terminal output from iTerm2 to your HP network printer with a single command.
Print terminal output from iTerm2 to your HP network printer with a single command.
Self-Evolving Skill: This skill improves through use. If instructions are wrong, parameters drifted, or a workaround was needed — fix this file immediately, don't defer. Only update for real, reproducible issues.
Use this skill when:
Clipboard → Strip ANSI → Markdown code block → pandoc/xelatex → PDF → Preview → Print
/usr/bin/env bash << 'PRINT_EOF'
SKILL_DIR="${CLAUDE_PLUGIN_ROOT:-$HOME/.claude/plugins/marketplaces/cc-skills/plugins/doc-tools}/skills/terminal-print"
bash "$SKILL_DIR/assets/print-terminal.sh"
PRINT_EOF
Run with arguments by modifying the execution block:
/usr/bin/env bash << 'PRINT_EOF'
SKILL_DIR="${CLAUDE_PLUGIN_ROOT:-$HOME/.claude/plugins/marketplaces/cc-skills/plugins/doc-tools}/skills/terminal-print"
bash "$SKILL_DIR/assets/print-terminal.sh" --no-preview
PRINT_EOF
| Flag | Description |
|---|---|
--file FILE | Read from file instead of clipboard |
--no-preview | Skip PDF preview, print directly |
--no-print | Generate PDF only, don't send to printer |
--printer NAME | Override target printer queue (default: system default) |
--bypass-airprint | Use socket-9100 + PostScript queue. Workaround for HP LaserJet Pro MFP 3101/3108/3201/3208/3301/3308 AirPrint blank pages. |
-h, --help | Show help message |
# Copy terminal output in iTerm2, then:
/usr/bin/env bash << 'EOF'
bash "${CLAUDE_PLUGIN_ROOT}/skills/terminal-print/assets/print-terminal.sh"
EOF
/usr/bin/env bash << 'EOF'
bash "${CLAUDE_PLUGIN_ROOT}/skills/terminal-print/assets/print-terminal.sh" --file ~/session.log
EOF
/usr/bin/env bash << 'EOF'
bash "${CLAUDE_PLUGIN_ROOT}/skills/terminal-print/assets/print-terminal.sh" --no-print
EOF
All dependencies are already available on macOS with MacTeX:
| Tool | Purpose | Status |
|---|---|---|
pandoc | Markdown to PDF | Required |
xelatex | PDF engine | Required (MacTeX) |
pbpaste | Clipboard access | Built-in |
lpr | CUPS printing | Built-in |
/tmp/terminal-output-YYYYMMDD_HHMMSS.pdf/tmp/terminal-YYYYMMDD_HHMMSS.md/tmp periodicallyCopy terminal output first using Cmd+C in iTerm2.
Install MacTeX: brew install --cask mactex
Check printer status: lpstat -p -d
The script auto-detects the system default printer. Override with --printer NAME or set TERMINAL_PRINT_PRINTER in the environment.
lpr reported success but nothing printed)Strong fingerprint of the HP LaserJet Pro MFP 3101/3108/3201/3208/3301/3308 AirPrint blank-page bug — the printer's IPP-Everywhere PDF interpreter silently drops jobs while CUPS reports completed. Confirmed with this exact symptom on 2026-05-09.
Quick fix:
# 1. One-time setup of bypass queue (socket-9100 + Generic PostScript PPD)
"${CLAUDE_PLUGIN_ROOT}/skills/terminal-print/assets/setup-socket-9100-queue.sh"
# 2. Reprint with --bypass-airprint
bash "${CLAUDE_PLUGIN_ROOT}/skills/terminal-print/assets/print-terminal.sh" --bypass-airprint
Full diagnostic playbook with command sequences and decision tree: see airprint-blank-page-troubleshooting.md.
Key takeaway: do not trust lpstat -o or job-state=completed — query the printer's own job ledger via ipptool -tv ipp://<printer>.local.:631/ipp/print for job-impressions-completed and job-media-sheets-completed. CUPS lies; the printer (mostly) tells the truth.
After this skill completes, check before closing:
Only update if the issue is real and reproducible — not speculative.
npx claudepluginhub terrylica/cc-skills --plugin doc-toolsManage printers via CUPS on macOS (discover, add, print, queue, status, wake).
Converts markdown files to professional PDFs with CJK typography, theme system, and visual verification. Use for creating printable documents, handouts, or mobile-friendly PDFs.
Generates professional PDFs from Markdown using Pandoc/XeLaTeX with automatic section numbering, table of contents, bibliography management, and LaTeX customization.