#!/usr/bin/env bash
# tool-list — compact catalog overview. Agent discovery entry point.
set -euo pipefail

JSON="${1:-/pentester/tools.json}"
if [ ! -f "$JSON" ]; then
  echo "tools.json not found at $JSON" >&2
  exit 1
fi

echo "Pentester toolbox catalog ($(jq -r '.image' "$JSON"), version $(jq -r '.version' "$JSON"))"
echo "bins: $(jq '.all_bins | length' "$JSON")"
echo
for category in $(jq -r '.categories | keys[]' "$JSON"); do
  echo "── $category"
  jq -r --arg c "$category" '.categories[$c][] | "  " + .name + " — " + .description' "$JSON"
done
