feat(devcontainer): add yq and additional CLI tools, improve compatibility symlinks
Some checks are pending
Deploy Docusaurus Documentation (Dual Sites) / Build and Deploy Documentation Sites (push) Waiting to run
Lint / Ruff (push) Waiting to run
Validate / Hassfest validation (push) Waiting to run
Validate / HACS validation (push) Waiting to run

This commit is contained in:
Julian Pawlowski 2026-04-11 15:56:14 +00:00
parent c7af02f7c2
commit 8aa5769784
3 changed files with 38 additions and 14 deletions

View file

@ -134,6 +134,9 @@
"version": "latest", "version": "latest",
"profile": "minimal" "profile": "minimal"
}, },
"ghcr.io/devcontainer-community/devcontainer-features/yq:1": {
"version": "latest"
},
"ghcr.io/devcontainers-extra/features/apt-packages:1": { "ghcr.io/devcontainers-extra/features/apt-packages:1": {
"packages": [ "packages": [
"bat", "bat",
@ -142,14 +145,21 @@
"ffmpeg", "ffmpeg",
"fzf", "fzf",
"git-delta", "git-delta",
"hyperfine",
"httpie", "httpie",
"hyperfine",
"ipython3", "ipython3",
"jo",
"jq", "jq",
"libturbojpeg0",
"libpcap-dev", "libpcap-dev",
"libturbojpeg0",
"miller",
"moreutils",
"ripgrep", "ripgrep",
"yq" "shellcheck",
"shfmt",
"sqlite3",
"tree",
"yamllint"
] ]
} }
} }

View file

@ -785,9 +785,11 @@ When debugging period calculation issues:
**Agent Productivity CLI Tools (DevContainer):** **Agent Productivity CLI Tools (DevContainer):**
- Expected available tools: `rg`, `fd`, `fzf`, `jq`, `yq`, `bat`, `eza`, `delta`, `hyperfine`, `ipython`, `http` The devcontainer provides common agent-facing CLI tools: `bat`, `delta`/`git-delta`, `eza`, `fd`/`fdfind`, `fzf`, `http`/`httpie`, `hyperfine`, `ipython`, `jq`, `jo`, `mlr`/`miller`, `rg`/`ripgrep`, `shellcheck`, `shfmt`, `sponge`, `sqlite3`, `tree`, `yq`, and `yamllint`. Prefer these explicit container tools over assuming a VS Code extension exposes an equivalent CLI on `PATH`.
- Debian package notes: `fd-find` provides `fdfind`, `bat` may be `batcat`
- Setup creates compatibility symlinks for `fd` and `bat` in `scripts/setup/setup` **CLI Compatibility Notes:**
Some commands are available via compatibility aliases because Debian package names differ from what agents often expect. Prefer these stable spellings: `bat`, `fd`, `git-delta`, `http`, `ipython`, `miller`, and `ripgrep`. `yq` is installed as the Mike Farah variant, so standard `yq eval`/`yq e` syntax is expected. Setup creates compatibility symlinks automatically in `scripts/setup/setup`.
**When generating shell commands:** **When generating shell commands:**

View file

@ -50,15 +50,27 @@ fi
# Setup Debian compatibility symlinks for common CLI tool names. # Setup Debian compatibility symlinks for common CLI tool names.
mkdir -p "$HOME/.local/bin" mkdir -p "$HOME/.local/bin"
# Debian package fd-find provides `fdfind`, but most workflows expect `fd`. # Generalized function to create command aliases for Debian compatibility
if command -v fdfind >/dev/null 2>&1; then ensure_command_alias() {
ln -sf "$(command -v fdfind)" "$HOME/.local/bin/fd" local expected_cmd="$1"
fi local actual_cmd="$2"
# Debian package bat provides `batcat`, but most workflows expect `bat`. if command -v "$actual_cmd" >/dev/null 2>&1; then
if command -v batcat >/dev/null 2>&1; then actual_path="$(command -v "$actual_cmd")"
ln -sf "$(command -v batcat)" "$HOME/.local/bin/bat" ln -sf "$actual_path" "$HOME/.local/bin/$expected_cmd" 2>/dev/null || true
fi fi
}
# Create command aliases for Debian compatibility
# Debian package names differ from expected spellings
ensure_command_alias "bat" "batcat"
ensure_command_alias "fd" "fdfind"
ensure_command_alias "fd-find" "fdfind"
ensure_command_alias "delta" "git-delta"
ensure_command_alias "http" "httpie"
ensure_command_alias "ipython" "ipython3"
ensure_command_alias "mlr" "miller"
ensure_command_alias "rg" "ripgrep"
# Ensure user-local bin directory is available in interactive shells. # Ensure user-local bin directory is available in interactive shells.
if ! grep -q '\$HOME/.local/bin' "$HOME/.zshrc" 2>/dev/null; then if ! grep -q '\$HOME/.local/bin' "$HOME/.zshrc" 2>/dev/null; then