Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions .github/workflows/pr-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ 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|typesc\
ript-dev|vite-plus|deps|CI-CD"
pr-comment: "error"

- name: Set status
Expand Down Expand Up @@ -77,6 +77,10 @@ jobs:
baseImage: debian:latest
- features: dotfiles-sync
baseImage: mcr.microsoft.com/devcontainers/base:ubuntu
- features: github-dev
baseImage: mcr.microsoft.com/devcontainers/base:debian
- features: github-dev
baseImage: mcr.microsoft.com/devcontainers/base:ubuntu

outputs:
status: ${{ steps.status.outputs.status }}
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ jobs:
- features: peon-ping
baseImage: mcr.microsoft.com/devcontainers/base:ubuntu

# github-dev - requires common-utils (curl, ca-certificates)
- features: github-dev
baseImage: mcr.microsoft.com/devcontainers/base:debian
- features: github-dev
baseImage: mcr.microsoft.com/devcontainers/base:ubuntu

# dotfiles-sync - works on any base image
- features: dotfiles-sync
baseImage: debian:latest
Expand Down
5 changes: 3 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Follow [Conventional Commits](https://www.conventionalcommits.org/) with a gitmo

**Format:** `<type>(<scope>): <emoji> <description>`

**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 |
|-------|------|-------------|
Expand Down Expand Up @@ -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.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 | — |
Expand Down
25 changes: 20 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,21 +106,34 @@ 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)
- Works out-of-the-box with zero configuration

[📖 Documentation](./src/essential-dev/README.md)

### github-dev

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, 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
- 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.
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
Expand Down Expand Up @@ -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": {},
Expand All @@ -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, 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) |
Expand Down
11 changes: 3 additions & 8 deletions src/essential-dev/devcontainer-feature.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,17 @@
{
"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.",
"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": [
// Git & Version Control
"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",
Expand Down
5 changes: 2 additions & 3 deletions src/essential-dev/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 ""
Expand Down
96 changes: 96 additions & 0 deletions src/github-dev/README.md
Original file line number Diff line number Diff line change
@@ -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`, `aarch64`, and `armv7l`.

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`.
36 changes: 36 additions & 0 deletions src/github-dev/devcontainer-feature.json
Original file line number Diff line number Diff line change
@@ -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"
]
}
26 changes: 26 additions & 0 deletions src/github-dev/gh-auth.sh
Original file line number Diff line number Diff line change
@@ -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
Loading
Loading