Skip to content

[github-cli] cannot install binary-only extensions such as github/gh-aw #1710

Description

The github-cli feature documents an extensions option, but its installer only clones the extension repository. This does not work for github/gh-aw, which requires a compiled release binary.

Reproduction

Using github-cli:1.1.1:

"ghcr.io/devcontainers/features/github-cli:1.1.1": {
  "extensions": "github/gh-aw",
  "version": "latest"
}

After creating the container:

gh aw

Expected:

gh-aw starts successfully

Actual:

failed to run extension: fork/exec /home/vscode/.local/share/gh/extensions/gh-aw/gh-aw: no such file or directory

The directory exists, but contains a source checkout without the root gh-aw executable. gh extension list reports github/gh-aw, so the installation appears successful even though execution fails.

Root Cause

The install-extensions.sh script clones extension repositories directly instead of using the documented installation command:

gh extension install github/gh-aw

This leaves binary-only extensions such as github/gh-aw without an executable. See the implementation here:

install_extension() {
local extension="$1"
local extensions_root
local repo_name
extensions_root="${XDG_DATA_HOME:-"${HOME}/.local/share"}/gh/extensions"
repo_name="${extension##*/}"
mkdir -p "${extensions_root}"
if [ ! -d "${extensions_root}/${repo_name}" ]; then
git \
-c credential.helper= \
-c credential.helper='!gh auth git-credential' \
clone --depth 1 "https://github.com/${extension}.git" "${extensions_root}/${repo_name}"
fi
}

Suggested Fix

Install each configured extension with the GitHub CLI command instead of cloning its repository:

gh extension install <extension-name>

Workaround

Install gh-aw separately after the feature:

"postCreateCommand": "curl -fsSL https://raw.githubusercontent.com/github/gh-aw/refs/heads/main/install-gh-aw.sh | bash"

This was verified successfully with:

gh version 2.98.0
gh aw version v0.86.2

References

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions