Skip to content

Studio Code: make studio code --help more helpful - #3709

Merged
sejas merged 2 commits into
trunkfrom
improve-studio-code-help
Jun 8, 2026
Merged

Studio Code: make studio code --help more helpful#3709
sejas merged 2 commits into
trunkfrom
improve-studio-code-help

Conversation

@sejas

@sejas sejas commented Jun 5, 2026

Copy link
Copy Markdown
Member

Related issues

How AI was used in this PR

AI was used to draft the new help copy and wire up the yargs example()/epilogue() calls; the output was reviewed and iterated manually.

Proposed Changes

studio code --help previously showed only two subcommands and two options, leaving users with no sense of what Studio Code can actually do or where to learn more. This PR makes the help output a real entry point:

  • Adds an Examples section covering the most common invocations (interactive chat, initial message, headless --json turn, listing and resuming sessions).
  • Adds a short epilogue describing what Studio Code does — creating and managing local and remote sites, building themes, writing code, generating content, and publishing to WordPress.com.
  • Links to the Studio Code support doc.
  • Clarifies the default command and sessions descriptions so each line tells the user something new.

All new strings are translatable via __().

Testing Instructions

  1. npm run cli:build
  2. node apps/cli/dist/cli/main.mjs code --help — verify the Examples section, capabilities epilogue, and docs link appear.
  3. node apps/cli/dist/cli/main.mjs code sessions --help — verify the sessions help still lists list, resume, and delete and is unaffected by the epilogue.

Before:

studio code

AI agent for building WordPress sites

Commands:
  studio code [message]     AI agent for building WordPress            [default]
  studio code sessions      Manage code sessions

Positionals:
  message  Initial message to send to the AI agent                      [string]

Options:
  --help  Show help                                                    [boolean]
  --json  Output events as NDJSON to stdout (headless mode)
                                                      [boolean] [default: false]

After:

studio code

AI agent for building WordPress sites

Commands:
  studio code [message]       Start an interactive AI chat to build WordPress
                              sites                                    [default]
  studio code remote-session  Manage the Telegram remote-session daemon
  studio code sessions        List, resume, and delete code sessions

Positionals:
  message  Initial message to send to the AI agent                      [string]

Options:
  --help  Show help                                                    [boolean]
  --json  Output events as NDJSON to stdout (headless mode)
                                                      [boolean] [default: false]

Examples:
  studio code                              Start an interactive chat with the AI
                                           agent
  studio code "Create a portfolio site"    Start the agent with an initial
                                           message
  studio code --json "Add a contact page"  Run a single headless turn, printing
                                           NDJSON events
  studio code sessions list                List previous code sessions
  studio code sessions resume latest       Resume the most recent session

Studio Code is an AI agent that builds WordPress sites: it creates and manages
local and remote sites, builds themes, writes code, generates content, and
publishes to WordPress.com.

Learn more:
https://developer.wordpress.com/docs/developer-tools/studio/studio-code/

Pre-merge Checklist

  • Have you checked for TypeScript, React or other console errors?
@sejas sejas self-assigned this Jun 5, 2026
@sejas
sejas marked this pull request as ready for review June 5, 2026 21:01
@sejas
sejas requested review from nightnei and youknowriad June 5, 2026 21:01
@nightnei

nightnei commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Hm, I got this error. Then tested in trunk - all good. Then again, switched to this branch - the same error. Maybe it's due to sprintf, since I don't see any other changes which can brerak it
throw Error("Calling requirefor \"" + x + "\" in an environment that doesn't expose therequire function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.");
Looks like it's my local issue.

The changes and copy LGTM 👍

@nightnei nightnei left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM 👍
I just haven't managed to test it locally. #3709 (comment)

@wpmobilebot

Copy link
Copy Markdown
Collaborator

📊 Performance Test Results

Comparing 036dfb8 vs trunk

app-size

Metric trunk 036dfb8 Diff Change
App Size (Mac) 1384.35 MB 1384.35 MB +0.00 MB ⚪ 0.0%

site-editor

Metric trunk 036dfb8 Diff Change
load 1660 ms 1617 ms 43 ms ⚪ 0.0%

site-startup

Metric trunk 036dfb8 Diff Change
siteCreation 9032 ms 9024 ms 8 ms ⚪ 0.0%
siteStartup 4403 ms 4404 ms +1 ms ⚪ 0.0%

Results are median values from multiple test runs.

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

@sejas
sejas merged commit 6cdee04 into trunk Jun 8, 2026
11 checks passed
@sejas
sejas deleted the improve-studio-code-help branch June 8, 2026 23:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants