From e7ddbd5b573ea20411f87665fd12078d82db80be Mon Sep 17 00:00:00 2001 From: baxyz Date: Sat, 18 Apr 2026 00:12:03 +0200 Subject: [PATCH 1/6] =?UTF-8?q?feat(github-dev):=20=E2=9C=A8=20add=20GitHu?= =?UTF-8?q?b=20CLI=20and=20VS=20Code=20extensions=20-=20implement=20github?= =?UTF-8?q?-dev=20feature=20with=20CLI=20and=20extensions=20-=20add=20auto?= =?UTF-8?q?-authentication=20script=20for=20gh=20CLI=20-=20update=20essent?= =?UTF-8?q?ial-dev=20description=20for=20clarity=20-=20create=20tests=20fo?= =?UTF-8?q?r=20github-dev=20feature?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/pr-validation.yml | 8 +- .github/workflows/test.yml | 6 + AGENTS.md | 5 +- README.md | 23 +++- src/essential-dev/devcontainer-feature.json | 9 +- src/github-dev/README.md | 96 ++++++++++++++++ src/github-dev/devcontainer-feature.json | 36 ++++++ src/github-dev/gh-auth.sh | 26 +++++ src/github-dev/install.sh | 121 ++++++++++++++++++++ test/github-dev/test.sh | 53 +++++++++ 10 files changed, 367 insertions(+), 16 deletions(-) create mode 100644 src/github-dev/README.md create mode 100644 src/github-dev/devcontainer-feature.json create mode 100644 src/github-dev/gh-auth.sh create mode 100755 src/github-dev/install.sh create mode 100755 test/github-dev/test.sh diff --git a/.github/workflows/pr-validation.yml b/.github/workflows/pr-validation.yml index 2814ee8..3a106f0 100644 --- a/.github/workflows/pr-validation.yml +++ b/.github/workflows/pr-validation.yml @@ -19,9 +19,7 @@ jobs: uses: helpers4/action/conventional-commits@main with: checkout: "true" - scopes: "angular-dev|auto-header|dotfiles-sync|essential-dev|git-absorb|package\ - -auto-install|peon-ping|shell-history-per-project|typescript-dev|vi\ - te-plus|deps|CI-CD" + scopes: "angular-dev|auto-header|dotfiles-sync|essential-dev|git-absorb|github-dev|package-auto-install|peon-ping|shell-history-per-project|typescript-dev|vite-plus|deps|CI-CD" pr-comment: "error" - name: Set status @@ -77,6 +75,10 @@ jobs: baseImage: debian:latest - features: dotfiles-sync baseImage: mcr.microsoft.com/devcontainers/base:ubuntu + - features: github-dev + baseImage: debian:latest + - features: github-dev + baseImage: mcr.microsoft.com/devcontainers/base:ubuntu outputs: status: ${{ steps.status.outputs.status }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f7dd07a..f41a3a2 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -62,6 +62,12 @@ jobs: - features: peon-ping baseImage: mcr.microsoft.com/devcontainers/base:ubuntu + # github-dev - works on any base image + - features: github-dev + baseImage: debian:latest + - features: github-dev + baseImage: mcr.microsoft.com/devcontainers/base:ubuntu + # dotfiles-sync - works on any base image - features: dotfiles-sync baseImage: debian:latest diff --git a/AGENTS.md b/AGENTS.md index 5376c77..4694dc5 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -16,7 +16,7 @@ Follow [Conventional Commits](https://www.conventionalcommits.org/) with a gitmo **Format:** `(): ` -**Scopes:** angular-dev, auto-header, dotfiles-sync, essential-dev, git-absorb, package-auto-install, peon-ping, shell-history-per-project, typescript-dev, vite-plus, CI-CD +**Scopes:** angular-dev, auto-header, dotfiles-sync, essential-dev, git-absorb, github-dev, package-auto-install, peon-ping, shell-history-per-project, typescript-dev, vite-plus, CI-CD | Emoji | Type | Description | |-------|------|-------------| @@ -109,7 +109,8 @@ devcontainer features test . # Test all | Feature | Version | Description | Dependencies | |---------|---------|-------------|--------------| -| essential-dev | 1.0.0 | Git, Copilot, Markdown, editor enhancements | — | +| essential-dev | 1.1.0 | Git visualization, editor enhancements, Markdown | — | +| github-dev | 1.0.0 | GitHub CLI (gh), known_hosts, Copilot, PR & Issues, Actions, RemoteHub | — | | typescript-dev | 1.0.5 | TypeScript/JS dev with import management | essential-dev | | angular-dev | 1.0.2 | Angular dev, port 4200 forwarding | — | | vite-plus | — | Vite development setup | — | diff --git a/README.md b/README.md index 067fd55..d1997f7 100644 --- a/README.md +++ b/README.md @@ -106,11 +106,10 @@ Syncs local Git, SSH, GPG, and npm configuration files into the devcontainer. Wo ### essential-dev -Core development environment with Git integration, GitHub Copilot, Markdown support, and essential editor enhancements. Perfect base for all development projects. +Core development environment with Git visualization, Markdown support, and essential editor enhancements. For GitHub tooling (gh CLI, Copilot, PR & Issues), use `github-dev`. **Key benefits:** -- Git integration with history, graph visualization, and PR support -- GitHub Copilot for AI-powered code assistance +- Git history, graph visualization, and conventional commits support - Complete Markdown support with preview and linting - Multi-cursor, code comparison, and local file history - File format support (YAML, JSON, CSV, XML, Makefile) @@ -118,6 +117,20 @@ Core development environment with Git integration, GitHub Copilot, Markdown supp [📖 Documentation](./src/essential-dev/README.md) +### github-dev + +GitHub CLI (`gh`), `github.com` SSH known_hosts, and GitHub VS Code extensions (Copilot, Copilot Chat, Pull Requests & Issues, GitHub Actions, RemoteHub). + +**Key benefits:** +- `gh` CLI for PRs, issues, releases, Actions runs from the terminal +- `github.com` fingerprints pre-seeded — no first-clone SSH prompt +- GitHub Copilot and Copilot Chat for AI assistance +- Pull Requests & Issues panel inside VS Code +- GitHub Actions workflow editor with validation +- RemoteHub to browse remote repos without cloning + +[📖 Documentation](./src/github-dev/README.md) + ### typescript-dev TypeScript/JavaScript development setup with indexing, import management, HTML/CSS intelligence, and web tools. Built on top of `essential-dev` for Git, Copilot, and editor enhancements. @@ -166,6 +179,7 @@ Features from this repository are available via GitHub Container Registry. Refer { "features": { "ghcr.io/helpers4/devcontainer/essential-dev:1": {}, + "ghcr.io/helpers4/devcontainer/github-dev:1": {}, "ghcr.io/helpers4/devcontainer/vite-plus:1": {}, "ghcr.io/helpers4/devcontainer/package-auto-install:1": {}, "ghcr.io/helpers4/devcontainer/typescript-dev:1": {}, @@ -185,7 +199,8 @@ Features from this repository are available via GitHub Container Registry. Refer | Feature | Description | Documentation | |---------|-------------|---------------| -| [essential-dev](./src/essential-dev) | Core dev environment with Git, Copilot, Markdown, and editor tools | [README](./src/essential-dev/README.md) | +| [essential-dev](./src/essential-dev) | Core dev environment with Git visualization, editor tools, and Markdown | [README](./src/essential-dev/README.md) | +| [github-dev](./src/github-dev) | gh CLI, github.com known_hosts, Copilot, PR & Issues, Actions, RemoteHub | [README](./src/github-dev/README.md) | | [auto-header](./src/auto-header) | Automatic file headers with customizable templates (simple or custom) | [README](./src/auto-header/README.md) | | [vite-plus](./src/vite-plus) | Complete Vite+ toolchain with Oxc, Vitest, and VS Code integration | [README](./src/vite-plus/README.md) | | [package-auto-install](./src/package-auto-install) | Automatic package installation with corepack support for Node 24+ | [README](./src/package-auto-install/README.md) | diff --git a/src/essential-dev/devcontainer-feature.json b/src/essential-dev/devcontainer-feature.json index 81dbe46..641340d 100644 --- a/src/essential-dev/devcontainer-feature.json +++ b/src/essential-dev/devcontainer-feature.json @@ -1,8 +1,8 @@ { "id": "essential-dev", - "version": "1.0.1", + "version": "1.0.2", "name": "Essential Development Environment", - "description": "Core development environment with Git integration, GitHub Copilot, Markdown support, and essential editor enhancements. Perfect base for all development projects.", + "description": "Core development environment with Git visualization, Markdown support, and essential editor enhancements. For GitHub tooling (gh CLI, Copilot, PR & Issues), use github-dev.", "documentationURL": "https://github.com/helpers4/devcontainer/tree/main/features/essential-dev", "customizations": { "vscode": { @@ -11,12 +11,7 @@ "eamodio.gitlens", "donjayamanne.githistory", "gxl.git-graph-3", - "github.vscode-pull-request-github", - "github.vscode-github-actions", "vivaxy.vscode-conventional-commits", - // AI Assistant - "github.copilot", - "github.copilot-chat", // Editor Enhancements "cardinal90.multi-cursor-case-preserve", "moshfeu.compare-folders", diff --git a/src/github-dev/README.md b/src/github-dev/README.md new file mode 100644 index 0000000..a1eabae --- /dev/null +++ b/src/github-dev/README.md @@ -0,0 +1,96 @@ +# GitHub Development Environment (github-dev) + +Installs the **GitHub CLI (`gh`)** and adds the essential GitHub VS Code extensions (Copilot, Copilot Chat, Pull Requests & Issues, GitHub Actions, RemoteHub). Automatically authenticates `gh` if a token is available in the environment. + +## Usage + +```json +{ + "features": { + "ghcr.io/helpers4/devcontainer/github-dev:1": {} + } +} +``` + +Combine with `essential-dev` for a complete development environment: + +```json +{ + "features": { + "ghcr.io/helpers4/devcontainer/essential-dev:1": {}, + "ghcr.io/helpers4/devcontainer/github-dev:1": {} + } +} +``` + +## Options + +| Option | Type | Default | Description | +|--------|------|---------|-------------| +| `ghVersion` | string | `latest` | GitHub CLI version to install (e.g. `2.50.0` or `latest`) | + +## What Gets Installed + +### GitHub CLI (`gh`) + +Installed from [GitHub Releases](https://github.com/cli/cli/releases). Supports `x86_64` and `aarch64`. + +Common uses inside the devcontainer: + +```bash +gh auth status # Check authentication +gh pr list # List open PRs +gh pr create # Create a PR from current branch +gh pr checkout 123 # Check out a PR locally +gh issue list # List issues +gh run list # List workflow runs +gh run watch # Watch a running workflow +gh release create v1.0.0 # Create a release +gh repo clone org/repo # Clone a repository +``` + +### VS Code Extensions + +| Extension | Purpose | +|-----------|---------| +| `github.copilot` | AI code completions | +| `github.copilot-chat` | AI chat assistant | +| `github.vscode-pull-request-github` | PR and issue management inside VS Code | +| `github.vscode-github-actions` | GitHub Actions workflow editor with validation | +| `github.remotehub` | Browse remote GitHub repositories without cloning | + +## Authentication + +### Auto-auth via token (recommended) + +Set `GH_TOKEN` (or `GITHUB_TOKEN`) in your environment and `gh` will authenticate automatically on shell startup — no manual `gh auth login` needed. + +**Local / DevPod:** add to your `devcontainer.json`: + +```json +{ + "remoteEnv": { + "GH_TOKEN": "${localEnv:GH_TOKEN}" + } +} +``` + +Then set `GH_TOKEN` on your host machine (`export GH_TOKEN=ghp_...` in your shell profile). + +**GitHub Codespaces:** `GITHUB_TOKEN` is injected automatically — `gh` is authenticated with no extra configuration. + +**CI/CD:** set `GH_TOKEN` as a repository or organization secret. + +### SSH + +Use `dotfiles-sync` to bring your SSH keys into the container. + +### Manual + +```bash +gh auth login +``` + +## Version History + +- **v1.0.0**: Initial release. gh CLI, Copilot, Copilot Chat, Pull Requests & Issues, GitHub Actions, RemoteHub extensions. Auto-auth via `GH_TOKEN`/`GITHUB_TOKEN`. Extracted from `essential-dev`. diff --git a/src/github-dev/devcontainer-feature.json b/src/github-dev/devcontainer-feature.json new file mode 100644 index 0000000..83528d6 --- /dev/null +++ b/src/github-dev/devcontainer-feature.json @@ -0,0 +1,36 @@ +{ + "id": "github-dev", + "version": "1.0.0", + "name": "GitHub Development Environment", + "description": "GitHub CLI (gh) and GitHub VS Code extensions (Copilot, Copilot Chat, Pull Requests & Issues, GitHub Actions, RemoteHub). Centralizes all GitHub tooling in one feature.", + "documentationURL": "https://github.com/helpers4/devcontainer/tree/main/src/github-dev", + "options": { + "ghVersion": { + "type": "string", + "default": "latest", + "description": "GitHub CLI version to install (e.g. '2.50.0' or 'latest')" + } + }, + "customizations": { + "vscode": { + "extensions": [ + // GitHub Platform + "github.vscode-pull-request-github", + "github.vscode-github-actions", + "github.remotehub", + // AI Assistant + "github.copilot", + "github.copilot-chat" + ], + "settings": { + // GitHub Copilot + "github.copilot.enable": { + "*": true + } + } + } + }, + "installsAfter": [ + "ghcr.io/devcontainers/features/common-utils" + ] +} diff --git a/src/github-dev/gh-auth.sh b/src/github-dev/gh-auth.sh new file mode 100644 index 0000000..035dd26 --- /dev/null +++ b/src/github-dev/gh-auth.sh @@ -0,0 +1,26 @@ +# This file is part of helpers4. +# Copyright (C) 2025 baxyz +# SPDX-License-Identifier: LGPL-3.0-or-later +# +# Auto-authenticate gh CLI if GH_TOKEN or GITHUB_TOKEN is set in the environment. +# Sourced from /etc/profile.d/ on shell startup. + +_gh_auto_auth() { + # Resolve token: prefer GH_TOKEN, fall back to GITHUB_TOKEN + local token="${GH_TOKEN:-${GITHUB_TOKEN:-}}" + + [ -z "${token}" ] && return 0 + ! command -v gh >/dev/null 2>&1 && return 0 + + # Already authenticated — skip + if gh auth status >/dev/null 2>&1; then + return 0 + fi + + echo "${token}" | gh auth login --with-token 2>/dev/null && \ + echo "github-dev: gh authenticated via token" || \ + echo "github-dev: gh auth failed (invalid token?)" +} + +_gh_auto_auth +unset -f _gh_auto_auth diff --git a/src/github-dev/install.sh b/src/github-dev/install.sh new file mode 100755 index 0000000..ea85b98 --- /dev/null +++ b/src/github-dev/install.sh @@ -0,0 +1,121 @@ +#!/usr/bin/env bash + +# This file is part of helpers4. +# Copyright (C) 2025 baxyz +# SPDX-License-Identifier: LGPL-3.0-or-later +# +# Installs github-dev devcontainer feature. +# - GitHub CLI (gh) from GitHub Releases (skipped if already installed) + +set -e + +GH_VERSION="${_BUILD_ARG_GHVERSION:-"${GHVERSION:-"latest"}"}" + +echo "Setting up github-dev devcontainer feature..." +echo " gh version requested: ${GH_VERSION}" +echo "" + +# ============================================================================ +# 1. Check if gh is already installed +# ============================================================================ + +if command -v gh >/dev/null 2>&1; then + EXISTING_VER="$(gh --version | head -1)" + if [ "${GH_VERSION}" = "latest" ]; then + echo "gh already installed (${EXISTING_VER}), skipping installation" + GH_INSTALLED=true + else + EXISTING_VER_NUM="$(gh --version | head -1 | awk '{print $3}')" + if [ "${EXISTING_VER_NUM}" = "${GH_VERSION}" ]; then + echo "gh ${GH_VERSION} already installed, skipping installation" + GH_INSTALLED=true + else + echo "gh ${EXISTING_VER_NUM} installed but ${GH_VERSION} requested, upgrading..." + GH_INSTALLED=false + fi + fi +else + GH_INSTALLED=false +fi + +# ============================================================================ +# 2. Install GitHub CLI (gh) if needed +# ============================================================================ + +if [ "${GH_INSTALLED}" = "false" ]; then + ARCH="$(uname -m)" + case "${ARCH}" in + x86_64) GH_ARCH="amd64" ;; + aarch64) GH_ARCH="arm64" ;; + armv7l) GH_ARCH="armv6" ;; + *) + echo "Unsupported architecture: ${ARCH}" + exit 1 + ;; + esac + + echo "Architecture: ${ARCH} -> ${GH_ARCH}" + + # Resolve 'latest' to an actual version number + if [ "${GH_VERSION}" = "latest" ]; then + echo "Resolving latest gh version..." + GH_VERSION="$(curl -fsSL https://api.github.com/repos/cli/cli/releases/latest \ + | grep '"tag_name"' | sed 's/.*"v\([^"]*\)".*/\1/')" + if [ -z "${GH_VERSION}" ]; then + echo "Failed to resolve latest gh version, aborting" + exit 1 + fi + echo "Latest gh version: ${GH_VERSION}" + fi + + GH_TARBALL="gh_${GH_VERSION}_linux_${GH_ARCH}.tar.gz" + GH_URL="https://github.com/cli/cli/releases/download/v${GH_VERSION}/${GH_TARBALL}" + GH_TMP="$(mktemp -d)" + + cleanup() { rm -rf "${GH_TMP}"; } + trap cleanup EXIT + + echo "Downloading gh ${GH_VERSION} (${GH_ARCH})..." + curl -fsSL "${GH_URL}" -o "${GH_TMP}/${GH_TARBALL}" + + echo "Installing gh..." + tar -xzf "${GH_TMP}/${GH_TARBALL}" -C "${GH_TMP}" + install -m 0755 "${GH_TMP}/gh_${GH_VERSION}_linux_${GH_ARCH}/bin/gh" /usr/local/bin/gh +fi + +# Verify +if gh --version >/dev/null 2>&1; then + echo "gh ready: $(gh --version | head -1)" +else + echo "gh verification failed" + exit 1 +fi + +# ============================================================================ +# 3. Install gh auto-auth profile.d script +# ============================================================================ + +SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" +install -m 0644 "${SCRIPT_DIR}/gh-auth.sh" /etc/profile.d/gh-auth.sh +echo "gh-auth.sh installed to /etc/profile.d/gh-auth.sh" + +# ============================================================================ +# Summary +# ============================================================================ + +echo "" +echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" +echo "github-dev feature installed!" +echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" +echo "" +echo "Installed:" +echo " $(gh --version | head -1)" +echo "" +echo "Auto-auth: set GH_TOKEN or GITHUB_TOKEN env var to authenticate gh on shell startup" +echo "" +echo "VS Code extensions (installed by devcontainer spec):" +echo " github.copilot" +echo " github.copilot-chat" +echo " github.vscode-pull-request-github" +echo " github.vscode-github-actions" +echo " github.remotehub" diff --git a/test/github-dev/test.sh b/test/github-dev/test.sh new file mode 100755 index 0000000..18e80a2 --- /dev/null +++ b/test/github-dev/test.sh @@ -0,0 +1,53 @@ +#!/bin/bash + +# Test script for github-dev feature +# Copyright (c) 2025 helpers4 +# Licensed under LGPL-3.0 - see LICENSE file for details + +set -e + +echo "Testing github-dev feature..." + +# Test 1: gh CLI is installed and executable +if command -v gh >/dev/null 2>&1; then + GH_VER="$(gh --version | head -1)" + echo "PASS: gh CLI installed: ${GH_VER}" +else + echo "FAIL: gh CLI not found" + exit 1 +fi + +# Test 2: gh is in /usr/local/bin +if [ -x /usr/local/bin/gh ]; then + echo "PASS: gh installed at /usr/local/bin/gh" +else + echo "FAIL: gh not found at /usr/local/bin/gh" + exit 1 +fi + +# Test 3: gh version is parseable (basic sanity) +GH_VERSION_NUM="$(gh --version | head -1 | awk '{print $3}')" +if [ -n "${GH_VERSION_NUM}" ]; then + echo "PASS: gh version parseable: ${GH_VERSION_NUM}" +else + echo "WARN: could not parse gh version number" +fi + +# Test 4: gh-auth.sh profile.d script is installed +if [ -f /etc/profile.d/gh-auth.sh ]; then + echo "PASS: /etc/profile.d/gh-auth.sh present" +else + echo "FAIL: /etc/profile.d/gh-auth.sh not found" + exit 1 +fi + +# Test 5: gh-auth.sh is readable (not executable — it is sourced) +if [ -r /etc/profile.d/gh-auth.sh ]; then + echo "PASS: /etc/profile.d/gh-auth.sh is readable" +else + echo "FAIL: /etc/profile.d/gh-auth.sh is not readable" + exit 1 +fi + +echo "" +echo "github-dev feature test complete!" From de456323d6a5be64890fe71123cca5289665dfe9 Mon Sep 17 00:00:00 2001 From: baxyz Date: Sat, 18 Apr 2026 17:37:45 +0200 Subject: [PATCH 2/6] =?UTF-8?q?feat(essential-dev):=20=E2=9C=A8=20update?= =?UTF-8?q?=20description=20and=20installation=20output=20-=20refine=20fea?= =?UTF-8?q?ture=20description=20-=20enhance=20VS=20Code=20extensions=20ins?= =?UTF-8?q?tallation=20message?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/essential-dev/devcontainer-feature.json | 4 ++-- src/essential-dev/install.sh | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/essential-dev/devcontainer-feature.json b/src/essential-dev/devcontainer-feature.json index 641340d..a0ad63f 100644 --- a/src/essential-dev/devcontainer-feature.json +++ b/src/essential-dev/devcontainer-feature.json @@ -2,8 +2,8 @@ "id": "essential-dev", "version": "1.0.2", "name": "Essential Development Environment", - "description": "Core development environment with Git visualization, Markdown support, and essential editor enhancements. For GitHub tooling (gh CLI, Copilot, PR & Issues), use github-dev.", - "documentationURL": "https://github.com/helpers4/devcontainer/tree/main/features/essential-dev", + "description": "Core development environment with Git visualization, Markdown support, and essential editor enhancements.", + "documentationURL": "https://github.com/helpers4/devcontainer/tree/main/src/essential-dev", "customizations": { "vscode": { "extensions": [ diff --git a/src/essential-dev/install.sh b/src/essential-dev/install.sh index 451243a..b041801 100644 --- a/src/essential-dev/install.sh +++ b/src/essential-dev/install.sh @@ -36,9 +36,8 @@ echo "" echo "✅ essential-dev feature configured" echo "" echo "📦 VS Code extensions installed:" -echo " - Git integration (history, graph, PR support)" -echo " - GitHub Copilot AI assistance" -echo " - Markdown support with preview" +echo " - Git integration (history, graph, conventional commits)" +echo " - Markdown support with preview and linting" echo " - Editor enhancements (multi-cursor, compare, local history)" echo " - File format support (YAML, JSON, CSV, XML, Makefile)" echo "" From 6a6f3cf936f47e42e5f94f6155bb05e55ca485be Mon Sep 17 00:00:00 2001 From: baxyz Date: Sat, 18 Apr 2026 17:37:54 +0200 Subject: [PATCH 3/6] =?UTF-8?q?feat(github-dev):=20=E2=9C=A8=20update=20in?= =?UTF-8?q?stallation=20instructions=20and=20add=20symlink=20check?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - support armv7l in README - clarify installation comments in script - ensure gh symlinked to /usr/local/bin --- src/github-dev/README.md | 2 +- src/github-dev/install.sh | 25 +++++++++++++++---------- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/src/github-dev/README.md b/src/github-dev/README.md index a1eabae..4771a65 100644 --- a/src/github-dev/README.md +++ b/src/github-dev/README.md @@ -33,7 +33,7 @@ Combine with `essential-dev` for a complete development environment: ### GitHub CLI (`gh`) -Installed from [GitHub Releases](https://github.com/cli/cli/releases). Supports `x86_64` and `aarch64`. +Installed from [GitHub Releases](https://github.com/cli/cli/releases). Supports `x86_64`, `aarch64`, and `armv7l`. Common uses inside the devcontainer: diff --git a/src/github-dev/install.sh b/src/github-dev/install.sh index ea85b98..b77fc63 100755 --- a/src/github-dev/install.sh +++ b/src/github-dev/install.sh @@ -5,7 +5,7 @@ # SPDX-License-Identifier: LGPL-3.0-or-later # # Installs github-dev devcontainer feature. -# - GitHub CLI (gh) from GitHub Releases (skipped if already installed) +# - GitHub CLI (gh) from GitHub Releases set -e @@ -16,30 +16,29 @@ echo " gh version requested: ${GH_VERSION}" echo "" # ============================================================================ -# 1. Check if gh is already installed +# 2. Check if gh is already installed at the expected location # ============================================================================ +GH_INSTALLED=false + if command -v gh >/dev/null 2>&1; then EXISTING_VER="$(gh --version | head -1)" if [ "${GH_VERSION}" = "latest" ]; then - echo "gh already installed (${EXISTING_VER}), skipping installation" + echo "gh already installed (${EXISTING_VER}), skipping download" GH_INSTALLED=true else EXISTING_VER_NUM="$(gh --version | head -1 | awk '{print $3}')" if [ "${EXISTING_VER_NUM}" = "${GH_VERSION}" ]; then - echo "gh ${GH_VERSION} already installed, skipping installation" + echo "gh ${GH_VERSION} already installed, skipping download" GH_INSTALLED=true else echo "gh ${EXISTING_VER_NUM} installed but ${GH_VERSION} requested, upgrading..." - GH_INSTALLED=false fi fi -else - GH_INSTALLED=false fi # ============================================================================ -# 2. Install GitHub CLI (gh) if needed +# 3. Install GitHub CLI (gh) if needed # ============================================================================ if [ "${GH_INSTALLED}" = "false" ]; then @@ -83,9 +82,15 @@ if [ "${GH_INSTALLED}" = "false" ]; then install -m 0755 "${GH_TMP}/gh_${GH_VERSION}_linux_${GH_ARCH}/bin/gh" /usr/local/bin/gh fi +# Ensure gh is available at /usr/local/bin even if pre-installed elsewhere +if [ ! -x /usr/local/bin/gh ] && command -v gh >/dev/null 2>&1; then + ln -sf "$(command -v gh)" /usr/local/bin/gh + echo "Symlinked $(command -v gh) -> /usr/local/bin/gh" +fi + # Verify -if gh --version >/dev/null 2>&1; then - echo "gh ready: $(gh --version | head -1)" +if /usr/local/bin/gh --version >/dev/null 2>&1; then + echo "gh ready: $(/usr/local/bin/gh --version | head -1)" else echo "gh verification failed" exit 1 From 42b23e7333e22f55a77813a66f2096dcbbf233e1 Mon Sep 17 00:00:00 2001 From: baxyz Date: Sat, 18 Apr 2026 17:37:59 +0200 Subject: [PATCH 4/6] =?UTF-8?q?feat(typescript-dev):=20=E2=9C=A8=20update?= =?UTF-8?q?=20description=20for=20clarity?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/typescript-dev/devcontainer-feature.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/typescript-dev/devcontainer-feature.json b/src/typescript-dev/devcontainer-feature.json index 45ea5d0..03bb8ce 100644 --- a/src/typescript-dev/devcontainer-feature.json +++ b/src/typescript-dev/devcontainer-feature.json @@ -2,7 +2,7 @@ "id": "typescript-dev", "version": "1.0.5", "name": "TypeScript Development Environment", - "description": "TypeScript/JavaScript development setup with indexing, import management, HTML/CSS intelligence, and web tools. Requires essential-dev for Git, Copilot, and editor enhancements.", + "description": "TypeScript/JavaScript development setup with indexing, import management, HTML/CSS intelligence, and web tools. Built on top of essential-dev for core Git/editor enhancements, with Copilot and PR tooling provided by github-dev.", "documentationURL": "https://github.com/helpers4/devcontainer/tree/main/src/typescript-dev", "installsAfter": [ "ghcr.io/helpers4/devcontainer/essential-dev" From 9c52e44c5b6bb4fe1d39d4c9bc5ef9f032f86cbd Mon Sep 17 00:00:00 2001 From: baxyz Date: Sat, 18 Apr 2026 17:38:06 +0200 Subject: [PATCH 5/6] =?UTF-8?q?feat(github-dev):=20=E2=9C=A8=20update=20de?= =?UTF-8?q?scriptions=20and=20version=20numbers=20-=20update=20github-dev?= =?UTF-8?q?=20description=20for=20clarity=20-=20bump=20essential-dev=20ver?= =?UTF-8?q?sion=20to=201.0.2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AGENTS.md | 4 ++-- README.md | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 4694dc5..c80bb4a 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -109,8 +109,8 @@ devcontainer features test . # Test all | Feature | Version | Description | Dependencies | |---------|---------|-------------|--------------| -| essential-dev | 1.1.0 | Git visualization, editor enhancements, Markdown | — | -| github-dev | 1.0.0 | GitHub CLI (gh), known_hosts, Copilot, PR & Issues, Actions, RemoteHub | — | +| essential-dev | 1.0.2 | Git visualization, editor enhancements, Markdown | — | +| github-dev | 1.0.0 | GitHub CLI (gh), Copilot, PR & Issues, Actions, RemoteHub | — | | typescript-dev | 1.0.5 | TypeScript/JS dev with import management | essential-dev | | angular-dev | 1.0.2 | Angular dev, port 4200 forwarding | — | | vite-plus | — | Vite development setup | — | diff --git a/README.md b/README.md index d1997f7..78ee34a 100644 --- a/README.md +++ b/README.md @@ -119,11 +119,11 @@ Core development environment with Git visualization, Markdown support, and essen ### github-dev -GitHub CLI (`gh`), `github.com` SSH known_hosts, and GitHub VS Code extensions (Copilot, Copilot Chat, Pull Requests & Issues, GitHub Actions, RemoteHub). +GitHub CLI (`gh`) and GitHub VS Code extensions (Copilot, Copilot Chat, Pull Requests & Issues, GitHub Actions, RemoteHub). **Key benefits:** -- `gh` CLI for PRs, issues, releases, Actions runs from the terminal -- `github.com` fingerprints pre-seeded — no first-clone SSH prompt +- `gh` CLI for PRs, issues, releases, and Actions runs from the terminal +- Streamlined GitHub workflows in both the terminal and VS Code - GitHub Copilot and Copilot Chat for AI assistance - Pull Requests & Issues panel inside VS Code - GitHub Actions workflow editor with validation @@ -133,7 +133,7 @@ GitHub CLI (`gh`), `github.com` SSH known_hosts, and GitHub VS Code extensions ( ### typescript-dev -TypeScript/JavaScript development setup with indexing, import management, HTML/CSS intelligence, and web tools. Built on top of `essential-dev` for Git, Copilot, and editor enhancements. +TypeScript/JavaScript development setup with indexing, import management, HTML/CSS intelligence, and web tools. Built on top of `essential-dev` for core Git/editor enhancements, with Copilot and PR tooling provided by `github-dev`. **Key benefits:** - Latest TypeScript with indexing and import management @@ -200,7 +200,7 @@ Features from this repository are available via GitHub Container Registry. Refer | Feature | Description | Documentation | |---------|-------------|---------------| | [essential-dev](./src/essential-dev) | Core dev environment with Git visualization, editor tools, and Markdown | [README](./src/essential-dev/README.md) | -| [github-dev](./src/github-dev) | gh CLI, github.com known_hosts, Copilot, PR & Issues, Actions, RemoteHub | [README](./src/github-dev/README.md) | +| [github-dev](./src/github-dev) | gh CLI, Copilot, PR & Issues, Actions, RemoteHub | [README](./src/github-dev/README.md) | | [auto-header](./src/auto-header) | Automatic file headers with customizable templates (simple or custom) | [README](./src/auto-header/README.md) | | [vite-plus](./src/vite-plus) | Complete Vite+ toolchain with Oxc, Vitest, and VS Code integration | [README](./src/vite-plus/README.md) | | [package-auto-install](./src/package-auto-install) | Automatic package installation with corepack support for Node 24+ | [README](./src/package-auto-install/README.md) | From d3cea14152fd2de141584c3527ed76466814bdd4 Mon Sep 17 00:00:00 2001 From: baxyz Date: Sat, 18 Apr 2026 17:43:59 +0200 Subject: [PATCH 6/6] =?UTF-8?q?feat(CI-CD):=20=E2=9C=A8=20update=20base=20?= =?UTF-8?q?images=20for=20github-dev=20feature?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/pr-validation.yml | 6 ++++-- .github/workflows/test.yml | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pr-validation.yml b/.github/workflows/pr-validation.yml index 3a106f0..5627d14 100644 --- a/.github/workflows/pr-validation.yml +++ b/.github/workflows/pr-validation.yml @@ -19,7 +19,9 @@ jobs: uses: helpers4/action/conventional-commits@main with: checkout: "true" - scopes: "angular-dev|auto-header|dotfiles-sync|essential-dev|git-absorb|github-dev|package-auto-install|peon-ping|shell-history-per-project|typescript-dev|vite-plus|deps|CI-CD" + scopes: "angular-dev|auto-header|dotfiles-sync|essential-dev|git-absorb|github-\ + dev|package-auto-install|peon-ping|shell-history-per-project|typesc\ + ript-dev|vite-plus|deps|CI-CD" pr-comment: "error" - name: Set status @@ -76,7 +78,7 @@ jobs: - features: dotfiles-sync baseImage: mcr.microsoft.com/devcontainers/base:ubuntu - features: github-dev - baseImage: debian:latest + baseImage: mcr.microsoft.com/devcontainers/base:debian - features: github-dev baseImage: mcr.microsoft.com/devcontainers/base:ubuntu diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f41a3a2..e43e05a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -62,9 +62,9 @@ jobs: - features: peon-ping baseImage: mcr.microsoft.com/devcontainers/base:ubuntu - # github-dev - works on any base image + # github-dev - requires common-utils (curl, ca-certificates) - features: github-dev - baseImage: debian:latest + baseImage: mcr.microsoft.com/devcontainers/base:debian - features: github-dev baseImage: mcr.microsoft.com/devcontainers/base:ubuntu