github-cli-workarounds
Installation
SKILL.md
GitHub CLI Workarounds
The Problem
When using gh issue create --body "..." or gh gist create with inline content, the shell interprets special characters:
$variable— expanded as a shell variable (e.g.,$content,$images)- Backticks
`— interpreted as command substitution - Double quotes — broken nesting with the shell's quoting
This causes Syntax error: word unexpected or truncated content.
The Fix: Always Use Temp Files
Where to write it
Use mktemp — it lands in $XDG_RUNTIME_DIR (the per-user ramdisk, e.g. /run/user/$(id -u): RAM-backed, wiped on logout, mode-700 private) when set, else /tmp. Prefer /tmp deliberately only when the file must outlive the session (e.g. a background job's log — the ramdisk is wiped on logout). Scratch files are transient: delete them after the gh command.