Skip to content

Add a /credits command so CLI users can check their balance and buy more - #4695

Draft
nightnei wants to merge 3 commits into
trunkfrom
stu-2327-add-a-credits-slash-command
Draft

Add a /credits command so CLI users can check their balance and buy more#4695
nightnei wants to merge 3 commits into
trunkfrom
stu-2327-add-a-credits-slash-command

Conversation

@nightnei

@nightnei nightnei commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Fixes STU-2327

How AI was used in this PR

Assisted

Proposed Changes

With this PR we are adding /credits command to see info about remaining balance and top-up options

Testing Instructions

  1. npm run cli:build && node apps/cli/dist/cli/main.mjs code
  2. Type /credits. Expect your balance, then a picker listing every priced top-up:
    Screenshot 2026-08-26 at 15 19 55
  3. Press Enter on one — checkout opens at that quantity.
  4. Press Esc — /credits are closed
  5. /logout, then /credits — expect the /login prompt.
  6. Exhaust credits and send a prompt:
    Screenshot 2026-08-26 at 15 22 35

@nightnei nightnei self-assigned this Aug 26, 2026
@nightnei
nightnei requested review from a team and gcsecsey August 26, 2026 14:22
@wpmobilebot

wpmobilebot commented Aug 26, 2026

Copy link
Copy Markdown
Collaborator

📊 Performance Test Results

Comparing e7fe40b vs trunk

app-size

Metric trunk e7fe40b Diff Change
App Size (Mac) 1422.09 MB 1422.08 MB 0.00 MB ⚪ 0.0%

site-editor

Metric trunk e7fe40b Diff Change
load 1189 ms 1198 ms +9 ms ⚪ 0.0%

site-startup

Metric trunk e7fe40b Diff Change
siteCreation 7530 ms 7519 ms 11 ms ⚪ 0.0%
siteStartup 3367 ms 3367 ms 0 ms ⚪ 0.0%

Results are median values from multiple test runs.

Legend: 🟢 Improvement (faster) | 🔴 Regression (slower) | ⚪ No change (<50ms diff)

@gcsecsey gcsecsey left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks @nightnei for tackling this! Changes LGTM and work well.

State Output
/credits Image
Hitting Enter Image
Hitting Esc Image
Using /credits while logged out Image
Having run out of credits Image

Comment thread apps/cli/ai/ui.ts Outdated
@Poliuk
Poliuk marked this pull request as draft August 27, 2026 21:59
@Poliuk

Poliuk commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

@nightnei in the 6 - Exhaust credits and send a prompt: let's remove the "or use the link below: http://wordpress.com/checkout/wpcom/studio-code-ai-credits:-q-100000" part, as that will limit visibility of the other top-up options.

cc/ @gcsecsey

nightnei and others added 3 commits August 31, 2026 14:28
@nightnei
nightnei force-pushed the stu-2327-add-a-credits-slash-command branch from e7fe40b to 2ff3493 Compare August 31, 2026 13:28
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.

4 participants