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:
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
The
github-clifeature documents anextensionsoption, but its installer only clones the extension repository. This does not work forgithub/gh-aw, which requires a compiled release binary.Reproduction
Using
github-cli:1.1.1:After creating the container:
Expected:
Actual:
The directory exists, but contains a source checkout without the root
gh-awexecutable.gh extension listreportsgithub/gh-aw, so the installation appears successful even though execution fails.Root Cause
The
install-extensions.shscript clones extension repositories directly instead of using the documented installation command:This leaves binary-only extensions such as
github/gh-awwithout an executable. See the implementation here:features/src/github-cli/scripts/install-extensions.sh
Lines 19 to 34 in 8b03a98
Suggested Fix
Install each configured extension with the GitHub CLI command instead of cloning its repository:
Workaround
Install
gh-awseparately after the feature:This was verified successfully with:
References