mirror of
https://github.com/jpawlowski/hass.tibber_prices.git
synced 2026-05-28 18:43:40 +00:00
feat(devcontainer): add yq and additional CLI tools, improve compatibility symlinks
This commit is contained in:
parent
c7af02f7c2
commit
8aa5769784
3 changed files with 38 additions and 14 deletions
|
|
@ -134,6 +134,9 @@
|
|||
"version": "latest",
|
||||
"profile": "minimal"
|
||||
},
|
||||
"ghcr.io/devcontainer-community/devcontainer-features/yq:1": {
|
||||
"version": "latest"
|
||||
},
|
||||
"ghcr.io/devcontainers-extra/features/apt-packages:1": {
|
||||
"packages": [
|
||||
"bat",
|
||||
|
|
@ -142,14 +145,21 @@
|
|||
"ffmpeg",
|
||||
"fzf",
|
||||
"git-delta",
|
||||
"hyperfine",
|
||||
"httpie",
|
||||
"hyperfine",
|
||||
"ipython3",
|
||||
"jo",
|
||||
"jq",
|
||||
"libturbojpeg0",
|
||||
"libpcap-dev",
|
||||
"libturbojpeg0",
|
||||
"miller",
|
||||
"moreutils",
|
||||
"ripgrep",
|
||||
"yq"
|
||||
"shellcheck",
|
||||
"shfmt",
|
||||
"sqlite3",
|
||||
"tree",
|
||||
"yamllint"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -785,9 +785,11 @@ When debugging period calculation issues:
|
|||
|
||||
**Agent Productivity CLI Tools (DevContainer):**
|
||||
|
||||
- Expected available tools: `rg`, `fd`, `fzf`, `jq`, `yq`, `bat`, `eza`, `delta`, `hyperfine`, `ipython`, `http`
|
||||
- Debian package notes: `fd-find` provides `fdfind`, `bat` may be `batcat`
|
||||
- Setup creates compatibility symlinks for `fd` and `bat` in `scripts/setup/setup`
|
||||
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`.
|
||||
|
||||
**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:**
|
||||
|
||||
|
|
|
|||
|
|
@ -50,15 +50,27 @@ fi
|
|||
# Setup Debian compatibility symlinks for common CLI tool names.
|
||||
mkdir -p "$HOME/.local/bin"
|
||||
|
||||
# Debian package fd-find provides `fdfind`, but most workflows expect `fd`.
|
||||
if command -v fdfind >/dev/null 2>&1; then
|
||||
ln -sf "$(command -v fdfind)" "$HOME/.local/bin/fd"
|
||||
fi
|
||||
# Generalized function to create command aliases for Debian compatibility
|
||||
ensure_command_alias() {
|
||||
local expected_cmd="$1"
|
||||
local actual_cmd="$2"
|
||||
|
||||
# Debian package bat provides `batcat`, but most workflows expect `bat`.
|
||||
if command -v batcat >/dev/null 2>&1; then
|
||||
ln -sf "$(command -v batcat)" "$HOME/.local/bin/bat"
|
||||
fi
|
||||
if command -v "$actual_cmd" >/dev/null 2>&1; then
|
||||
actual_path="$(command -v "$actual_cmd")"
|
||||
ln -sf "$actual_path" "$HOME/.local/bin/$expected_cmd" 2>/dev/null || true
|
||||
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.
|
||||
if ! grep -q '\$HOME/.local/bin' "$HOME/.zshrc" 2>/dev/null; then
|
||||
|
|
|
|||
Loading…
Reference in a new issue