Add scripts/create-pr.sh to open PRs from the terminal#8
Conversation
| fi | ||
|
|
||
| TITLE=$(head -1 "$DESC_FILE" | sed 's/^## //') | ||
| BODY=$(cat "$DESC_FILE") |
There was a problem hiding this comment.
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.
| exit 1 | ||
| fi | ||
|
|
||
| if ! command -v gh &>/dev/null; then |
There was a problem hiding this comment.
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; thenThis redirects stdout only during the check, so your error message can still print to stderr.
There was a problem hiding this comment.
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.
|
Minor (worth addressing):
Cost: $0.11 |
Add scripts/create-pr.sh to open PRs from the terminal
Closes the gap between
/pr-descriptiongeneratingdocs/pr-description.mdand 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 whereghisn't authenticated. A host-side shell script runs whereghis installed and auth persists.Fails loudly on missing dependencies. Exits with a clear message if
docs/pr-description.mddoesn't exist orghisn't installed, rather than producing a confusing error.What's next
Run
chmod +x scripts/create-pr.shonce, optionally add the alias from the file header, thencreate-prfrom any branch with a generated description.