Skip to content

Commit 430b404

Browse files
CybotTMclaude
andcommitted
feat(audit): add outdated command and improve UX
Added three improvements: 1. Suppress make error messages during health checks: - Added 2>/dev/null to check-path, check-python-managers, check-node-managers in update target - Prevents noisy "make[1]: *** Error 1" messages while preserving script warning output 2. Add 'make outdated' command: - New CLI_AUDIT_FILTER_STATUS environment variable - Filters tools by status (NOT INSTALLED, OUTDATED, etc.) - Usage: make outdated shows only tools needing attention 3. Change not-installed tool color from red to blue: - Added BLUE ANSI color constant - NOT INSTALLED and UNKNOWN tools now display in blue - Less alarming than red for missing tools 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 9080917 commit 430b404

2 files changed

Lines changed: 17 additions & 6 deletions

File tree

Makefile.d/user.mk

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ audit-offline: ## Offline audit with hints (fast local scan)
2727
@bash -c 'set -o pipefail; CLI_AUDIT_OFFLINE=1 CLI_AUDIT_RENDER=1 CLI_AUDIT_GROUP=0 CLI_AUDIT_HINTS=1 CLI_AUDIT_LINKS=1 CLI_AUDIT_EMOJI=1 $(PYTHON) audit.py | \
2828
$(PYTHON) smart_column.py -s "|" -t --right 3,5 --header' || true
2929

30+
outdated: ## Show only missing and outdated tools
31+
@bash -c 'set -o pipefail; CLI_AUDIT_RENDER=1 CLI_AUDIT_GROUP=0 CLI_AUDIT_HINTS=1 CLI_AUDIT_LINKS=1 CLI_AUDIT_EMOJI=1 CLI_AUDIT_FILTER_STATUS="NOT INSTALLED,OUTDATED" $(PYTHON) audit.py | \
32+
$(PYTHON) smart_column.py -s "|" -t --right 3,5 --header' || true
33+
3034
audit-%: scripts-perms ## Audit single tool (e.g., make audit-ripgrep)
3135
@bash -c 'set -o pipefail; CLI_AUDIT_RENDER=1 CLI_AUDIT_LINKS=1 CLI_AUDIT_EMOJI=1 $(PYTHON) audit.py $* | \
3236
$(PYTHON) smart_column.py -s "|" -t --right 3,5 --header' || true
@@ -51,9 +55,9 @@ update: ## Collect fresh version data with network calls and update snapshot (~1
5155
@echo "✓ Snapshot updated. Run 'make audit' or 'make upgrade' to use it." >&2
5256
@echo "" >&2
5357
@echo "→ Running system health checks..." >&2
54-
@$(MAKE) check-path || true
55-
@$(MAKE) check-python-managers || true
56-
@$(MAKE) check-node-managers || true
58+
@$(MAKE) check-path 2>/dev/null || true
59+
@$(MAKE) check-python-managers 2>/dev/null || true
60+
@$(MAKE) check-node-managers 2>/dev/null || true
5761

5862
update-debug: ## Collect with verbose debug output (shows network calls)
5963
@bash -c 'set -o pipefail; CLI_AUDIT_COLLECT=1 CLI_AUDIT_DEBUG=1 CLI_AUDIT_TIMINGS=1 $(PYTHON) audit.py --update --verbose' || true

audit.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
COLLECT_MODE = os.environ.get("CLI_AUDIT_COLLECT", "0") == "1"
4040
RENDER_MODE = os.environ.get("CLI_AUDIT_RENDER", "0") == "1"
4141
JSON_MODE = os.environ.get("CLI_AUDIT_JSON", "0") == "1"
42+
FILTER_STATUS = os.environ.get("CLI_AUDIT_FILTER_STATUS", "") # e.g., "NOT INSTALLED,OUTDATED"
4243

4344

4445
def normalize_version(version: str) -> str:
@@ -216,6 +217,11 @@ def cmd_audit(args: argparse.Namespace) -> int:
216217
selected = set(args.tools) if args.tools else None
217218
tools = render_from_snapshot(snapshot, selected)
218219

220+
# Apply status filter if specified
221+
if FILTER_STATUS:
222+
allowed_statuses = {s.strip().upper() for s in FILTER_STATUS.split(",")}
223+
tools = [t for t in tools if t.get("status", "").upper() in allowed_statuses]
224+
219225
# JSON output mode
220226
if JSON_MODE:
221227
# Enrich tools with additional fields for guide.sh compatibility
@@ -330,6 +336,7 @@ def cmd_update(args: argparse.Namespace) -> int:
330336
GREEN = "\033[32m"
331337
BOLD_GREEN = "\033[1;32m"
332338
YELLOW = "\033[33m"
339+
BLUE = "\033[34m"
333340
RED = "\033[31m"
334341
RESET = "\033[0m"
335342

@@ -346,9 +353,9 @@ def cmd_update(args: argparse.Namespace) -> int:
346353
inst_color = YELLOW
347354
latest_color = BOLD_GREEN
348355
op = "⚠️"
349-
else:
350-
inst_color = RED
351-
latest_color = RED
356+
else: # NOT INSTALLED, UNKNOWN
357+
inst_color = BLUE # Blue for not-installed
358+
latest_color = BLUE
352359
op = "?"
353360

354361
inst_display = inst if inst else "n/a"

0 commit comments

Comments
 (0)