Skip to content

Add typed JSON output to app config link - #8603

Draft
gonzaloriestra wants to merge 1 commit into
gonzalo/json-app-config-validatefrom
gonzalo/json-app-config-link
Draft

gonzaloriestra wants to merge 1 commit into
gonzalo/json-app-config-validatefrom
gonzalo/json-app-config-link

Conversation

@gonzaloriestra

@gonzaloriestra gonzaloriestra commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

WHY are these changes introduced?

App configuration linking cannot return a machine-readable result.

WHAT is this pull request doing?

Add --json with the written configuration and available public app metadata. Keep terminal presentation in a presenter and preserve shared linking callers. Optional app fields are omitted when unavailable; secrets and runtime state are excluded. The example shows all supported remote app metadata fields.

Normal output:

shopify.app.toml is now linked to "Example" on Shopify
Using shopify.app.toml as your default config.

JSON output:

{
  "configFile": "/app/shopify.app.toml",
  "configuration": {
    "client_id": "example-key",
    "name": "Example",
    "application_url": "https://example.com",
    "embedded": false,
    "access_scopes": {
      "scopes": "read_products"
    },
    "custom_module": {
      "enabled": true
    }
  },
  "app": {
    "id": "1",
    "title": "Example",
    "apiKey": "example-key",
    "organizationId": "123",
    "appType": "custom",
    "newApp": false,
    "grantedScopes": [
      "read_products"
    ],
    "developmentStorePreviewEnabled": false,
    "applicationUrl": "https://example.com",
    "redirectUrlWhitelist": [],
    "requestedAccessScopes": [
      "read_products"
    ],
    "webhookApiVersion": "2026-07",
    "embedded": false,
    "posEmbedded": false,
    "preferencesUrl": "",
    "gdprWebhooks": {
      "customerDeletionUrl": "",
      "customerDataRequestUrl": "",
      "shopDeletionUrl": ""
    },
    "appProxy": {
      "subPath": "example",
      "subPathPrefix": "apps",
      "url": "https://example.com/proxy"
    },
    "configuration": {
      "client_id": "example-key",
      "name": "Example",
      "application_url": "https://example.com",
      "embedded": false,
      "access_scopes": {
        "scopes": "read_products"
      },
      "custom_module": {
        "enabled": true
      }
    }
  }
}

How to manually test your changes?

pnpm shopify app config link --client-id example-key --file-name staging --force --path /path/to/app
pnpm shopify app config link --client-id example-key --file-name staging --force --path /path/to/app --json
pnpm shopify app config link --json-schema

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 the new public JSON capability

@gonzaloriestra
gonzaloriestra added this pull request to stack #8606 September 21, 2026 08:08
@github-actions github-actions Bot added the Area: @shopify/cli @shopify/cli package issues label Sep 21, 2026
@gonzaloriestra

Copy link
Copy Markdown
Contributor Author

/snapit

@gonzaloriestra
gonzaloriestra force-pushed the gonzalo/json-app-config-link branch from 748636a to 5f38640 Compare September 21, 2026 08:11
@gonzaloriestra

Copy link
Copy Markdown
Contributor Author

/snapit

@github-actions

Copy link
Copy Markdown
Contributor

Differences in type declarations

We detected differences in the type declarations generated by Typescript for this branch compared to the baseline ('main' branch). Please, review them to ensure they are backward-compatible. Here are some important things to keep in mind:

  • Some seemingly private modules might be re-exported through public modules.
  • If the branch is behind main you might see odd diffs, rebase main into this branch.

New type declarations

We found no new type declarations in this PR

Existing type declarations

packages/cli-kit/dist/public/node/testing/output.d.ts
@@ -8,6 +8,19 @@ interface OutputMock {
     error: () => string;
     clear: () => void;
 }
+interface StandardStreamsMock {
+    stdout: () => string;
+    stderr: () => string;
+    restore: () => void;
+}
+/**
+ * Captures writes to stdout and stderr, including console warnings intercepted by Vitest.
+ * Call restore in a finally block. This replaces process globals and must not be used in concurrent tests.
+ * CLI output tests must disable SHOPIFY_UNIT_TEST and reset modules before loading the command.
+ *
+ * @returns Captured output and a function to restore the original writers.
+ */
+export declare function mockAndCaptureStandardStreams(): StandardStreamsMock;
 /**
  * Returns a set of functions to get the outputs ocurred during a test run.
  *

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