Skip to content

Blueprints Gallery Library: Add blueprints gallery to CLI - #3503

Merged
katinthehatsite merged 7 commits into
trunkfrom
add/blueprints-gallery-tocli
May 18, 2026
Merged

Blueprints Gallery Library: Add blueprints gallery to CLI#3503
katinthehatsite merged 7 commits into
trunkfrom
add/blueprints-gallery-tocli

Conversation

@katinthehatsite

Copy link
Copy Markdown
Contributor

Related issues

Fixes STU-1737

How AI was used in this PR

It was used to plan and implement the feature.

Proposed Changes

This PR allows using the new Blueprints Gallery through CLI so that you can easily choose and activate different blueprints before creating a site.

Testing Instructions

  • Pull the changes from this branch
  • Build CLI with npm run cli:build
  • Run node apps/cli/dist/cli/main.mjs blueprint list to see the list of available bluerinpts
Screenshot 2026-05-15 at 2 25 54 PM
  • Run node apps/cli/dist/cli/main.mjs blueprint to see how the command works
  • Select a blueprint and run it, for example npm run cli:build && node apps/cli/dist/cli/main.mjs blueprint use woo-shop --name "My Woo Shop" (or whichever path you want)
  • Confirm that the site is successfully created and you can see it in the UI

Pre-merge Checklist

  • Have you checked for TypeScript, React or other console errors?

Copilot AI 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.

Pull request overview

Adds CLI support for browsing and creating sites from the Studio Blueprints Gallery, reusing shared common-library helpers so both the desktop app and CLI can consume the same blueprint schema/bundle logic.

Changes:

  • Introduces studio blueprint list and studio blueprint use CLI commands (with tests).
  • Adds a shared fetchStudioBlueprints() API client + Zod schema in @studio/common.
  • Extracts blueprint bundle download/extract + cleanup into @studio/common and wires Studio IPC to use it.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tools/common/logger-actions.ts Adds logger action enum for blueprint CLI operations.
tools/common/lib/tests/studio-blueprints-api.test.ts Adds Vitest coverage for fetchStudioBlueprints() behavior and validation.
tools/common/lib/studio-blueprints-api.ts Adds shared Blueprints Gallery API fetcher and Blueprint Zod schema/type.
tools/common/lib/blueprint-bundle.ts Adds shared helpers to download/extract blueprint bundles and clean temp dirs.
apps/studio/src/stores/wpcom-api.ts Reuses shared blueprintSchema/Blueprint instead of defining them locally.
apps/studio/src/ipc-handlers.ts Switches blueprint bundle handling to shared @studio/common/lib/blueprint-bundle helpers.
apps/cli/index.ts Registers top-level blueprint command group and lazily loads subcommands.
apps/cli/commands/site/create.ts Exports CreateCommandOptions type for reuse.
apps/cli/commands/blueprint/use.ts Implements interactive/non-interactive “use blueprint to create site” flow (incl. bundle handling).
apps/cli/commands/blueprint/tests/use.test.ts Adds unit tests for blueprint “use” command behavior.
apps/cli/commands/blueprint/list.ts Implements blueprint list with table/json output and optional category filtering.
apps/cli/commands/blueprint/tests/list.test.ts Adds unit tests for blueprint “list” command behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread apps/cli/commands/blueprint/use.ts Outdated
Comment thread apps/cli/commands/blueprint/use.ts
Comment thread apps/cli/commands/blueprint/tests/use.test.ts Outdated
@wpmobilebot

wpmobilebot commented May 15, 2026

Copy link
Copy Markdown
Collaborator

📊 Performance Test Results

Comparing a433377 vs trunk

app-size

Metric trunk a433377 Diff Change
App Size (Mac) 1429.70 MB 1429.73 MB +0.02 MB ⚪ 0.0%

site-editor

Metric trunk a433377 Diff Change
load 1463 ms 1490 ms +27 ms ⚪ 0.0%

site-startup

Metric trunk a433377 Diff Change
siteCreation 8565 ms 8623 ms +58 ms 🔴 0.7%
siteStartup 4927 ms 4931 ms +4 ms ⚪ 0.0%

Results are median values from multiple test runs.

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

@katinthehatsite
katinthehatsite merged commit 173a2d7 into trunk May 18, 2026
12 checks passed
@katinthehatsite
katinthehatsite deleted the add/blueprints-gallery-tocli branch May 18, 2026 09:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants