Skip to content

Commit 32e9f39

Browse files
committed
fix(make): generic install/upgrade/uninstall for all catalog tools
Make pattern targets (install-%, upgrade-%, uninstall-%, reconcile-%) now use a fallback chain: dedicated script > install_tool.sh > error. This extends support from the ~15 tools with dedicated scripts to all 89 cataloged tools. Specific fixes: - install-core: use install_group.sh with 'core' tag - install-aws/kubectl/terraform: use install_tool.sh (no dedicated scripts) - install-uv: add missing Makefile target - publish: remove orphan .PHONY entry (only publish-test/publish-prod exist) - install_group.sh: wire uninstall action through to install_tool.sh Closes #28, closes #29, closes #30, closes #31, closes #32, closes #33, closes #34 Signed-off-by: Sebastian Mendel <info@sebastianmendel.de>
1 parent 3226af9 commit 32e9f39

5 files changed

Lines changed: 60 additions & 24 deletions

File tree

AGENTS.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- Managed by agent: keep sections and order; edit content, not structure. Last updated: 2026-02-06 -->
1+
<!-- Managed by agent: keep sections and order; edit content, not structure. Last updated: 2026-02-25 -->
22

33
# AGENTS.md (root)
44

@@ -59,6 +59,10 @@ uv run python audit.py --help # Verify CLI works
5959
| `make update` | Collect fresh versions (~10s) |
6060
| `make update-local` | Update only local state (no network) |
6161
| `make update-baseline` | Update upstream baseline for commit |
62+
| `make install-<tool>` | Install any cataloged tool (e.g., `make install-jq`) |
63+
| `make upgrade-<tool>` | Upgrade any tool (e.g., `make upgrade-ripgrep`) |
64+
| `make uninstall-<tool>` | Uninstall any tool (e.g., `make uninstall-jq`) |
65+
| `make reconcile-<tool>` | Reconcile install method (e.g., `make reconcile-node`) |
6266
| `make upgrade` | Interactive upgrade guide |
6367
| `make cleanup` | Interactive tool removal |
6468
| `make upgrade-managed` | Upgrade all package managers |
@@ -83,7 +87,7 @@ uv run python audit.py --help # Verify CLI works
8387

8488
**AI CLI Preparation v2.0** — Tool version auditing and installation management for AI coding agents.
8589

86-
- **Architecture:** 21 Python modules, 79 JSON tool catalogs
90+
- **Architecture:** 21 Python modules, 89 JSON tool catalogs
8791
- **Phase 1:** Detection & auditing (complete)
8892
- **Phase 2:** Installation & upgrade management (complete)
8993
- **Entry point:** `audit.py``cli_audit` package

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ export
1616
lint lint-code lint-types lint-security format format-check \
1717
install install-dev install-core install-python install-node install-go \
1818
install-aws install-kubectl install-terraform install-ansible install-docker \
19-
install-brew install-rust upgrade-% uninstall-% reconcile-% \
20-
build build-dist build-wheel check-dist publish publish-test publish-prod \
19+
install-brew install-rust install-uv install-% upgrade-% uninstall-% reconcile-% \
20+
build build-dist build-wheel check-dist publish-test publish-prod \
2121
clean clean-build clean-test clean-pyc clean-all \
2222
scripts-perms audit-auto detect-managers upgrade-managed upgrade-dry-run \
2323
upgrade-managed-system upgrade-managed-user upgrade-project-deps upgrade-managed-all \

Makefile.d/user.mk

Lines changed: 38 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,13 @@ reset-pins: scripts-perms ## Remove all version pins from all tools
8989
guide: upgrade ## Alias for upgrade (deprecated)
9090

9191
upgrade-%: scripts-perms ## Upgrade tool (e.g., make upgrade-python)
92-
./scripts/install_$*.sh update
92+
@if [ -f "./scripts/install_$*.sh" ]; then \
93+
./scripts/install_$*.sh update; \
94+
elif [ -f "./catalog/$*.json" ]; then \
95+
./scripts/install_tool.sh "$*" update; \
96+
else \
97+
echo "Error: No installer found for '$*'" >&2; exit 1; \
98+
fi
9399

94100
upgrade-managed: scripts-perms ## Upgrade all package managers and their packages
95101
SCOPE=all ./scripts/auto_update.sh update
@@ -145,7 +151,7 @@ update-debug: ## Collect with verbose debug output (shows network calls)
145151
# ----------------------------------------------------------------------------
146152

147153
install-core: scripts-perms ## Install core tools (fd, fzf, ripgrep, jq, yq, bat, delta, just)
148-
./scripts/install_core.sh
154+
./scripts/install_group.sh core install
149155

150156
install-python: scripts-perms ## Install Python toolchain via uv
151157
./scripts/install_python.sh
@@ -157,13 +163,13 @@ install-go: scripts-perms ## Install Go runtime
157163
./scripts/install_go.sh
158164

159165
install-aws: scripts-perms ## Install AWS CLI
160-
./scripts/install_aws.sh
166+
./scripts/install_tool.sh aws install
161167

162168
install-kubectl: scripts-perms ## Install Kubernetes CLI
163-
./scripts/install_kubectl.sh
169+
./scripts/install_tool.sh kubectl install
164170

