Repository navigation
gh skill ignores PI_CODING_AGENT_DIR for Pi user-scope skills #14118
Description
Describe the bug
Pi supports overriding its agent directory with the PI_CODING_AGENT_DIR environment variable. gh skill ignores this variable for Pi and always resolves user-scoped skills under ~/.pi/agent/skills.
As a result, skills installed with --agent pi --scope user are not available to Pi when PI_CODING_AGENT_DIR points elsewhere. The same hardcoded resolution is also used by gh skill list and gh skill update.
This is analogous to #13262, where Claude Code's CLAUDE_CONFIG_DIR was ignored and subsequently supported by #13523.
Affected version
$ gh version
gh version 2.95.0
https://github.com/cli/cli/releases/tag/v2.95.0The current trunk implementation also appears affected: Pi's user directory is registered as .pi/agent/skills, while InstallDir only has an environment-variable override for Claude Code.
https://github.com/cli/cli/blob/trunk/internal/skills/registry/registry.go#L282-L286
https://github.com/cli/cli/blob/trunk/internal/skills/registry/registry.go#L405-L426
Steps to reproduce the behavior
-
Set a custom Pi agent directory:
export PI_CODING_AGENT_DIR="$HOME/.config/pi/agent"
-
Install a user-scoped skill for Pi:
gh skill install github/awesome-copilot gh-cli \ --agent pi --scope user
-
Inspect the resolved installation:
gh skill list --agent pi --scope user \ --json skillName,path
-
Observe that the path is under
$HOME/.pi/agent/skills, rather than$PI_CODING_AGENT_DIR/skills.
Expected vs actual behavior
Expected: when PI_CODING_AGENT_DIR is set, Pi user-scope operations resolve the skills directory as:
$PI_CODING_AGENT_DIR/skills
When it is unset, they should retain the existing default:
$HOME/.pi/agent/skills
Actual: PI_CODING_AGENT_DIR is ignored and the default path is always used.
This directory resolution should be shared consistently by gh skill install, gh skill list, and gh skill update, as was done for CLAUDE_CONFIG_DIR in #13523.
Logs
$ printf '%s\n' "$PI_CODING_AGENT_DIR"
/home/liu/tools/dotfiles/xdg_config/pi/agent
$ gh skill list --agent pi --scope user --json skillName,path --jq '.[0]'
{"path":"/home/liu/.pi/agent/skills/agent-browser","skillName":"agent-browser"}
$ gh skill list --dir "$PI_CODING_AGENT_DIR/skills" --json skillName,path --jq '.[0]'
{"path":"/home/liu/tools/dotfiles/xdg_config/pi/agent/skills/agent-browser","skillName":"agent-browser"}The current workaround is to pass --dir "$PI_CODING_AGENT_DIR/skills" explicitly for install, list, and update operations.
Activity
cli-triage commentedon Aug 10, 2026
Caution
agentic threat detected
Threat detection flagged this output in warn mode. Manual review is REQUIRED before any follow-up automation.
Details
Potential security threats were detected in the agent output.
Review the workflow run logs for details.
Thanks for the detailed report and code pointers! I've suggested the
bugandpriority-3labels: this looks like a genuine bug wherePI_CODING_AGENT_DIRis ignored for Pi user-scope skill resolution (unlike the analogousCLAUDE_CONFIG_DIRsupport added for Claude Code in #13523), and it's priority-3 since a--dirworkaround exists. I didn't find an exact duplicate open issue for this specific Pi env var (a related but distinct issue, #13494 about the "universal" agent install path, was already closed). A maintainer should confirm the fix approach forgh skill install/list/update.github-actions commentedon Aug 10, 2026
Thank you for your issue! We have categorized it as an enhancement (feature or improvement) request, and it has been added to our backlog. In doing so, we are not committing to implementing this feature at this time, but, we will consider it for future releases based on community feedback and our own product roadmap.
Unless you see the help wantedContributions welcome
label, we are not currently looking for external contributions for this feature.
If you come across this issue and would like to see it implemented, please add a thumbs up! This will help us prioritize the feature. Please only comment if you have additional information or viewpoints to contribute.
babakks commentedon Aug 10, 2026
cc @tommaso-moro and @SamMorrowDrums
rakthainet-DKH commentedon Aug 11, 2026
rakthainet-DKH commentedon Aug 11, 2026