Skip to content

Add scripts/create-pr.sh to open PRs from the terminal#8

Merged
podmar merged 3 commits into
mainfrom
feat/create-pr-script
Jun 3, 2026
Merged

Add scripts/create-pr.sh to open PRs from the terminal#8
podmar merged 3 commits into
mainfrom
feat/create-pr-script

Conversation

@podmar

@podmar podmar commented Jun 3, 2026

Copy link
Copy Markdown
Owner

Add scripts/create-pr.sh to open PRs from the terminal

Closes the gap between /pr-description generating docs/pr-description.md and actually opening the PR — without leaving the terminal or copy-pasting into GitHub.

Decisions worth noting

Shell script over a Claude command. A .claude/commands/ command runs inside the Vibepod container where gh isn't authenticated. A host-side shell script runs where gh is installed and auth persists.

Fails loudly on missing dependencies. Exits with a clear message if docs/pr-description.md doesn't exist or gh isn't installed, rather than producing a confusing error.

What's next

Run chmod +x scripts/create-pr.sh once, optionally add the alias from the file header, then create-pr from any branch with a generated description.

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean helper script — well-structured and documented. Found two minor issues around output redirection and potential title duplication, but nothing critical.

Comment thread scripts/create-pr.sh Outdated
fi

TITLE=$(head -1 "$DESC_FILE" | sed 's/^## //')
BODY=$(cat "$DESC_FILE")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor: Title appears twice in the PR

Line 22 extracts the title from the first line, but line 23 includes the entire file (including that first line) in the body. This means the PR will show the title both as the PR title and again at the start of the description.

If you want to avoid duplication, you could skip the first line in the body:

BODY=$(tail -n +2 "$DESC_FILE")

Or keep it as-is if you prefer the PR body to be self-contained. Both approaches are valid — just worth being aware of the tradeoff.

Comment thread scripts/create-pr.sh Outdated
exit 1
fi

if ! command -v gh &>/dev/null; then

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor: Error message redirection

The &>/dev/null redirects both stdout and stderr to /dev/null, which means the error message on line 18 will never appear if gh is missing — command -v fails silently.

The fix is simple:

if ! command -v gh >/dev/null 2>&1; then

This redirects stdout only during the check, so your error message can still print to stderr.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the &>/dev/null only suppresses output
from command -v gh itself, not from the echo on the next line. The error
message would print either way.

That said, >/dev/null 2>&1 is the POSIX-portable form and more
conventional.

@claude

claude Bot commented Jun 3, 2026

Copy link
Copy Markdown

Minor (worth addressing):

  • Error message on line 18 won't display because &>/dev/null suppresses it — use >/dev/null 2>&1 instead
  • Title from line 1 of pr-description.md will appear twice (once as PR title, once at the start of the body) — consider tail -n +2 for the body if you want to avoid duplication

Cost: $0.11

@podmar
podmar merged commit 3c8cd58 into main Jun 3, 2026
@podmar
podmar deleted the feat/create-pr-script branch June 3, 2026 11:35
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