Problem
parsec ship fails to create the PR when PARSEC_GITHUB_TOKEN / GITHUB_TOKEN / GH_TOKEN env vars are absent, even though gh auth token is available and parsec doctor already accepts gh auth token for the GitHub auth check.
This creates an inconsistency:
| Command |
gh auth token fallback |
parsec doctor (token check) |
✅ accepted |
Tracker fetch (e.g. parsec start, ticket title lookup) |
✅ accepted |
parsec ship (PR creation) |
❌ rejected |
Repro
unset PARSEC_GITHUB_TOKEN GITHUB_TOKEN GH_TOKEN
gh auth status # logged in
parsec start 207 --base develop
# ... do work, commit ...
parsec ship 207 --base develop
# remote: ... (push succeeds)
# note: PR/MR creation skipped — no token found.
# Set PARSEC_GITHUB_TOKEN, PARSEC_BITBUCKET_TOKEN, or PARSEC_GITLAB_TOKEN to enable.
# error: [E012] Ship partial: branch pushed but PR/MR creation failed.
User has to run gh pr create ... manually after the fact. Workflow breaks.
Expected
parsec ship should resolve the GitHub token in the same priority order parsec doctor and the tracker layer use:
PARSEC_GITHUB_TOKEN
GITHUB_TOKEN
GH_TOKEN
gh auth token (shell out to gh auth token and capture stdout)
If all four fail, then surface the current error.
Acceptance
parsec ship succeeds with only gh auth login configured (no env vars set).
- Same fallback order applied to GitLab (
glab auth token) and Bitbucket if applicable — match whatever pattern the doctor / tracker layer already uses.
- Add a unit/integration test for the token resolution helper.
Notes
Problem
parsec shipfails to create the PR whenPARSEC_GITHUB_TOKEN/GITHUB_TOKEN/GH_TOKENenv vars are absent, even thoughgh auth tokenis available andparsec doctoralready acceptsgh auth tokenfor the GitHub auth check.This creates an inconsistency:
parsec doctor(token check)parsec start, ticket title lookup)parsec ship(PR creation)Repro
User has to run
gh pr create ...manually after the fact. Workflow breaks.Expected
parsec shipshould resolve the GitHub token in the same priority orderparsec doctorand the tracker layer use:PARSEC_GITHUB_TOKENGITHUB_TOKENGH_TOKENgh auth token(shell out togh auth tokenand capture stdout)If all four fail, then surface the current error.
Acceptance
parsec shipsucceeds with onlygh auth loginconfigured (no env vars set).glab auth token) and Bitbucket if applicable — match whatever pattern the doctor / tracker layer already uses.Notes
doctoror the tracker layer uses to resolve the token, pointshipat the same helper.src/env.rsandsrc/cli/commands/doctor.rsfor the existing resolution path.