165171
install-terraform: scripts-perms ## Install Terraform
166-
./scripts/install_terraform.sh
172+
./scripts/install_tool.sh terraform install
167173

168174
install-ansible: scripts-perms ## Install Ansible
169175
./scripts/install_ansible.sh
@@ -177,12 +183,31 @@ install-brew: scripts-perms ## Install Homebrew (macOS/Linux)
177183
install-rust: scripts-perms ## Install Rust via rustup
178184
./scripts/install_rust.sh
179185

186+
install-uv: scripts-perms ## Install uv package manager
187+
./scripts/install_uv.sh
188+
189+
# Generic fallback: install any cataloged tool (e.g., make install-jq)
190+
install-%: scripts-perms
191+
@if [ -f "./scripts/install_$*.sh" ]; then \
192+
./scripts/install_$*.sh; \
193+
elif [ -f "./catalog/$*.json" ]; then \
194+
./scripts/install_tool.sh "$*" install; \
195+
else \
196+
echo "Error: No installer found for '$*'" >&2; exit 1; \
197+
fi
198+
180199
# ----------------------------------------------------------------------------
181200
# UNINSTALL / RECONCILE
182201
# ----------------------------------------------------------------------------
183202

184203
uninstall-%: scripts-perms ## Uninstall tool (e.g., make uninstall-python)
185-
./scripts/install_$*.sh uninstall
204+
@if [ -f "./scripts/install_$*.sh" ]; then \
205+
./scripts/install_$*.sh uninstall; \
206+
elif [ -f "./catalog/$*.json" ]; then \
207+
./scripts/install_tool.sh "$*" uninstall; \
208+
else \
209+
echo "Error: No installer found for '$*'" >&2; exit 1; \
210+
fi
186211

187212
reconcile-pip-to-uv: scripts-perms ## Migrate user pip packages to UV tools
188213
@./scripts/reconcile_pip_to_uv.sh
@@ -191,7 +216,13 @@ reconcile-pipx-to-uv: scripts-perms ## Migrate pipx tools to UV
191216
@./scripts/reconcile_pipx_to_uv.sh
192217

193218
reconcile-%: scripts-perms ## Reconcile tool installation (e.g., make reconcile-node)
194-
./scripts/install_$*.sh reconcile
219+
@if [ -f "./scripts/install_$*.sh" ]; then \
220+
./scripts/install_$*.sh reconcile; \
221+
elif [ -f "./catalog/$*.json" ]; then \
222+
./scripts/install_tool.sh "$*" reconcile; \
223+
else \
224+
echo "Error: No installer found for '$*'" >&2; exit 1; \
225+
fi
195226

196227
# ----------------------------------------------------------------------------
197228
# SYSTEM MANAGEMENT

scripts/AGENTS.md

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- Managed by agent: keep sections & order; edit content, not structure. Last updated: 2026-02-06 -->
1+
<!-- Managed by agent: keep sections & order; edit content, not structure. Last updated: 2026-02-25 -->
22

33
# Installation Scripts - Agent Guide
44

@@ -92,14 +92,22 @@ make scripts-perms # Ensure all scripts are executable
9292
./scripts/install_node.sh reconcile
9393
```
9494

95-
**Via Make:**
95+
**Via Make (works for all 89 cataloged tools):**
9696
```bash
97-
make install-python # Install Python toolchain
98-
make update-python # Update Python toolchain
97+
make install-python # Install Python toolchain (dedicated script)
98+
make upgrade-python # Upgrade Python toolchain
9999
make uninstall-python # Uninstall Python toolchain
100100
make reconcile-node # Switch Node.js to nvm-managed
101+
make install-jq # Install any catalog tool (generic fallback)
102+
make upgrade-ripgrep # Upgrade any catalog tool
103+
make uninstall-bat # Uninstall any catalog tool
101104
```
102105

106+
Pattern targets (`install-%`, `upgrade-%`, `uninstall-%`, `reconcile-%`) use a fallback chain:
107+
1. Dedicated script (`scripts/install_<tool>.sh`) if it exists
108+
2. Generic installer (`scripts/install_tool.sh <tool>`) for catalog entries
109+
3. Error if neither found
110+
103111
**Smoke test:**
104112
```bash
105113
./scripts/test_smoke.sh # Verify audit output format

scripts/install_group.sh

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,8 @@ echo "[$TAG] Found ${#TOOLS[@]} tools: ${TOOLS[*]}"
4747
# Install/update/uninstall each tool
4848
for tool in "${TOOLS[@]}"; do
4949
case "$ACTION" in
50-
install|reconcile)
51-
"$DIR/install_tool.sh" "$tool"
52-
;;
53-
update)
54-
"$DIR/install_tool.sh" "$tool"
55-
;;
56-
uninstall)
57-
# For uninstall, we'd need to implement uninstall support in installers
58-
echo "[$tool] Uninstall not yet implemented" >&2
50+
install|update|reconcile|uninstall)
51+
"$DIR/install_tool.sh" "$tool" "$ACTION" || echo_warn "Failed to $ACTION $tool"
5952
;;
6053
*)
6154
echo "Unknown action: $ACTION" >&2

0 commit comments

Comments
 (0)