stars sync
stars sync
Section titled “stars sync”Syncs starred repositories from all configured sources. Currently supports GitHub; Firefox, Chrome, and awesome list adapters are planned.
stars sync [flags]| Flag | Description |
|---|---|
--full | Force a full sync (re-fetch all stars, replacing the database) |
--backup | Create a timestamped backup before syncing |
--no-cache | Bypass gh CLI cache for fresh API responses |
Behavior
Section titled “Behavior”By default, stars sync performs an incremental sync:
- Reads
last_synced_atfrom thesync_metadatatable - Fetches only stars newer than that timestamp using
starred_atordering - Uses early-stop pagination — stops fetching pages once it finds stars older than the cutoff
- Upserts new/updated records into the existing database
- Updates
last_synced_atwith the current time
The command auto-escalates to a full sync when:
- This is the first sync (no
last_synced_atexists) --fullflag is passed- The last full sync was more than
full_sync_interval_daysago (default: 7, configurable)
Examples
Section titled “Examples”# Default incremental syncstars sync
# Force re-fetch of everythingstars sync --full
# Backup before syncingstars sync --backup
# Fresh data (bypass cache)stars sync --no-cachestars sync github
Section titled “stars sync github”Syncs specifically from the GitHub API. This is what stars sync delegates to under the hood, but allows passing --user to sync a different user’s stars.
stars sync github [flags]| Flag | Short | Type | Description |
|---|---|---|---|
--user | -u | string | GitHub username (default: authenticated user) |
--full | Force full sync | ||
--backup | Create backup before syncing | ||
--no-cache | Bypass gh CLI cache |
Examples
Section titled “Examples”# Sync authenticated user's starsstars sync github
# Sync another user's starsstars sync github --user octocat
# Full re-fetch with backupstars sync github --full --backupAPI details
Section titled “API details”The GitHub adapter (adapters/github.nu):
- Uses
gh api user/starred(orusers/{user}/starred) - Requests
application/vnd.github.star+jsonAccept header to getstarred_attimestamps - Paginates with
per_page=100, sorted bycreateddescending (newest first) - Uses
gh api --cachefor built-in caching (default: 1 hour TTL) - Normalizes each response to the internal star schema before storage