Skip to content

Show combined provider usage - #16

Merged
ygpark80 merged 1 commit into
mainfrom
feat/combined-usage
Aug 10, 2026
Merged

Show combined provider usage#16
ygpark80 merged 1 commit into
mainfrom
feat/combined-usage

Conversation

@ygpark80

@ygpark80 ygpark80 commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

User description

Summary

  • add prism usage to fetch ChatGPT and OpenCode Go concurrently
  • preserve account-level labels and ChatGPT profile selection
  • show partial results when one provider is unavailable

Verification

  • go test -mod=vendor -race ./...
  • go vet -mod=vendor ./...
  • Linux amd64 and macOS arm64 cross-builds
  • live prism usage against local signed-in sessions

CodeAnt-AI Description

Show combined ChatGPT and OpenCode Go usage in one command

What Changed

  • Added prism usage to display ChatGPT and OpenCode Go usage together
  • Supports selecting a ChatGPT profile with --profile
  • Shows available provider results even when the other provider is unavailable, with a clear error for the failed provider
  • Returns an error only when usage cannot be retrieved from either provider
  • Documents the new command in the help output and README

Impact

✅ One-command provider usage overview
✅ Partial usage results when a login is unavailable
✅ Clear provider-specific usage errors

💡 Usage Guide

Checking Your Pull Request

Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

Talking to CodeAnt AI

Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

Preserve Org Learnings with CodeAnt

You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

Check Your Repository Health

To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.

Summary by CodeRabbit

  • New Features

    • Added a usage command that displays ChatGPT and OpenCode Go usage together.
    • Usage information is retrieved independently, so results from one provider remain available if the other fails.
    • Added profile-aware usage reporting and updated command help.
  • Documentation

    • Added usage instructions for the new command to the README.

@codeant-ai

codeant-ai Bot commented Aug 10, 2026

Copy link
Copy Markdown

🤖 CodeAnt AI — Review Status

Status Commit Started (UTC) Finished (UTC)
✅ Reviewed your PR d70d100 Aug 10, 2026 · 06:40 06:43

@codeant-ai

codeant-ai Bot commented Aug 10, 2026

Copy link
Copy Markdown

Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: ce2c0592-463c-43b0-95e9-773231fe3625

📥 Commits

Reviewing files that changed from the base of the PR and between 93ec793 and d70d100.

📒 Files selected for processing (3)
  • README.md
  • internal/cli/run.go
  • internal/cli/run_test.go

📝 Walkthrough

Walkthrough

The CLI adds prism usage to fetch ChatGPT and OpenCode Go usage concurrently. It prints successful results and provider errors independently, and returns an error only when both providers fail. Documentation and tests cover the command.

Changes

Combined usage reporting

Layer / File(s) Summary
Provider usage paths
internal/cli/run.go
ChatGPT usage now uses the Prism client. OpenCode Go continues to use its dedicated usage fetcher. The CLI exposes the top-level usage command and documents it in help output.
Combined usage orchestration
internal/cli/run.go, internal/cli/run_test.go, README.md
The command fetches both providers concurrently, forwards the selected profile, preserves partial results, and fails only when both providers fail. Tests and documentation cover the behavior.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant CLI
  participant PrismClient
  participant OpenCodeGo
  CLI->>PrismClient: Fetch ChatGPT usage
  CLI->>OpenCodeGo: Fetch OpenCode Go usage
  PrismClient-->>CLI: Return usage or error
  OpenCodeGo-->>CLI: Return usage or error
  CLI-->>CLI: Print results and aggregate failures
Loading

Possibly related PRs

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/combined-usage

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@codeant-ai codeant-ai Bot added the size:L This PR changes 100-499 lines, ignoring generated files label Aug 10, 2026
@ygpark80
ygpark80 merged commit 3ac1d3c into main Aug 10, 2026
1 check passed
@ygpark80
ygpark80 deleted the feat/combined-usage branch August 10, 2026 06:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L This PR changes 100-499 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant