-
-
Notifications
You must be signed in to change notification settings - Fork 22
Closed
Description
Summary
Add --remote flag to cupertino save command that builds the search database by streaming documentation directly from GitHub, without saving files to disk.
Motivation
Currently, setting up Cupertino requires crawling Apple's documentation (~20+ hours). This flag provides instant setup by streaming from pre-crawled repos.
Source Repos
- cupertino-docs - Pre-crawled documentation
docs/- 248 framework foldersarchive/- Legacy programming guidespackages/- Package READMEsswift-evolution/- Swift proposalsswift-org/- Swift.org docs
Command Interface
cupertino save --remote # Stream from GitHub, build database (~45 min)
cupertino save # Build from local files (existing behavior)Note: For instant setup (~30 seconds), use cupertino setup instead (see #65).
Implementation Tasks
Package Creation
- Create
Sources/RemoteSync/directory - Add
RemoteSync.swiftnamespace - Add
RemoteIndexState.swift- Sendable state model with file-level tracking - Add
GitHubFetcher.swift- Actor for HTTP with async URLSession (uses Git Tree API) - Add
AnimatedProgress.swift- Terminal progress UI with spinner - Add
RemoteIndexer.swift- Main orchestrator actor - Update
Package.swiftwith new target
CLI Integration
- Add
--remoteflag toSaveCommand.swift - Add state persistence path to
Constants.swift - Add resume prompt when state file exists
- Handle all phases (docs, evolution, archive, swift-org)
Documentation (per AGENTS.md Feature Checklist)
- Update
README.md- Quick start withsave --remote - Update
CHANGELOG.md- Version entry (0.3.0) - Update
docs/commands/save/README.md- Add flag section - Create
docs/commands/save/option (--)/remote/README.md- Flag docs - Create
docs/commands/save/option (--)/remote/option (--)/base-dir.md - Create
docs/commands/save/option (--)/remote/option (--)/search-db.md - Update CLI help text in
SaveCommand.swift
Additional Features Implemented
- Git Tree API for single-call repo structure fetch (avoids rate limits)
- GitHub token support via
GITHUB_TOKENenvironment variable - Animated spinner progress display
- Single-line progress with carriage return updates
Files Created
| File | Purpose |
|---|---|
Sources/RemoteSync/RemoteSync.swift |
Public namespace |
Sources/RemoteSync/RemoteIndexer.swift |
Main orchestrator |
Sources/RemoteSync/GitHubFetcher.swift |
HTTP client with Git Tree API |
Sources/RemoteSync/RemoteIndexState.swift |
State model (Sendable) |
Sources/RemoteSync/AnimatedProgress.swift |
Terminal progress with spinner |
Files Modified
| File | Changes |
|---|---|
Package.swift |
Added RemoteSync target and product |
SaveCommand.swift |
Added @Flag var remote: Bool, calls RemoteIndexer |
Constants.swift |
Added remoteStateFile path constant |
Related
- Issue Add setup command for instant database download #65 -
setupcommand (instant download, recommended) - Issue Add release command for automated database publishing #66 -
releasecommand (maintainer publishing) - cupertino-docs repo: https://github.com/mihaelamj/cupertino-docs
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels