Capturing Shopify CLI 3.x after installing HTTP Toolkit in Windows 10
1. Reference:Capturing Shopify CLI 3.x after installing Fiddler Classic in Windows 10 . Ultimately not realized.
2. Reference:If you’re just looking for a Fiddler-like HTTP debugging tool for Node.js, an open source project called HTTP Toolkit, open a terminal from the application with one click. Start any node CLI/server/script from that terminal. All HTTP or HTTPS requests it sends are automatically proxied, so you can view and rewrite everything. No need to change the code or npm package. Internally, it works by injecting additional js scripts into the startup node process, which hooks require() to automatically reconfigure the proxy settings for you, for each module that doesn’t use the global setting.
3. The HTTP Toolkit allows you to intercept HTTP and HTTPS traffic from almost all HTTP clients. Reference: Intercepting http from node.js . HTTP Toolkit also allows you to intercept servers, scripts, and command-line tools, such as Node.js applications.
4. Click Fresh Terminal. Open a new terminal and intercept all processes and docker containers. as shown in Figure 1
5. Execute the Shopify CLI command in the new terminal. as shown in Figure 2
E:\wwwroot\shopify-theme\theme-20230922>shopify theme list --verbose
2023-10-13T07:29:32.038Z: Running command theme list
2023-10-13T07:29:32.070Z: Ensuring that the user is authenticated with the Theme API with the following scopes:
[]
2023-10-13T07:29:32.071Z: Ensuring that the user is authenticated with the Admin API with the following scopes for the store shuijingwanwq-development.myshopify.com:
[]
2023-10-13T07:29:32.075Z: Getting session store...
2023-10-13T07:29:32.080Z: Validating existing session against the scopes:
[
"openid",
"https://api.shopify.com/auth/shop.admin.graphql",
"https://api.shopify.com/auth/shop.admin.themes",
"https://api.shopify.com/auth/partners.collaborator-relationships.readonly",
"https://api.shopify.com/auth/shop.storefront-renderer.devtools",
"https://api.shopify.com/auth/partners.app.cli.access",
"https://api.shopify.com/auth/destinations.readonly"
]
For applications:
{
"adminApi": {
"scopes": [],
"storeFqdn": "shuijingwanwq-development.myshopify.com"
}
}
2023-10-13T07:29:32.084Z: Sending Identity Introspection request to URL: https://accounts.shopify.com/oauth/introspection
2023-10-13T07:29:32.097Z: Sending POST request to URL https://accounts.shopify.com/oauth/introspection
With request headers:
- User-Agent: Shopify CLI; v=3.49.3
- Keep-Alive: timeout=30
- Sec-CH-UA-PLATFORM: win32
- Content-Type: application/json
2023-10-13T07:29:33.344Z: Request to https://accounts.shopify.com/oauth/introspection completed in 1228 ms
With response headers:
- cache-control: no-cache, no-store, private, must-revalidate, max-age=0
- content-type: application/json; charset=utf-8
- etag: W/"8d18a213b90c24fcf92bf986617a68cd"
- x-request-id: 7044c640-8cc3-41a0-8c0f-d7ee387b56a5
2023-10-13T07:29:33.352Z: The identity token is valid: true
2023-10-13T07:29:33.354Z:
The validation of the token for application/identity completed with the following results:
- It's expired: false
- It's invalid in identity: false
2023-10-13T07:29:34.817Z: Request to https://shuijingwanwq-development.myshopify.com/admin/api/unstable/themes.json?fields=id%2Cname%2Crole%2Cprocessing completed in 1451 ms
With response headers:
- content-type: application/json; charset=utf-8
- x-request-id: d6e39648-7db9-48d4-881e-c523188e9a83
2023-10-13T07:29:34.821Z: Getting development theme...
2023-10-13T07:29:34.824Z: Getting host theme...
name role id
─────────────────────────────────────────────── ───────────────────── ─────────────
Dawn 的更新版副本 [live] #133644189881
Dawn [unpublished] #130440429753
Sense [unpublished] #130698641593
Crave 重命名 [unpublished] #130935947449
Refresh [unpublished] #131376218297
Colorblock [unpublished] #131376251065
Dawn Customize [unpublished] #130580054201
Taste 的更新版副本 的更新版副本 的更新版副本 的更新版副本 的更新版副本 [unpublished] #132350771385
的更新版副本
shopify-theme-dawn-20221011/main [unpublished] #133060722873
Dawn [unpublished] #133474844857
Copy of Studio [unpublished] #133474975929
Dawn (Shopify CLI) 9 [unpublished] #133492932793
Dawn 的副本 的副本 1 [unpublished] #133635932345
Colorblock [unpublished] #130698510521
Taste [unpublished] #130698543289
Craft [unpublished] #130698576057
Development (639b5c-DESKTOP-QLPK8QM) [development] [yours] #134109462713
2023-10-13T07:29:35.161Z:
Running system process:
· Command: ruby -v
· Working directory: E:/wwwroot/shopify-theme/theme-20230922
2023-10-13T07:29:36.486Z: Request to https://monorail-edge.shopifysvc.com/v1/produce completed in 1275 ms
With response headers:
- x-request-id: 56128223-93f8-45c2-bb4e-f5c7abb44863
2023-10-13T07:29:36.488Z: Analytics event sent: {
"command": "theme list",
"time_start": 1697182172041,
"time_end": 1697182175101,
"total_time": 3060,
"success": true,
"cli_version": "3.49.3",
"ruby_version": "3.1.1",
"node_version": "18.18.0",
"is_employee": false,
"uname": "windows amd64",
"env_ci": false,
"env_plugin_installed_any_custom": false,
"env_plugin_installed_shopify": "[\"@shopify/cli\",\"@shopify/plugin-did-you-mean\",\"@shopify/theme\"]",
"env_shell": "cmd.exe",
"env_device_id": "eb479d42673daf065d783e808d3de3b4870a4c02",
"env_cloud": "localhost",
"env_package_manager": "unknown",
"cmd_all_launcher": "unknown",
"cmd_all_topic": "theme",
"cmd_all_plugin": "@shopify/theme",
"cmd_all_verbose": true,
"cmd_all_path_override": false,
"args": "--verbose",
"env_plugin_installed_all": "[\"@shopify/cli\",\"@shopify/plugin-did-you-mean\",\"@shopify/theme\"]",
"metadata": "{\"extraPublic\":{},\"extraSensitive\":{}}"
}
2023-10-13T07:29:36.499Z: Completed command theme list
E:\wwwroot\shopify-theme\theme-20230922>
6. Check the traffic that has been captured in the HTTP Toolkit, which is in line with expectations. The corresponding request already exists:https://shuijingwanwq-development.myshopify.com/admin/api/unstable/themes.json?fields=id%2Cname%2Crole%2Cprocessing, and the response is plain text. as shown in Figure 3
7. For existing terminals, click Existing Terminal, and run the following commands in any PowerShell terminal on this machine to immediately enable interception of all new processes started there. as shown in Figure 4
8. Execute the Shopify CLI command in the existing terminal. View the traffic that has been captured in the HTTP Toolkit, in line with expectations. as shown in Figure 5
PS C:\Users\Lenovo> Invoke-Expression (Invoke-WebRequest http://localhost:8001/ps-setup).Content HTTP Toolkit interception enabled
PS C:\Users\Lenovo> E:
PS E:\> cd .\wwwroot\shopify-theme\theme-20230922\
PS E:\wwwroot\shopify-theme\theme-20230922> shopify theme list
name role id
─────────────────────────────────────────────── ───────────── ─────────────
Dawn 的更新版副本 [live] #133644189881
Dawn [unpublished] #130440429753
Sense [unpublished] #130698641593
Crave 重命名 [unpublished] #130935947449
Refresh [unpublished] #131376218297
Colorblock [unpublished] #131376251065
Dawn Customize [unpublished] #130580054201
Taste 的更新版副本 的更新版副本 的更新版副本 的更新版副本 的更新版副本 的更新版副本 [unpublished] #132350771385
shopify-theme-dawn-20221011/main [unpublished] #133060722873
Dawn [unpublished] #133474844857
Copy of Studio [unpublished] #133474975929
Dawn (Shopify CLI) 9 [unpublished] #133492932793
Dawn 的副本 的副本 1 [unpublished] #133635932345
Colorblock [unpublished] #130698510521
Taste [unpublished] #130698543289
Craft [unpublished] #130698576057
PS E:\wwwroot\shopify-theme\theme-20230922>





1 Response
[…] 15. Configure Wireshark, Edit – Preferences – ProtoCLs – TLS. Decided to put this plan on hold for the time being, because a more suitable plan has been found. Reference:Capturing Shopify CLI 3.x after installing HTTP Toolkit in Windows 10 […]