Skip to content

Add GitHub star workflow for init, upload, CLI, SDK, MCP#540

Merged
riderx merged 2 commits intomainfrom
riderx/star-github-all
Mar 9, 2026
Merged

Add GitHub star workflow for init, upload, CLI, SDK, MCP#540
riderx merged 2 commits intomainfrom
riderx/star-github-all

Conversation

@riderx
Copy link
Member

@riderx riderx commented Mar 9, 2026

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

  • New Features
    • Added CLI commands to star Capgo repositories individually (star) or in bulk (star-all) with configurable delays and progress tracking.
    • Added interactive prompts during onboarding and after successful uploads to encourage repository starring.
    • Expanded SDK and MCP tools with repository starring functionality and flexible configuration options.

@coderabbitai
Copy link

coderabbitai bot commented Mar 9, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 9acb4e3b-20e0-4a1f-924c-82230768cb10

📥 Commits

Reviewing files that changed from the base of the PR and between 86ed108 and 49b22b4.

📒 Files selected for processing (7)
  • src/bundle/upload.ts
  • src/github.ts
  • src/index.ts
  • src/init.ts
  • src/mcp/server.ts
  • src/schemas/sdk.ts
  • src/sdk.ts

📝 Walkthrough

Walkthrough

Adds 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

Cohort / File(s) Summary
Core GitHub Integration
src/github.ts
Comprehensive GitHub CLI module for repository starring with session-based caching, status introspection, bulk starring with configurable delays, discovery with fallbacks, and branching error handling for missing gh, authentication, or repository existence.
CLI Enhancement
src/index.ts, src/bundle/upload.ts, src/init.ts
Added star and star-all CLI commands with progress spinners and per-repository logging; enhanced upload with interactive star prompts and improved error handling with retry flows; integrated interactive starring prompts during onboarding.
SDK Integration
src/sdk.ts, src/schemas/sdk.ts
Extended SDK with starRepo and starAllRepositories methods wrapping GitHub functionality; added Zod schema definitions for option validation across repository, delays, and bulk parameters.
MCP Server Extension
src/mcp/server.ts
Added capgo_star_repository and capgo_star_all_repositories tools with schema validation, command execution via SDK, and formatted JSON responses for success/error cases.

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)
Loading
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)
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~50 minutes

Possibly related PRs

Poem

🐰 Wiggles nose with delight
Starring repos left and right!
With GitHub CLI burning bright,
Bulk operations through the night—
Every bunny celebrates this feat! ⭐

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch riderx/star-github-all

Comment @coderabbitai help to get the list of available commands and usage tips.

@riderx riderx merged commit a54d0e1 into main Mar 9, 2026
13 of 14 checks passed
@sonarqubecloud
Copy link

sonarqubecloud bot commented Mar 9, 2026

Quality Gate Failed Quality Gate failed

Failed conditions
2 Security Hotspots

See analysis details on SonarQube Cloud

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +142 to +146
if (!hasResult) {
actionSpinner.stop('⚪ No repositories were processed.')
}
else if (repositories?.length === 0 || !repositories.length) {
actionSpinner.stop(`✅ Completed ${result.length} repository(s).`)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant