Skip to content

gh skill ignores PI_CODING_AGENT_DIR for Pi user-scope skills #14118

Closed

Description

@gh-liu

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.0

The 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

  1. Set a custom Pi agent directory:

    export PI_CODING_AGENT_DIR="$HOME/.config/pi/agent"
  2. Install a user-scoped skill for Pi:

    gh skill install github/awesome-copilot gh-cli \
      --agent pi --scope user
  3. Inspect the resolved installation:

    gh skill list --agent pi --scope user \
      --json skillName,path
  4. 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

  1. cli-triage commented on Aug 10, 2026

    @cli-triage

    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 bug and priority-3 labels: this looks like a genuine bug where PI_CODING_AGENT_DIR is ignored for Pi user-scope skill resolution (unlike the analogous CLAUDE_CONFIG_DIR support added for Claude Code in #13523), and it's priority-3 since a --dir workaround 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 for gh skill install/list/update.

    Generated by Issue Triage (skills-driven) for #14118 · auto · 21.5 AIC · ⌖ 1.55 AIC · ⊞ 9.3K · ◷

  2. github-actions commented on Aug 10, 2026

    @github-actions
    Contributor

    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 wanted Contributions 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.

  3. babakks commented on Aug 10, 2026

    @babakks
    Member
  4. rakthainet-DKH commented on Aug 11, 2026

    @rakthainet-DKH
  5. rakthainet-DKH commented on Aug 11, 2026

    @rakthainet-DKH
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementa request to improve CLIgh-skillrelating to the gh skill command

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions