Skip to content

Rename studio ai command to studio code - #3002

Merged
sejas merged 18 commits into
trunkfrom
stu-1526-rename-studio-ai-to-studio-code
Apr 8, 2026
Merged

Rename studio ai command to studio code#3002
sejas merged 18 commits into
trunkfrom
stu-1526-rename-studio-ai-to-studio-code

Conversation

@sejas

@sejas sejas commented Apr 7, 2026

Copy link
Copy Markdown
Member

Related issues

Proposed Changes

Registers code as the primary CLI command name, with ai kept as hidden alias for backward compatibility. A single binary now handles both studio code and studio ai, so there's no need for a secondary binary (as discussed in #2990 (comment)).

Update system prompt and subcommands to mention "WordPress Studio Code" as the main.
Changed Assistant with Agent in help commands and system prompt.
Changed AI Sessions to code sessions.

Testing Instructions

  • Build the CLI: npm run cli:build
  • Run node apps/cli/dist/cli/main.mjs --help and verify the primary subcommand is code and ai is an alias
  • Run node apps/cli/dist/cli/main.mjs code and verify the AI assistant starts.
  • Run node apps/cli/dist/cli/main.mjs ai and verify the alias still works.
  • Run node apps/cli/dist/cli/main.mjs code sessions list and ... ai sessions list to verify subcommands work under both names.
  • Run tests: npm test -- apps/cli/commands/ai/tests/ai.test.ts
Screenshot 2026-04-08 at 15 21 23 Screenshot 2026-04-07 at 16 27 26

Pre-merge Checklist

  • Have you checked for TypeScript, React or other console errors? (Tests pass, no errors)
Registers `code` as the primary command name with `ai` kept as an
alias for backward compatibility, so a single entry point works for both.

Fixes STU-1526
@sejas sejas self-assigned this Apr 7, 2026
@sejas
sejas marked this pull request as ready for review April 7, 2026 15:39
@sejas
sejas requested review from a team and youknowriad April 7, 2026 15:39

@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 @sejas for tackling this! 🙌

These changes look good to me, and I confirm that both the code and ai commands are working as described. 👍

The ai command is listed as an alias:

Image

Both commands start the code CLI as expected:

code ai
Image Image

And both list the previous sessions the same way too:

Image
Comment thread apps/cli/index.ts Outdated
async ( aiYargs ) => {
const { registerCommand: registerAiCommand } = await import( 'cli/commands/ai' );
registerAiCommand( aiYargs );
aiYargs.command( 'sessions', __( 'Manage AI sessions' ), async ( sessionsYargs ) => {

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.

Nit: maybe we should use "Code sessions" in the messaging here too, to make it canonical with the command?

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.

Good catch, I agree cc/ @sejas

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Changed! I’m not sure whether “code” should be capitalized, so I left it lowercase. I made the changes in all the subcommands too.

aiYargs.command( 'sessions', __( 'Manage code sessions' ), ( sessionsYargs ) => {

studio code --help

Screenshot 2026-04-08 at 14 40 12

studio code sessions --help

Screenshot 2026-04-08 at 14 50 25

studio code sessions list

Screenshot 2026-04-08 at 14 51 37
@Poliuk

Poliuk commented Apr 8, 2026

Copy link
Copy Markdown
Contributor

@sejas is it possible to remove the [aliases: ai] from the command list? If so, please remove it. We are keeping the ai command available only to maintain backward compatibility, but there's no need to surface it in the command list.

It'd also be nice to display a message to the people who are still using studio ai so they know we've renamed the command to code: ⓘ The studio ai command is now studio code.

I also want to change the command descriptions for code and mcp, to use the word "Agent" instead of "Assistant".

Here's my proposal:

  • code -> "AI agent for building WordPress"
  • mcp -> "MCP server for AI agents"
@sejas

sejas commented Apr 8, 2026

Copy link
Copy Markdown
Member Author

On it!

@wpmobilebot

wpmobilebot commented Apr 8, 2026

Copy link
Copy Markdown
Collaborator

📊 Performance Test Results

Comparing 5e295a9 vs trunk

app-size

Metric trunk 5e295a9 Diff Change
App Size (Mac) 1252.12 MB 1252.07 MB 0.05 MB ⚪ 0.0%

site-editor

Metric trunk 5e295a9 Diff Change
load 1907 ms 1864 ms 43 ms ⚪ 0.0%

site-startup

Metric trunk 5e295a9 Diff Change
siteCreation 9135 ms 9151 ms +16 ms ⚪ 0.0%
siteStartup 4948 ms 4942 ms 6 ms ⚪ 0.0%

Results are median values from multiple test runs.

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

@sejas

sejas commented Apr 8, 2026

Copy link
Copy Markdown
Member Author

@sejas is it possible to remove the [aliases: ai] from the command list? If so, please remove it. We are keeping the ai command available only to maintain backward compatibility, but there's no need to surface it in the command list.

It'd also be nice to display a message to the people who are still using studio ai so they know we've renamed the command to code: ⓘ The studio ai command is now studio code.

I also want to change the command descriptions for code and mcp, to use the word "Agent" instead of "Assistant".

Here's my proposal:

  • code -> "AI agent for building WordPress"
  • mcp -> "MCP server for AI agents"

@Poliuk, Done! now studio ai is a hidden command that doesn't appear in --help menu. We also display a "notice" when running studio ai.

studio ai studio code
Screenshot 2026-04-08 at 14 53 20 Screenshot 2026-04-08 at 14 53 31

I also considered adding the same notice when running studio ai --help and other subcommands but it added much more complexity to the code and I think it was not necessary. We could even remove this alias in the future.

@sejas

sejas commented Apr 8, 2026

Copy link
Copy Markdown
Member Author

It's worth mentioning I also changed the Agent identity to say "WordPress Studio Code" which is an "AI agent":

const AGENT_IDENTITY = `You are WordPress Studio Code, the AI agent built into WordPress Studio CLI. Your name is "WordPress Studio Code".`;

@sejas
sejas enabled auto-merge (squash) April 8, 2026 14:15
@sejas
sejas merged commit 8451949 into trunk Apr 8, 2026
10 of 12 checks passed
@sejas
sejas deleted the stu-1526-rename-studio-ai-to-studio-code branch April 8, 2026 14:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

4 participants