Skip to content

docs(plan-issue-mode): show how to capture a created issue number (avoid invalid -q on gh issue create) - #127

Merged
atomantic merged 1 commit into
mainfrom
docs/capture-created-issue-number
Jul 24, 2026
Merged

docs(plan-issue-mode): show how to capture a created issue number (avoid invalid -q on gh issue create)#127
atomantic merged 1 commit into
mainfrom
docs/capture-created-issue-number

Conversation

@atomantic

Copy link
Copy Markdown
Owner

Summary

lib/plan-issue-mode.md tells consumers to "capture the issue numbers (created and reused) for the command's final summary" but never shows how — and gh issue create / glab issue create print the new issue's URL, not JSON. That gap leads to reaching for -q .number / --jq (as if it were a --json command), which errors and, inside a $(…) capture, can abort the create entirely (gh exits non-zero and takes any || fallback with it).

This adds the correct idiom right next to that instruction:

URL="$(gh issue create --title "<Title>" --body-file "$BODY" <label flags>)"
NUM="${URL##*/}"   # https://…/issues/123 -> 123

plus a nudge toward --body-file for multi-line bodies (backticks / $(…) in an inline --body get mangled or executed by the shell). Applies to both gh and glab (both print a URL). Docs-only; no command behavior changes.

Test plan

  • Docs-only change to lib/plan-issue-mode.md; no scripts or command logic touched.
  • Verified the idiom against real gh issue create output (URL form https://github.com/<owner>/<repo>/issues/<n>; ${URL##*/} yields <n>).

gh/glab issue create prints the new issue's URL, not JSON — so appending
-q .number / --jq errors and can abort the create inside a $(…) capture. Add
the URL-parsing idiom (URL=$(gh issue create …); NUM=${URL##*/}) next to the
existing 'capture the issue numbers for the summary' instruction, plus a nudge
toward --body-file for multi-line bodies, so consumers (/do:plan-task,
/do:next, /do:replan) don't reach for an invalid -q flag.
@atomantic
atomantic merged commit 1ab5878 into main Jul 24, 2026
4 checks passed
@atomantic
atomantic deleted the docs/capture-created-issue-number branch July 25, 2026 03:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant