Add GitHub star workflow for init, upload, CLI, SDK, MCP#540
Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (7)
📝 WalkthroughWalkthroughAdds GitHub repository starring functionality via GitHub CLI integration. Introduces a new module (src/github.ts) with starring capabilities including session caching and bulk operations, integrates into CLI commands (star, star-all), SDK methods, and MCP server tools. Includes progress tracking and error handling throughout. Changes
Sequence Diagram(s)sequenceDiagram
actor User
participant CLI as CLI/SDK
participant GitHub as GitHub CLI<br/>(gh)
participant API as GitHub API
User->>CLI: Call star/starRepo
CLI->>GitHub: Check if gh installed
GitHub-->>CLI: gh status
CLI->>GitHub: Verify gh login status
GitHub-->>CLI: login status
CLI->>GitHub: Check if repo exists
GitHub->>API: gh api repos/{owner}/{repo}
API-->>GitHub: repo info
GitHub-->>CLI: repo exists
CLI->>GitHub: Execute gh star command
GitHub->>API: Star request
API-->>GitHub: Success/Already starred
GitHub-->>CLI: Result
CLI-->>User: Return status (starred/already_starred/error)
sequenceDiagram
actor User
participant CLI as CLI/SDK
participant GitHub as GitHub CLI<br/>(gh)
participant API as GitHub API
participant Timer as Delay<br/>Timer
User->>CLI: Call starAllRepositories
CLI->>GitHub: Discover default repositories
GitHub->>API: gh api paginated repos query
API-->>GitHub: Repository list
GitHub-->>CLI: Deduplicated repos
loop For each repository
CLI->>Timer: Random delay (min-max)
Timer-->>CLI: Delay elapsed
CLI->>GitHub: Check/execute star
GitHub->>API: Star repo request
API-->>GitHub: Response
GitHub-->>CLI: Result
CLI->>User: onProgress callback
end
CLI-->>User: Return array of results (starred/already_starred/skipped/failed)
Estimated code review effort🎯 4 (Complex) | ⏱️ ~50 minutes Possibly related PRs
Poem
✨ Finishing Touches
🧪 Generate unit tests (beta)
Comment |
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 255de11a47
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (!hasResult) { | ||
| actionSpinner.stop('⚪ No repositories were processed.') | ||
| } | ||
| else if (repositories?.length === 0 || !repositories.length) { | ||
| actionSpinner.stop(`✅ Completed ${result.length} repository(s).`) |
There was a problem hiding this comment.
Fail star-all when any repository star action fails
This handler never converts repository-level failures into a command failure: even when starAllRepositories() returns entries with error, the command still prints a completed success message and exits normally. In common failure cases (e.g., gh missing or not logged in), users and automation receive a zero exit status despite no stars being applied, which makes failure detection unreliable.
Useful? React with 👍 / 👎.


This change introduces a shared GitHub module that handles repository normalization, star checks, and Cap-go repository discovery for the CLI and SDK flows.
It adds CLI star and star-all commands with configurable delay options, org-driven discovery of repositories, and clack progress spinner updates with step counters.
It adds interactive prompts in init and upload to offer starring support (single repo or all repos) and avoids reprompting when already starred or unavailable.
It exposes new SDK methods and MCP tools for starring, with supporting schema types and exports updated for both CLI and MCP callers.
Summary by CodeRabbit
star) or in bulk (star-all) with configurable delays and progress tracking.