Problem
PARSEC_GITHUB_TOKEN is a single env var — it can't distinguish between hosts. When working across github.com (personal) and GitHub Enterprise (work), the wrong token gets used → 401.
Solution
Add per-host token config in parsec config:
[github."github.com"]
token = "ghp_personal_xxx"
[github."github.daumkakao.com"]
token = "ghp_work_yyy"
Token resolution priority:
config.github.<remote_host>.token — host-specific config
PARSEC_GITHUB_TOKEN env var — explicit override
GITHUB_TOKEN / GH_TOKEN — generic fallback
gh auth token --hostname <host> — CLI fallback
Implementation
- Parse remote URL to detect host (already done via
GitHubRemote)
- Pass host to
resolve_github_token(host)
- Add
GithubHostConfig struct with token field
- Add
github: HashMap<String, GithubHostConfig> to ParsecConfig
- Update
config show to display configured hosts (mask tokens)
Related
Problem
PARSEC_GITHUB_TOKENis a single env var — it can't distinguish between hosts. When working across github.com (personal) and GitHub Enterprise (work), the wrong token gets used → 401.Solution
Add per-host token config in parsec config:
Token resolution priority:
config.github.<remote_host>.token— host-specific configPARSEC_GITHUB_TOKENenv var — explicit overrideGITHUB_TOKEN/GH_TOKEN— generic fallbackgh auth token --hostname <host>— CLI fallbackImplementation
GitHubRemote)resolve_github_token(host)GithubHostConfigstruct withtokenfieldgithub: HashMap<String, GithubHostConfig>toParsecConfigconfig showto display configured hosts (mask tokens)Related
gh auth tokenfallback but without hostname