DigitalOcean Registry Cleanup
Prerequisite: doctl CLI must be installed and authenticated (doctl auth init).
Script
Run scripts/registry_cleanup.py via Bash tool:
SCRIPT="<skill-path>/scripts/registry_cleanup.py"
# Analyze: show all repos with tag counts and dates
python3 $SCRIPT analyze
# Clean: delete old tags from a repo, keep newest N
python3 $SCRIPT clean <repo> --keep 5 --dry-run # preview first
python3 $SCRIPT clean <repo> --keep 5 # execute
# Stale: find repos not updated in N months
python3 $SCRIPT stale --months 6 # list only
python3 $SCRIPT stale --months 6 --delete # delete all tags
# GC: trigger garbage collection to reclaim storage
python3 $SCRIPT gc
Workflow
- Run
analyzeto show registry overview - Present the table to the user, ask which repos to clean and how many tags to keep
- Run
clean <repo> --keep N --dry-runto preview - On user confirmation, run
clean <repo> --keep Nto delete - Run
staleif user wants to find abandoned repos - Run
gcafter all deletions to reclaim storage - Run
analyzeagain to show the result
Always use --dry-run first before destructive operations.