Skip to content

gh skill install prints “(could not read directory)” for namespaced skills #14190

Description

@Hiro5409

Describe the bug

gh skill install successfully installs a namespaced skill, but its post-install file tree reports (could not read directory).

Since #13266, skill files have been installed into flat directories using Name (deploy/), while Result.Installed retains the qualified identity (alice/deploy) for the success message. printFileTree in pkg/cmd/skills/install/install.go still joins that identity onto the install directory, so it reads target/alice/deploy instead of the actual target/deploy.

Affected version

gh version 2.96.0 (2026-07-02)
https://github.com/cli/cli/releases/tag/v2.96.0

The mismatch is also present on trunk at 0eeec0b92edbe70199f9768522f831d3534f41ad.

Steps to reproduce

mkdir -p src/skills/alice/deploy
cat >src/skills/alice/deploy/SKILL.md <<'EOF'
---
name: deploy
description: Minimal reproduction for a namespaced skill install.
---
# Deploy
EOF

gh skill install ./src --from-local --all --force --dir target
find target -maxdepth 3 -type f -print

Expected behavior

The file tree shows the actual flat install directory and its contents:

  deploy/
  └── SKILL.md

The qualified identity remains in the success message:

Installed alice/deploy (from ./src) in target

Actual behavior

  alice/deploy/
  (could not read directory)

The install itself succeeds, and the file exists at:

target/deploy/SKILL.md

Suggested fix and regression coverage

Use the flat on-disk directory name when resolving and labeling each file-tree entry, while preserving the qualified identity in the Installed ... line. A minimal fix may be to derive the on-disk name with filepath.Base(filepath.FromSlash(name)) inside printFileTree.

The InstallName comment in internal/skills/discovery/discovery.go still describes the pre-#13266 nested layout and should be corrected alongside this change.

For regression coverage, extend the existing TTY file-tree test pattern in pkg/cmd/skills/install/install_test.go with a namespaced case. The namespaced acceptance test updated in #13365 can also assert the stderr tree, but it requires a live GitHub instance and runs only when explicitly enabled.

Happy to open a focused PR if this direction looks right.

Activity

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

    bugSomething isn't workinggh-skillrelating to the gh skill commandpriority-3Affects a small number of users or is largely cosmetic

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions