Skip to content

Add finite JSON execution to theme console - #8975

Draft
gonzaloriestra wants to merge 1 commit into
mainfrom
gonzalo/theme-console-json
Draft

gonzaloriestra wants to merge 1 commit into
mainfrom
gonzalo/theme-console-json

Conversation

@gonzaloriestra

Copy link
Copy Markdown
Contributor

WHY are these changes introduced?

Agents need to evaluate Liquid commands without driving an interactive terminal.

Fixes https://github.com/shop/issues-develop/issues/24317

WHAT is this pull request doing?

Adds repeatable --input and mutually exclusive --input-file flags to run commands sequentially in one Liquid session and exit. --json requires supplied commands and returns a typed document with ordered results, preserving native values and assignments. Evaluation stops at the first error, retains completed results, and marks remaining inputs skipped.

Finite execution avoids readline and the development-session refresh timer. Without input flags, the command keeps its interactive text interface. Includes schema discovery, generated help/docs, and a minor changeset.

Validated with 87 focused tests, the CLI build, theme type checking, lint, and live development-store checks for repeated inputs, assignments, native values, file input, and failed/skipped results.

How to manually test your changes?

Use a development store with an existing CLI sign-in. From this checkout:

pnpm shopify theme console --store <your-store> --input 'shop.name' --input 'assign name = shop.name' --input 'name | upcase' --json --no-input

Verify that it returns one JSON document, preserves the assignment, and exits. Put one command per line in commands.txt, including a blank line, and run with --input-file ./commands.txt instead of the --input flags.

Run with --input 'shop.name' --input '{{ shop.name }}' --input 'shop.currency' --json --no-input. Verify that the second input fails, the third is skipped, and the exit status is nonzero. Run without input flags or --json to check the interactive console.

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
  • Added a minor changeset for this user-facing feature

@github-actions github-actions Bot added the Area: @shopify/cli @shopify/cli package issues label Oct 21, 2026
@gonzaloriestra gonzaloriestra changed the title [Feature] Add finite JSON execution to theme console Add finite JSON execution to theme console Oct 22, 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

Area: @shopify/cli @shopify/cli package issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant