github-cli-workarounds
Workarounds for shell escaping issues when using the GitHub CLI (`gh`) for creating issues, gists, and pull requests with content containing special…
Skill by ceilidhboy
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/ceilidhboy-github-cli-workarounds
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: writing
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/github-cli-workarounds
What's inside
- Skill name
github-cli-workarounds- Description
- Workarounds for shell escaping issues when using the GitHub CLI (`gh`) for creating issues, gists, and pull requests with content containing special characters like `$`, backticks, or quotes. Use when creating GitHub issues, gists, or pull requests where content contains `$variables`, backtick-enclosed code, or multi-line bodies that cause shell parsing errors.
- License
- MIT
- Instructions
- 102 lines in SKILL.md · view on GitHub
Files (1)
- SKILL.md
SKILL.md (first lines)
# 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. ### For Issues Write the body to a temp file, then use `--body-file`: ```bash body_file=$(mktemp) cat > "$body_file" << 'ISSUEBODY' Content with $variables, `backticks`, and "quotes" works fine here. ISSUEBODY gh issue create --repo owner/repo \ --title "Issue title" \ --body-file "$body_file" \ --label enhancement rm -f "$body_file" ``` **Important:** Use `<< 'EOF'` (single-quoted delimiter) to prevent shell expansion in the heredoc. ### For Gists Write to a temp file, then pipe it: ```bash body_file=$(mktemp) cat > "$body_file" << 'GISTCONTENT' Content with $variables here. GISTCONTENT gh gist create "$body_file" --desc "Description" rm -f "$body_file" ``` ### For Pull Requests Same pattern as issues: ```bash body_file=$(mktemp) cat > "$body_file" << 'PRBODY' PR description with $special chars. PRBODY gh pr create --repo owner/repo \ --title "PR title" \ --body-file "$body_file" rm -f "$body_file" ``` ## Why This Works - The heredoc (`<< 'EOF'`) with a quoted delimiter prevents ALL shell expansion - `--body-file` reads the file directly, bypassing shell parsing entirely - No escaping, no quoting gymnastics, no syntax errors ## Common Pitfall: `\n` in Multi-line Bodies Inside bash single quotes, `\n` is **two literal characters** (backslash + n), not a newline. This means: ```bash # BROKEN — \n is literal text, not a newline ga pr create --body 'line1\nline2' # BROKEN — same issue with ga api -F ga api ... -F body="line1\nline2" # WORKS — heredoc + --body-file (or --field with real newlines) body_file=$(mktemp) cat > "$body_file" << 'BODY' line1 line2 BODY ga pr create --body-file "$body_file" rm -f "$body_file" ``` **Rule of thumb:** Any time your body/description has more than one line, use `--body-file` with a heredoc. Never use `\n` in inline `--body` / `-F` arguments — it will appear literally on GitHub. ## When to Activate This Skill - Creating GitHub issues, gists, or pull requests where the content contains PHP code examples with `$variables`, backtick-enclosed code, or special characters - Any `gh` command where the body/description is longer than a single line or contains syntax examples
From ceilidhboy/skills, MIT.
More from ceilidhboy/skills
- 0.561score
routing-and-controllers
ceilidhboy
Creating or editing a controller, or adding or editing a route in this project.
SkillAFreshness: AClaude Code +9 - 0.561score
action-pattern
ceilidhboy
Creating and using action classes to encapsulate business logic.
SkillAFreshness: AClaude Code +9 - 0.555score
pr-review
ceilidhboy
Review a GitHub pull request by orchestrating reviewer + oracle sub-agents directly from the orchestrating session, consolidating their findings into a single…
SkillAFreshness: AClaude Code +9 - 0.529score
project-bootstrap
ceilidhboy
Use when setting up a new Laravel + Inertia + React project, onboarding a new project to company standards, or told to "apply company tooling" or "standardise…
SkillBFreshness: BClaude Code +9 - 0.529score
pest-testing-conventions
ceilidhboy
Pest 4 testing conventions, workflows, and troubleshooting for Laravel projects.
SkillBFreshness: BClaude Code +9 - 0.529score
formatting-enforcement
ceilidhboy
Retrofit formatting enforcement onto an existing Laravel project that has accumulated drift (badly formatted code committed under an always-green lint CI) or…
SkillBFreshness: BClaude Code +9 - 0.525score
html-output
ceilidhboy
HTML output generator for output that would benefit from being presented in a visually rich document.
SkillBFreshness: BClaude Code +9 - 0.524score
serena-conventions
ceilidhboy
Use when navigating code with Serena tools — finding symbols, reading method bodies, inserting code, or deciding between Serena and context-mode for code tasks.
SkillBFreshness: BClaude Code +9 - 0.521score
bug-fix
ceilidhboy
Activate before creating, modifying, or deleting any production code file.
SkillBFreshness: BClaude Code +9 - 0.520score
adr-creation
ceilidhboy
Creates and maintains dual-format ADRs — Markdown (source of truth for agents) and HTML (rich explainer for humans with diagrams).
SkillBFreshness: BClaude Code +9 - 0.474score
settings-system
ceilidhboy
Multi-tenant polymorphic settings system with agency-scoped records and global fallback chain.
SkillCFreshness: CClaude Code +9 - 0.474score
creating-pull-requests
ceilidhboy
Company pull request workflow and branch policy.
SkillCFreshness: CClaude Code +9
Signals
- Stars
- 0
- Forks
- 0
- Open issues
- 0
- Last commit (this folder)
- Aug 18, 2026 (2 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- Repository
- github.com/ceilidhboy/skills
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from ceilidhboy
- 0.561score
action-pattern
ceilidhboy
Creating and using action classes to encapsulate business logic.
SkillAFreshness: AClaude Code +9 - 0.561score
routing-and-controllers
ceilidhboy
Creating or editing a controller, or adding or editing a route in this project.
SkillAFreshness: AClaude Code +9 - 0.555score
pr-review
ceilidhboy
Review a GitHub pull request by orchestrating reviewer + oracle sub-agents directly from the orchestrating session, consolidating their findings into a single…
SkillAFreshness: AClaude Code +9 - 0.529score
formatting-enforcement
ceilidhboy
Retrofit formatting enforcement onto an existing Laravel project that has accumulated drift (badly formatted code committed under an always-green lint CI) or…
SkillBFreshness: BClaude Code +9 - 0.529score
pest-testing-conventions
ceilidhboy
Pest 4 testing conventions, workflows, and troubleshooting for Laravel projects.
SkillBFreshness: BClaude Code +9 - 0.529score
project-bootstrap
ceilidhboy
Use when setting up a new Laravel + Inertia + React project, onboarding a new project to company standards, or told to "apply company tooling" or "standardise…
SkillBFreshness: BClaude Code +9
Cite this page
github-cli-workarounds skill. Agent Mart. https://agentmart.dev/skills/ceilidhboy-github-cli-workarounds (last updated 2026-10-24)