Skip to content

"CLI-Anything: Making ALL Software Agent-Native" -- CLI-Hub: https://clianything.cc/

Python

fix update date for outer repo

yuhao69a64a30b673
diff --git a/.github/scripts/update_registry_dates.py b/.github/scripts/update_registry_dates.py
index efcbf0c6c..228afce39 100644
--- a/.github/scripts/update_registry_dates.py
+++ b/.github/scripts/update_registry_dates.py
@@ -1,10 +1,13 @@
#!/usr/bin/env python3
"""Update registry-dates.json with last modified dates from harness directories."""
import json
+import re
import subprocess
+import urllib.request
from pathlib import Path
from datetime import datetime
+
def get_last_modified(harness_path):
"""Get the most recent git commit date for files in a harness directory."""
try:
@@ -19,6 +22,61 @@ def get_last_modified(harness_path):
except (subprocess.CalledProcessError, ValueError):
return None
+
+def get_github_repo_date(source_url):
+ """Get the last push date from a GitHub repo via the API."""
+ # Extract owner/repo from URL like https://github.com/owner/repo
+ match = re.match(r'https://github\.com/([^/]+/[^/]+?)(?:\.git)?$', source_url)
+ if not match:
+ return None
+ repo_slug = match.group(1)
+ api_url = f'https://api.github.com/repos/{repo_slug}'
+ try:
+ req = urllib.request.Request(api_url, headers={'Accept': 'application/vnd.github.v3+json'})
+ with urllib.request.urlopen(req, timeout=10) as resp:
+ data = json.loads(resp.read())
+ pushed_at = data.get('pushed_at') # e.g. "2026-04-13T08:00:00Z"
+ if pushed_at:
+ return pushed_at[:10]
+ except Exception:
+ pass
+ return None
+
+
+def get_pypi_date(install_cmd):
+ """Get the last release date from PyPI for a simple pip package."""
+ # Only works for plain "pip install <package>" commands (not git+ URLs)
+ match = re.match(r'^pip install ([a-zA-Z0-9_-]+)$', install_cmd)
+ if not match:
+ return None
+ package = match.group(1)
+ api_url = f'https://pypi.org/pypi/{package}/json'
+ try:
+ with urllib.request.urlopen(api_url, timeout=10) as resp:
+ data = json.loads(resp.read())
+ # Get the upload time of the latest version
+ latest = data.get('info', {}).get('version')
+ releases = data.get('releases', {})
+ if latest and releases.get(latest):
+ upload_time = releases[latest][0].get('upload_time') # e.g. "2026-04-10T12:00:00"
+ if upload_time:
+ return upload_time[:10]
+ except Exception:
+ pass
+ return None
+
+
+def get_external_date(cli):
+ """Get the last update date for an external CLI, trying GitHub API then PyPI."""
+ source_url = cli.get('source_url')
+ if source_url:
+ date = get_github_repo_date(source_url)
+ if date:
+ return date
+ # Fallback to PyPI
+ return get_pypi_date(cli.get('install_cmd', ''))
+
+
def main():
repo_root = Path(__file__).parent.parent.parent
registry_path = repo_root / 'registry.json'
@@ -29,9 +87,14 @@ def main():
dates = {}
for cli in data['clis']:
- harness_path = repo_root / cli['name'] / 'agent-harness'
- if harness_path.exists():
- dates[cli['name']] = get_last_modified(harness_path)
+ if cli.get('source_url'):
+ # External repo: query GitHub API / PyPI for real update date
+ dates[cli['name']] = get_external_date(cli)
+ else:
+ # In-repo: use the last commit in the harness directory
+ harness_path = repo_root / cli['name'] / 'agent-harness'
+ if harness_path.exists():
+ dates[cli['name']] = get_last_modified(harness_path)
with open(dates_path, 'w') as f:
json.dump(dates, f, indent=2)