Skip to content

Add typed JSON output to theme pull - #8648

Draft
gonzaloriestra wants to merge 1 commit into
gonzalo/json-theme-pushfrom
gonzalo/json-theme-pull
Draft

gonzaloriestra wants to merge 1 commit into
gonzalo/json-theme-pushfrom
gonzalo/json-theme-pull

Conversation

@gonzaloriestra

@gonzaloriestra gonzaloriestra commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

WHY are these changes introduced?

Related to https://github.com/shop/issues-develop/issues/23693

theme pull downloads files but does not expose a typed, discoverable JSON result for automation.

WHAT is this pull request doing?

Add --json with the local download path, remote theme metadata, and preview/editor links. Execution returns typed data; a presenter retains the existing success banner. The exported pull() adapter keeps its text behavior. Download progress uses typed side events in JSON mode.

Normal output:

The theme 'MyTheme' (#1) has been pulled.

Matching JSON:

{
  "path": "/path/to/theme",
  "theme": {
    "id": 1,
    "name": "MyTheme",
    "role": "unpublished",
    "processing": false,
    "shop": "example.myshopify.com",
    "editor_url": "https://example.myshopify.com/admin/themes/1/editor",
    "preview_url": "https://example.myshopify.com?preview_theme_id=1"
  }
}

Optional src metadata is included when available. The internal createdAtRuntime flag is not part of the public result.

Uses the draft multi-environment contract from the preceding PR: one array in requested order, environment names on successful results, failures on stderr, [] when none succeed, and unchanged exit behavior. Tests use real temporary files for downloads, deletion, and --nodelete.

How to manually test your changes?

pnpm shopify theme pull --help
pnpm shopify theme pull --json-schema
pnpm shopify theme pull --store example.myshopify.com --theme 1 --path ./theme --json
pnpm shopify theme pull --store example.myshopify.com --theme 1 --path ./theme --nodelete --json
pnpm shopify theme pull --environment staging --environment production --force --json

Checklist

  • I've considered possible cross-platform impacts (Mac, Linux, Windows)
  • I've considered possible documentation changes
  • I've considered analytics changes to measure impact
  • A single changeset for all theme migrations is added in the last PR, #8643.

@gonzaloriestra
gonzaloriestra added this pull request to stack #8650 September 24, 2026 09:31
@github-actions github-actions Bot added shopify.dev preview Area: @shopify/cli @shopify/cli package issues labels Sep 24, 2026
@gonzaloriestra
gonzaloriestra removed this pull request from stack #8650 September 24, 2026 10:04
@gonzaloriestra
gonzaloriestra added this pull request to stack #8655 September 24, 2026 10:05
@github-actions github-actions Bot added no-changelog This PR doesn't include a changeset entry. Is an internal only change not relevant to end users. and removed Area: @shopify/cli @shopify/cli package issues labels Sep 24, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-changelog This PR doesn't include a changeset entry. Is an internal only change not relevant to end users. shopify.dev preview

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant