Skip to content

Instantly share code, notes, and snippets.

@lmmx
Last active October 27, 2025 15:51
Show Gist options
  • Save lmmx/4465156432b1f424887e08dc4abf09b7 to your computer and use it in GitHub Desktop.
Save lmmx/4465156432b1f424887e08dc4abf09b7 to your computer and use it in GitHub Desktop.
Use `gh issue` or `gh pr` to edit a PR/issue non-interactively (jump directly to editor, no TUI)
function ghieb() {
[[ $# -eq 0 ]] && echo "Usage: ghieb <issue ID>" && return 1
local tmpfile=$(mktemp)
trap "rm -f $tmpfile" RETURN EXIT
gh issue view $1 --json body -q .body > "$tmpfile" || return 1
$EDITOR "$tmpfile"
gh issue edit $1 --body-file "$tmpfile"
}
ghpreb() {
local tmpfile=$(mktemp)
trap "rm -f $tmpfile" RETURN EXIT
gh pr view --json body -q .body > "$tmpfile" || return 1
$EDITOR "$tmpfile"
gh pr edit --body-file "$tmpfile"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment