CLI: promote site subcommands to top level and add config get/set - #3884
Conversation
📊 Performance Test ResultsComparing 3250f1e vs trunk app-size
site-editor
site-startup
Results are median values from multiple test runs. Legend: 🟢 Improvement (faster) | 🔴 Regression (slower) | ⚪ No change (<50ms diff) |
Flatten the `studio site` group so its verbs (create, list, start, stop, delete, status) are available at the top level, and move site settings into a dedicated `config` group (`config get` / `config set`). The `site` group is kept as a hidden alias for backward compatibility. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
95f52f9 to
a6821d5
Compare
bcotrim
left a comment
There was a problem hiding this comment.
Tested and works as described, didn't find any regressions.
One important fix we should make before landing this is to add runtime and file-access to studio config get. studio config set and studio status already have both.
Note: we should be careful with the translation from getSiteRuntime and mode, the option we present to the user is native/sandbox, while internally we have native-php/playground
Also while testing, studio config get outputted a site with an empty domain which I know it is related to custom domain, it seems the label already exists in the code, but it's not being used.
Report runtime as the user-facing mode (native/sandbox) rather than the internal runtime, matching config set and status. Drop the unused label field so the table shows the flag keys. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Thanks for the review! Addressed in 3250f1e:
Updated the studio-cli SKILL.md keys list too. |
Related issues
Related to STU-1850
How AI was used in this PR
This PR was implemented with Claude Code. The CLI command surface was mapped, the registration refactor and the new
config getcommand were authored, tests were written and run, and the docs were updated. The author reviewed the diff, verified the help output andconfig getagainst a real local site, and ran the CLI test suite (167 passing).Proposed Changes
The Studio CLI buried its most common operations under a
sitesub-group, so users had to typestudio site start,studio site list, and so on. This promotes those verbs to the top level —studio create,studio list,studio start,studio stop,studio delete,studio status— making the everyday commands shorter and more discoverable.Site settings move into their own
configgroup:studio config set …replacesstudio site set(same flags).studio config getis new: with no argument it prints all settable settings (--format table|json); with a key (studio config get php) it prints that single value raw, which is convenient for scripting.For backward compatibility the old
studio site …group still works exactly as before — it's just hidden from help. Existing scripts and muscle memory keep working; new output and docs steer people to the top-level forms.The top-level help is also ordered to group related commands sensibly (site management first, then sync, then the rest).
Testing Instructions
npm run cli:buildnode apps/cli/dist/cli/main.mjs --help— verify the top-level commands are listed (andsiteis no longer shown).studio list,studio status --path ~/Studio/<site>.studio config get --path ~/Studio/<site>(table),--format json, and a single key (studio config get php --path …).studio config set --path ~/Studio/<site> --php 8.4.studio site --help,studio site list,studio site set ….npm test -- apps/cli/commands/config apps/cli/commands/site(167 passing).Pre-merge Checklist