shop-cli 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +392 -0
- package/bin/shop-cli.js +17 -0
- package/bin/shop.js +16 -0
- package/dist/adminClient.d.ts +34 -0
- package/dist/adminClient.js +144 -0
- package/dist/cli/client.d.ts +10 -0
- package/dist/cli/client.js +56 -0
- package/dist/cli/command.d.ts +5 -0
- package/dist/cli/command.js +62 -0
- package/dist/cli/errors.d.ts +4 -0
- package/dist/cli/errors.js +35 -0
- package/dist/cli/gid.d.ts +3 -0
- package/dist/cli/gid.js +42 -0
- package/dist/cli/globalFlags.d.ts +15 -0
- package/dist/cli/globalFlags.js +100 -0
- package/dist/cli/headers.d.ts +2 -0
- package/dist/cli/headers.js +79 -0
- package/dist/cli/help/format.d.ts +8 -0
- package/dist/cli/help/format.js +78 -0
- package/dist/cli/help/registry.d.ts +5 -0
- package/dist/cli/help/registry.js +5651 -0
- package/dist/cli/help/render.d.ts +7 -0
- package/dist/cli/help/render.js +352 -0
- package/dist/cli/help/spec.d.ts +39 -0
- package/dist/cli/help/spec.js +17 -0
- package/dist/cli/input.d.ts +9 -0
- package/dist/cli/input.js +104 -0
- package/dist/cli/introspection/deprecations.d.ts +1 -0
- package/dist/cli/introspection/deprecations.js +83 -0
- package/dist/cli/introspection/format.d.ts +6 -0
- package/dist/cli/introspection/format.js +63 -0
- package/dist/cli/introspection/index.d.ts +14 -0
- package/dist/cli/introspection/index.js +89 -0
- package/dist/cli/introspection/resources.d.ts +1 -0
- package/dist/cli/introspection/resources.js +127 -0
- package/dist/cli/output/computedFields.d.ts +39 -0
- package/dist/cli/output/computedFields.js +104 -0
- package/dist/cli/output.d.ts +37 -0
- package/dist/cli/output.js +332 -0
- package/dist/cli/router.d.ts +29 -0
- package/dist/cli/router.js +480 -0
- package/dist/cli/selection/buildAllSelection.d.ts +13 -0
- package/dist/cli/selection/buildAllSelection.js +108 -0
- package/dist/cli/selection/graphqlSelection.d.ts +5 -0
- package/dist/cli/selection/graphqlSelection.js +301 -0
- package/dist/cli/selection/select.d.ts +13 -0
- package/dist/cli/selection/select.js +136 -0
- package/dist/cli/selection/stripDeprecated.d.ts +2 -0
- package/dist/cli/selection/stripDeprecated.js +63 -0
- package/dist/cli/userErrors.d.ts +4 -0
- package/dist/cli/userErrors.js +41 -0
- package/dist/cli/verbs/_shared.d.ts +38 -0
- package/dist/cli/verbs/_shared.js +180 -0
- package/dist/cli/verbs/abandoned-checkouts.d.ts +6 -0
- package/dist/cli/verbs/abandoned-checkouts.js +259 -0
- package/dist/cli/verbs/app-billing.d.ts +6 -0
- package/dist/cli/verbs/app-billing.js +452 -0
- package/dist/cli/verbs/apps.d.ts +6 -0
- package/dist/cli/verbs/apps.js +296 -0
- package/dist/cli/verbs/articles.d.ts +6 -0
- package/dist/cli/verbs/articles.js +251 -0
- package/dist/cli/verbs/backup.d.ts +6 -0
- package/dist/cli/verbs/backup.js +94 -0
- package/dist/cli/verbs/blogs.d.ts +6 -0
- package/dist/cli/verbs/blogs.js +273 -0
- package/dist/cli/verbs/bulk-operations.d.ts +6 -0
- package/dist/cli/verbs/bulk-operations.js +272 -0
- package/dist/cli/verbs/business-entities.d.ts +6 -0
- package/dist/cli/verbs/business-entities.js +102 -0
- package/dist/cli/verbs/carrier-services.d.ts +6 -0
- package/dist/cli/verbs/carrier-services.js +195 -0
- package/dist/cli/verbs/cart-transforms.d.ts +6 -0
- package/dist/cli/verbs/cart-transforms.js +141 -0
- package/dist/cli/verbs/cash-tracking.d.ts +6 -0
- package/dist/cli/verbs/cash-tracking.js +118 -0
- package/dist/cli/verbs/catalogs.d.ts +6 -0
- package/dist/cli/verbs/catalogs.js +267 -0
- package/dist/cli/verbs/channels.d.ts +6 -0
- package/dist/cli/verbs/channels.js +120 -0
- package/dist/cli/verbs/checkout-branding.d.ts +6 -0
- package/dist/cli/verbs/checkout-branding.js +144 -0
- package/dist/cli/verbs/checkout-profiles.d.ts +6 -0
- package/dist/cli/verbs/checkout-profiles.js +124 -0
- package/dist/cli/verbs/collections.d.ts +6 -0
- package/dist/cli/verbs/collections.js +485 -0
- package/dist/cli/verbs/comments.d.ts +6 -0
- package/dist/cli/verbs/comments.js +160 -0
- package/dist/cli/verbs/companies.d.ts +6 -0
- package/dist/cli/verbs/companies.js +313 -0
- package/dist/cli/verbs/company-contacts.d.ts +6 -0
- package/dist/cli/verbs/company-contacts.js +314 -0
- package/dist/cli/verbs/company-locations.d.ts +6 -0
- package/dist/cli/verbs/company-locations.js +467 -0
- package/dist/cli/verbs/customer-account-pages.d.ts +6 -0
- package/dist/cli/verbs/customer-account-pages.js +97 -0
- package/dist/cli/verbs/customer-payment-methods.d.ts +6 -0
- package/dist/cli/verbs/customer-payment-methods.js +358 -0
- package/dist/cli/verbs/customer-privacy.d.ts +6 -0
- package/dist/cli/verbs/customer-privacy.js +167 -0
- package/dist/cli/verbs/customer-segments.d.ts +6 -0
- package/dist/cli/verbs/customer-segments.js +193 -0
- package/dist/cli/verbs/customers.d.ts +6 -0
- package/dist/cli/verbs/customers.js +656 -0
- package/dist/cli/verbs/delegate-tokens.d.ts +6 -0
- package/dist/cli/verbs/delegate-tokens.js +95 -0
- package/dist/cli/verbs/delivery-customizations.d.ts +6 -0
- package/dist/cli/verbs/delivery-customizations.js +205 -0
- package/dist/cli/verbs/delivery-profile-locations.d.ts +6 -0
- package/dist/cli/verbs/delivery-profile-locations.js +90 -0
- package/dist/cli/verbs/delivery-profiles.d.ts +6 -0
- package/dist/cli/verbs/delivery-profiles.js +207 -0
- package/dist/cli/verbs/delivery-promises.d.ts +6 -0
- package/dist/cli/verbs/delivery-promises.js +262 -0
- package/dist/cli/verbs/delivery-settings.d.ts +6 -0
- package/dist/cli/verbs/delivery-settings.js +85 -0
- package/dist/cli/verbs/discount-nodes.d.ts +6 -0
- package/dist/cli/verbs/discount-nodes.js +169 -0
- package/dist/cli/verbs/discount-redeem-codes.d.ts +6 -0
- package/dist/cli/verbs/discount-redeem-codes.js +102 -0
- package/dist/cli/verbs/discount-saved-searches.d.ts +6 -0
- package/dist/cli/verbs/discount-saved-searches.js +113 -0
- package/dist/cli/verbs/discounts-automatic.d.ts +6 -0
- package/dist/cli/verbs/discounts-automatic.js +475 -0
- package/dist/cli/verbs/discounts-code.d.ts +6 -0
- package/dist/cli/verbs/discounts-code.js +523 -0
- package/dist/cli/verbs/disputes.d.ts +6 -0
- package/dist/cli/verbs/disputes.js +154 -0
- package/dist/cli/verbs/draft-orders.d.ts +6 -0
- package/dist/cli/verbs/draft-orders.js +429 -0
- package/dist/cli/verbs/events.d.ts +6 -0
- package/dist/cli/verbs/events.js +182 -0
- package/dist/cli/verbs/file-saved-searches.d.ts +6 -0
- package/dist/cli/verbs/file-saved-searches.js +83 -0
- package/dist/cli/verbs/files.d.ts +6 -0
- package/dist/cli/verbs/files.js +213 -0
- package/dist/cli/verbs/finance.d.ts +6 -0
- package/dist/cli/verbs/finance.js +115 -0
- package/dist/cli/verbs/flow.d.ts +6 -0
- package/dist/cli/verbs/flow.js +94 -0
- package/dist/cli/verbs/fulfillment-constraint-rules.d.ts +6 -0
- package/dist/cli/verbs/fulfillment-constraint-rules.js +139 -0
- package/dist/cli/verbs/fulfillment-orders.d.ts +6 -0
- package/dist/cli/verbs/fulfillment-orders.js +674 -0
- package/dist/cli/verbs/fulfillment-services.d.ts +6 -0
- package/dist/cli/verbs/fulfillment-services.js +212 -0
- package/dist/cli/verbs/fulfillments.d.ts +6 -0
- package/dist/cli/verbs/fulfillments.js +273 -0
- package/dist/cli/verbs/gift-cards.d.ts +6 -0
- package/dist/cli/verbs/gift-cards.js +359 -0
- package/dist/cli/verbs/graphql.d.ts +14 -0
- package/dist/cli/verbs/graphql.js +285 -0
- package/dist/cli/verbs/inventory-items.d.ts +6 -0
- package/dist/cli/verbs/inventory-items.js +164 -0
- package/dist/cli/verbs/inventory-shipments.d.ts +6 -0
- package/dist/cli/verbs/inventory-shipments.js +276 -0
- package/dist/cli/verbs/inventory-transfers.d.ts +6 -0
- package/dist/cli/verbs/inventory-transfers.js +396 -0
- package/dist/cli/verbs/inventory.d.ts +6 -0
- package/dist/cli/verbs/inventory.js +551 -0
- package/dist/cli/verbs/locales.d.ts +6 -0
- package/dist/cli/verbs/locales.js +61 -0
- package/dist/cli/verbs/locations.d.ts +6 -0
- package/dist/cli/verbs/locations.js +385 -0
- package/dist/cli/verbs/market-localizations.d.ts +6 -0
- package/dist/cli/verbs/market-localizations.js +291 -0
- package/dist/cli/verbs/market-web-presences.d.ts +6 -0
- package/dist/cli/verbs/market-web-presences.js +139 -0
- package/dist/cli/verbs/marketing-activities.d.ts +6 -0
- package/dist/cli/verbs/marketing-activities.js +353 -0
- package/dist/cli/verbs/marketing-events.d.ts +6 -0
- package/dist/cli/verbs/marketing-events.js +132 -0
- package/dist/cli/verbs/markets.d.ts +6 -0
- package/dist/cli/verbs/markets.js +324 -0
- package/dist/cli/verbs/menus.d.ts +6 -0
- package/dist/cli/verbs/menus.js +251 -0
- package/dist/cli/verbs/metafield-definition-tools.d.ts +6 -0
- package/dist/cli/verbs/metafield-definition-tools.js +289 -0
- package/dist/cli/verbs/metafield-definitions.d.ts +6 -0
- package/dist/cli/verbs/metafield-definitions.js +240 -0
- package/dist/cli/verbs/metafields.d.ts +6 -0
- package/dist/cli/verbs/metafields.js +112 -0
- package/dist/cli/verbs/metaobject-definition-tools.d.ts +6 -0
- package/dist/cli/verbs/metaobject-definition-tools.js +83 -0
- package/dist/cli/verbs/metaobject-definitions.d.ts +6 -0
- package/dist/cli/verbs/metaobject-definitions.js +176 -0
- package/dist/cli/verbs/metaobjects.d.ts +6 -0
- package/dist/cli/verbs/metaobjects.js +297 -0
- package/dist/cli/verbs/mobile-platform-applications.d.ts +6 -0
- package/dist/cli/verbs/mobile-platform-applications.js +247 -0
- package/dist/cli/verbs/order-edit.d.ts +6 -0
- package/dist/cli/verbs/order-edit.js +596 -0
- package/dist/cli/verbs/orders.d.ts +6 -0
- package/dist/cli/verbs/orders.js +781 -0
- package/dist/cli/verbs/pages.d.ts +6 -0
- package/dist/cli/verbs/pages.js +234 -0
- package/dist/cli/verbs/payment-customizations.d.ts +6 -0
- package/dist/cli/verbs/payment-customizations.js +193 -0
- package/dist/cli/verbs/payment-terms.d.ts +6 -0
- package/dist/cli/verbs/payment-terms.js +228 -0
- package/dist/cli/verbs/point-of-sale.d.ts +6 -0
- package/dist/cli/verbs/point-of-sale.js +57 -0
- package/dist/cli/verbs/price-lists.d.ts +6 -0
- package/dist/cli/verbs/price-lists.js +426 -0
- package/dist/cli/verbs/product-feeds.d.ts +6 -0
- package/dist/cli/verbs/product-feeds.js +187 -0
- package/dist/cli/verbs/product-variants.d.ts +6 -0
- package/dist/cli/verbs/product-variants.js +388 -0
- package/dist/cli/verbs/products.d.ts +6 -0
- package/dist/cli/verbs/products.js +1257 -0
- package/dist/cli/verbs/publications.d.ts +6 -0
- package/dist/cli/verbs/publications.js +256 -0
- package/dist/cli/verbs/publishables.d.ts +6 -0
- package/dist/cli/verbs/publishables.js +73 -0
- package/dist/cli/verbs/refunds.d.ts +6 -0
- package/dist/cli/verbs/refunds.js +226 -0
- package/dist/cli/verbs/resource-feedback.d.ts +6 -0
- package/dist/cli/verbs/resource-feedback.js +119 -0
- package/dist/cli/verbs/returnable-fulfillments.d.ts +6 -0
- package/dist/cli/verbs/returnable-fulfillments.js +102 -0
- package/dist/cli/verbs/returns.d.ts +6 -0
- package/dist/cli/verbs/returns.js +506 -0
- package/dist/cli/verbs/reverse-deliveries.d.ts +6 -0
- package/dist/cli/verbs/reverse-deliveries.js +203 -0
- package/dist/cli/verbs/reverse-fulfillment-orders.d.ts +6 -0
- package/dist/cli/verbs/reverse-fulfillment-orders.js +157 -0
- package/dist/cli/verbs/saved-searches.d.ts +6 -0
- package/dist/cli/verbs/saved-searches.js +150 -0
- package/dist/cli/verbs/script-tags.d.ts +6 -0
- package/dist/cli/verbs/script-tags.js +179 -0
- package/dist/cli/verbs/segments.d.ts +6 -0
- package/dist/cli/verbs/segments.js +343 -0
- package/dist/cli/verbs/selling-plan-group-products.d.ts +6 -0
- package/dist/cli/verbs/selling-plan-group-products.js +115 -0
- package/dist/cli/verbs/selling-plan-groups.d.ts +6 -0
- package/dist/cli/verbs/selling-plan-groups.js +208 -0
- package/dist/cli/verbs/server-pixels.d.ts +6 -0
- package/dist/cli/verbs/server-pixels.js +172 -0
- package/dist/cli/verbs/shipping-packages.d.ts +6 -0
- package/dist/cli/verbs/shipping-packages.js +107 -0
- package/dist/cli/verbs/shop-policies.d.ts +6 -0
- package/dist/cli/verbs/shop-policies.js +91 -0
- package/dist/cli/verbs/shop-utils.d.ts +6 -0
- package/dist/cli/verbs/shop-utils.js +147 -0
- package/dist/cli/verbs/shop.d.ts +6 -0
- package/dist/cli/verbs/shop.js +177 -0
- package/dist/cli/verbs/shopify-functions.d.ts +6 -0
- package/dist/cli/verbs/shopify-functions.js +127 -0
- package/dist/cli/verbs/shopify-payments.d.ts +6 -0
- package/dist/cli/verbs/shopify-payments.js +111 -0
- package/dist/cli/verbs/staff.d.ts +6 -0
- package/dist/cli/verbs/staff.js +127 -0
- package/dist/cli/verbs/staged-uploads.d.ts +6 -0
- package/dist/cli/verbs/staged-uploads.js +128 -0
- package/dist/cli/verbs/store-credit.d.ts +6 -0
- package/dist/cli/verbs/store-credit.js +209 -0
- package/dist/cli/verbs/storefront-access-tokens.d.ts +6 -0
- package/dist/cli/verbs/storefront-access-tokens.js +183 -0
- package/dist/cli/verbs/subscription-billing-cycles.d.ts +6 -0
- package/dist/cli/verbs/subscription-billing-cycles.js +391 -0
- package/dist/cli/verbs/subscription-billing.d.ts +6 -0
- package/dist/cli/verbs/subscription-billing.js +391 -0
- package/dist/cli/verbs/subscription-contracts.d.ts +6 -0
- package/dist/cli/verbs/subscription-contracts.js +391 -0
- package/dist/cli/verbs/subscription-drafts.d.ts +6 -0
- package/dist/cli/verbs/subscription-drafts.js +315 -0
- package/dist/cli/verbs/tags.d.ts +6 -0
- package/dist/cli/verbs/tags.js +73 -0
- package/dist/cli/verbs/tax.d.ts +6 -0
- package/dist/cli/verbs/tax.js +114 -0
- package/dist/cli/verbs/taxonomy.d.ts +6 -0
- package/dist/cli/verbs/taxonomy.js +99 -0
- package/dist/cli/verbs/tender-transactions.d.ts +6 -0
- package/dist/cli/verbs/tender-transactions.js +105 -0
- package/dist/cli/verbs/themes.d.ts +6 -0
- package/dist/cli/verbs/themes.js +297 -0
- package/dist/cli/verbs/translations.d.ts +6 -0
- package/dist/cli/verbs/translations.js +221 -0
- package/dist/cli/verbs/types.d.ts +4 -0
- package/dist/cli/verbs/types.js +224 -0
- package/dist/cli/verbs/url-redirects.d.ts +6 -0
- package/dist/cli/verbs/url-redirects.js +407 -0
- package/dist/cli/verbs/validations.d.ts +6 -0
- package/dist/cli/verbs/validations.js +181 -0
- package/dist/cli/verbs/web-pixels.d.ts +6 -0
- package/dist/cli/verbs/web-pixels.js +145 -0
- package/dist/cli/verbs/web-presences.d.ts +6 -0
- package/dist/cli/verbs/web-presences.js +186 -0
- package/dist/cli/verbs/webhooks.d.ts +6 -0
- package/dist/cli/verbs/webhooks.js +336 -0
- package/dist/cli/workflows/files/stagedUploads.d.ts +28 -0
- package/dist/cli/workflows/files/stagedUploads.js +175 -0
- package/dist/cli/workflows/inventory/resolveInventoryItemId.d.ts +6 -0
- package/dist/cli/workflows/inventory/resolveInventoryItemId.js +59 -0
- package/dist/cli/workflows/productVariants/upsert.d.ts +8 -0
- package/dist/cli/workflows/productVariants/upsert.js +110 -0
- package/dist/cli/workflows/products/metafieldsUpsert.d.ts +6 -0
- package/dist/cli/workflows/products/metafieldsUpsert.js +94 -0
- package/dist/cli/workflows/products/publishablePublish.d.ts +21 -0
- package/dist/cli/workflows/products/publishablePublish.js +131 -0
- package/dist/cli/workflows/publications/resolvePublicationId.d.ts +17 -0
- package/dist/cli/workflows/publications/resolvePublicationId.js +93 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +152 -0
- package/dist/defaults.d.ts +2 -0
- package/dist/defaults.js +38 -0
- package/dist/generated/admin-2026-04/index.d.ts +25 -0
- package/dist/generated/admin-2026-04/index.js +70 -0
- package/dist/generated/admin-2026-04/runtime/batcher.d.ts +105 -0
- package/dist/generated/admin-2026-04/runtime/batcher.js +203 -0
- package/dist/generated/admin-2026-04/runtime/createClient.d.ts +17 -0
- package/dist/generated/admin-2026-04/runtime/createClient.js +59 -0
- package/dist/generated/admin-2026-04/runtime/error.d.ts +18 -0
- package/dist/generated/admin-2026-04/runtime/error.js +44 -0
- package/dist/generated/admin-2026-04/runtime/fetcher.d.ts +10 -0
- package/dist/generated/admin-2026-04/runtime/fetcher.js +104 -0
- package/dist/generated/admin-2026-04/runtime/generateGraphqlOperation.d.ts +30 -0
- package/dist/generated/admin-2026-04/runtime/generateGraphqlOperation.js +191 -0
- package/dist/generated/admin-2026-04/runtime/index.d.ts +11 -0
- package/dist/generated/admin-2026-04/runtime/index.js +46 -0
- package/dist/generated/admin-2026-04/runtime/linkTypeMap.d.ts +9 -0
- package/dist/generated/admin-2026-04/runtime/linkTypeMap.js +142 -0
- package/dist/generated/admin-2026-04/runtime/typeSelection.d.ts +28 -0
- package/dist/generated/admin-2026-04/runtime/typeSelection.js +17 -0
- package/dist/generated/admin-2026-04/runtime/types.d.ts +55 -0
- package/dist/generated/admin-2026-04/runtime/types.js +17 -0
- package/dist/generated/admin-2026-04/schema.d.ts +102240 -0
- package/dist/generated/admin-2026-04/schema.graphql +91596 -0
- package/dist/generated/admin-2026-04/schema.js +20322 -0
- package/dist/generated/admin-2026-04/types.d.ts +24224 -0
- package/dist/generated/admin-2026-04/types.js +62299 -0
- package/dist/generated/help/schema-help.d.ts +30 -0
- package/dist/generated/help/schema-help.js +61833 -0
- package/dist/graphqlValidator.d.ts +17 -0
- package/dist/graphqlValidator.js +84 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +23 -0
- package/package.json +65 -0
- package/schema/2026-04.graphql +61256 -0
- package/schema/2026-04.introspection.json +1 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Botanica Studios
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,392 @@
|
|
|
1
|
+
# shop-cli
|
|
2
|
+
|
|
3
|
+
A command-line interface for the Shopify Admin GraphQL API.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
Run directly with npx:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npx shop-cli
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Or install globally:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm install -g shop-cli
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Then run:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
shop
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Usage
|
|
26
|
+
|
|
27
|
+
```
|
|
28
|
+
shop <resource> <verb> [flags]
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### Help command name
|
|
32
|
+
|
|
33
|
+
The CLI’s help output (and pagination hints) uses the command that invoked it (`shop` or `shop-cli`). Override it with `SHOP_CLI_COMMAND`:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
SHOP_CLI_COMMAND=shopcli shop --help
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Documentation
|
|
40
|
+
|
|
41
|
+
The CLI is self-documenting. Point your agent at it for context:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
shop # High-level overview of all resources
|
|
45
|
+
shop --help # Same as above
|
|
46
|
+
|
|
47
|
+
shop products # Detailed docs for a specific resource
|
|
48
|
+
shop products --help # Same as above
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Authentication
|
|
52
|
+
|
|
53
|
+
Authentication requires a Shopify access token and shop domain. These can be provided via environment variables or command-line flags.
|
|
54
|
+
|
|
55
|
+
### Environment Variables
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
export SHOPIFY_SHOP="your-shop.myshopify.com"
|
|
59
|
+
export SHOPIFY_ACCESS_TOKEN="shpat_xxxxx"
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### Command-line Flags
|
|
63
|
+
|
|
64
|
+
Flags override environment variables:
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
shop products list --shop your-shop.myshopify.com --access-token shpat_xxxxx
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### Custom GraphQL Endpoint
|
|
71
|
+
|
|
72
|
+
For proxies or custom endpoints:
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
shop products list --graphql-endpoint https://your-proxy.example.com/graphql
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Or via environment variable:
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
export GRAPHQL_ENDPOINT="https://your-proxy.example.com/graphql"
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### Custom Headers
|
|
85
|
+
|
|
86
|
+
Add request headers via repeatable `--header` flags:
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
shop products list --header X-Foo=bar --header "X-Bar: baz"
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Or via environment variable (JSON object):
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
export SHOPIFY_HEADERS='{"X-Foo":"bar","X-Bar":"baz"}'
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
## Output Formats
|
|
99
|
+
|
|
100
|
+
Control output format with `--format`:
|
|
101
|
+
|
|
102
|
+
| Format | Description |
|
|
103
|
+
| ---------- | -------------------------------------------------------- |
|
|
104
|
+
| `json` | Pretty-printed JSON (default) |
|
|
105
|
+
| `jsonl` | JSON Lines - one JSON object per line, useful for piping |
|
|
106
|
+
| `table` | Markdown table format |
|
|
107
|
+
| `raw` | Compact JSON without formatting |
|
|
108
|
+
| `markdown` | Structured markdown with headings |
|
|
109
|
+
|
|
110
|
+
Examples:
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
shop products list --first 5 --format table
|
|
114
|
+
shop products list --first 10 --format jsonl | jq '.title'
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
## Views
|
|
118
|
+
|
|
119
|
+
Control which fields are returned with `--view`:
|
|
120
|
+
|
|
121
|
+
| View | Description |
|
|
122
|
+
| --------- | ------------------------------------------------------ |
|
|
123
|
+
| `summary` | Key fields for quick overview (default) |
|
|
124
|
+
| `ids` | Minimal response - just IDs |
|
|
125
|
+
| `full` | Extended field set with more details |
|
|
126
|
+
| `raw` | Empty base selection - use with `--select`/`--selection` |
|
|
127
|
+
| `all` | All available fields (auto-prunes access-denied fields) |
|
|
128
|
+
|
|
129
|
+
### Customizing Field Selection
|
|
130
|
+
|
|
131
|
+
Add fields to the base view with `--select`:
|
|
132
|
+
|
|
133
|
+
```bash
|
|
134
|
+
shop products list --select seo.title --select seo.description
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
Include connections when using `--view all`:
|
|
138
|
+
|
|
139
|
+
```bash
|
|
140
|
+
shop products get --id 123 --view all --include variants --include images
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
Override selection entirely with raw GraphQL:
|
|
144
|
+
|
|
145
|
+
```bash
|
|
146
|
+
shop products list --selection "{ id title handle }"
|
|
147
|
+
shop products list --selection @fields.gql
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
### Inline Fragments (Union/Interface Types)
|
|
151
|
+
|
|
152
|
+
Some fields return interface or union types (e.g., `Catalog` can be `AppCatalog`, `MarketCatalog`, etc.). Use inline fragments to select type-specific fields.
|
|
153
|
+
|
|
154
|
+
With `--select`, use the `on_TypeName` prefix:
|
|
155
|
+
|
|
156
|
+
```bash
|
|
157
|
+
# Select apps from an AppCatalog via publications
|
|
158
|
+
shop products get --id 123 --include resourcePublicationsV2 \
|
|
159
|
+
--select resourcePublicationsV2.nodes.publication.catalog.on_AppCatalog.apps.nodes.title
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
With `--selection`, use standard GraphQL inline fragment syntax:
|
|
163
|
+
|
|
164
|
+
```bash
|
|
165
|
+
shop publications list --selection '{
|
|
166
|
+
id
|
|
167
|
+
catalog {
|
|
168
|
+
title
|
|
169
|
+
... on AppCatalog {
|
|
170
|
+
apps(first: 5) {
|
|
171
|
+
nodes { title handle }
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
}'
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
Or load from a file:
|
|
179
|
+
|
|
180
|
+
```bash
|
|
181
|
+
shop publications list --selection @my-selection.gql
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
### Quiet Mode
|
|
185
|
+
|
|
186
|
+
Use `--quiet` to output only IDs:
|
|
187
|
+
|
|
188
|
+
```bash
|
|
189
|
+
shop products list --quiet
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
## Common Flags
|
|
193
|
+
|
|
194
|
+
| Flag | Description |
|
|
195
|
+
| ------------- | ---------------------------------------- |
|
|
196
|
+
| `--first N` | Limit results (default: 50) |
|
|
197
|
+
| `--after` | Cursor for pagination |
|
|
198
|
+
| `--query` | Search/filter query |
|
|
199
|
+
| `--published` | Products only: filter to published products (adds `published_status:published` to `--query`) |
|
|
200
|
+
| `--sort` | Sort key |
|
|
201
|
+
| `--reverse` | Reverse sort order |
|
|
202
|
+
| `--id` | Resource ID (for get/update/delete) |
|
|
203
|
+
| `--set` | Set a field value (repeatable) |
|
|
204
|
+
| `--set-json` | Set a field value as JSON (repeatable) |
|
|
205
|
+
| `--tags` | Comma-separated tags |
|
|
206
|
+
| `--dry-run` | Print GraphQL operation without executing |
|
|
207
|
+
|
|
208
|
+
## Raw GraphQL
|
|
209
|
+
|
|
210
|
+
Execute arbitrary GraphQL queries or mutations:
|
|
211
|
+
|
|
212
|
+
```bash
|
|
213
|
+
shop graphql "{ shop { name } }"
|
|
214
|
+
shop graphql @query.graphql
|
|
215
|
+
shop graphql @mutation.graphql --var id=gid://shopify/Product/123 --var title="New Title"
|
|
216
|
+
shop graphql @query.graphql --variables '{"first": 10}'
|
|
217
|
+
shop graphql @query.graphql --variables @vars.json
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
Use `--no-validate` to skip local schema validation.
|
|
221
|
+
|
|
222
|
+
## Examples
|
|
223
|
+
|
|
224
|
+
```bash
|
|
225
|
+
# List products
|
|
226
|
+
shop products list --first 5
|
|
227
|
+
|
|
228
|
+
# List only published products (adds published_status:published to --query)
|
|
229
|
+
shop products list --published
|
|
230
|
+
|
|
231
|
+
# Get a specific product
|
|
232
|
+
shop products get --id 123
|
|
233
|
+
|
|
234
|
+
# Create a product
|
|
235
|
+
shop products create --set title="My Product" --set status="ACTIVE"
|
|
236
|
+
|
|
237
|
+
# Update a product
|
|
238
|
+
shop products update --id 123 --set title="Updated Title"
|
|
239
|
+
|
|
240
|
+
# Add tags to a product
|
|
241
|
+
shop products add-tags --id 123 --tags "summer,featured"
|
|
242
|
+
|
|
243
|
+
# Publish to a sales channel
|
|
244
|
+
shop publications resolve --publication "Online Store"
|
|
245
|
+
shop products publish --id 123 --publication "Online Store" --now
|
|
246
|
+
|
|
247
|
+
# Work with metafields
|
|
248
|
+
shop products metafields upsert --id 123 \
|
|
249
|
+
--set namespace=custom \
|
|
250
|
+
--set key=foo \
|
|
251
|
+
--set type=single_line_text_field \
|
|
252
|
+
--set value=bar
|
|
253
|
+
|
|
254
|
+
# List orders with table output
|
|
255
|
+
shop orders list --first 10 --format table
|
|
256
|
+
|
|
257
|
+
# Export all product IDs
|
|
258
|
+
shop products list --quiet > product-ids.txt
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
## Field Introspection
|
|
262
|
+
|
|
263
|
+
View available fields for any resource:
|
|
264
|
+
|
|
265
|
+
```bash
|
|
266
|
+
shop products fields
|
|
267
|
+
shop orders fields --format json
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
## Resources
|
|
271
|
+
|
|
272
|
+
| Resource | Verbs |
|
|
273
|
+
| -------- | ----- |
|
|
274
|
+
| `abandoned-checkouts` | list, count, abandonment, abandonment-by-checkout, update-email-state, update-activity-delivery-status, fields |
|
|
275
|
+
| `app-billing` | purchase-one-time-create, subscription-create, subscription-trial-extend, usage-record-create, uninstall, revoke-access-scopes, create-one-time, create-subscription, cancel-subscription, update-line-item, extend-trial, create-usage-record, get-installation, list-subscriptions, fields |
|
|
276
|
+
| `apps` | get, by-handle, by-key, installations, current-installation, discount-type, discount-types, discount-types-nodes, fields |
|
|
277
|
+
| `articles` | authors, tags, create, get, list, update, publish, unpublish, delete, fields |
|
|
278
|
+
| `backup` | available-regions, region, region-update, fields |
|
|
279
|
+
| `blogs` | create, get, list, count, update, publish, unpublish, delete, fields |
|
|
280
|
+
| `bulk-operations` | run-query, run-mutation, get, list, current, job, cancel, fields |
|
|
281
|
+
| `business-entities` | list, get, fields |
|
|
282
|
+
| `carrier-services` | create, get, list, list-available, update, delete, fields |
|
|
283
|
+
| `cart-transforms` | create, list, delete, fields |
|
|
284
|
+
| `cash-tracking` | get, list, fields |
|
|
285
|
+
| `catalogs` | create, get, list, count, operations, context-update, update, delete, fields |
|
|
286
|
+
| `channels` | get, list, fields |
|
|
287
|
+
| `checkout-branding` | get, upsert |
|
|
288
|
+
| `checkout-profiles` | get, list, fields |
|
|
289
|
+
| `collections` | create, get, by-handle, by-identifier, rules-conditions, list, count, update, delete, duplicate, add-products, remove-products, reorder-products, publish, unpublish, fields |
|
|
290
|
+
| `comments` | approve, spam, not-spam, get, list, delete, fields |
|
|
291
|
+
| `companies` | create, get, list, count, update, delete, address-delete, bulk-delete, assign-main-contact, revoke-main-contact, assign-customer, fields |
|
|
292
|
+
| `company-contacts` | get, role-get, create, update, delete, bulk-delete, assign-role, assign-roles, revoke-role, revoke-roles, remove-from-company, send-welcome-email, fields |
|
|
293
|
+
| `company-locations` | get, list, create, update, delete, bulk-delete, assign-address, assign-roles, revoke-roles, assign-staff, remove-staff, assign-tax-exemptions, revoke-tax-exemptions, create-tax-registration, revoke-tax-registration, update-tax-settings, fields |
|
|
294
|
+
| `config` | get, update-policy, enable-locale, disable-locale, update-locale, get-locales, fields |
|
|
295
|
+
| `customer-account-pages` | get, list, fields |
|
|
296
|
+
| `customer-payment-methods` | get, credit-card-create, credit-card-update, paypal-billing-agreement-create, paypal-billing-agreement-update, remote-create, revoke, send-update-email, duplication-data-get, duplication-create, update-url-get, fields |
|
|
297
|
+
| `customer-privacy` | privacy-settings, privacy-features-disable, consent-policy, consent-policy-regions, consent-policy-update, data-sale-opt-out, fields |
|
|
298
|
+
| `customer-segments` | members, members-query, membership, members-query-create, fields |
|
|
299
|
+
| `customers` | create, get, by-identifier, list, count, set, update, delete, address-create, address-update, address-delete, update-default-address, email-marketing-consent-update, sms-marketing-consent-update, add-tax-exemptions, remove-tax-exemptions, replace-tax-exemptions, generate-account-activation-url, request-data-erasure, cancel-data-erasure, metafields upsert, add-tags, remove-tags, merge, merge-preview, merge-job-status, send-invite, fields |
|
|
300
|
+
| `delegate-tokens` | create, destroy |
|
|
301
|
+
| `delivery-customizations` | create, get, list, update, delete, activate, fields |
|
|
302
|
+
| `delivery-profile-locations` | available, available-connection, fields |
|
|
303
|
+
| `delivery-profiles` | create, get, list, update, delete, fields |
|
|
304
|
+
| `delivery-promises` | get-settings, get-participants, get-provider, provider, update-participants, upsert-provider, provider-upsert |
|
|
305
|
+
| `delivery-settings` | setting-update, shipping-origin-assign |
|
|
306
|
+
| `discount-nodes` | get, list, count, fields |
|
|
307
|
+
| `discount-redeem-codes` | get-bulk-creation, bulk-delete, fields |
|
|
308
|
+
| `discount-saved-searches` | automatic, code, redeem-code, fields |
|
|
309
|
+
| `discounts-automatic` | get, list, get-discount, list-discounts, create-basic, create-bxgy, create-free-shipping, create-app, update-basic, update-bxgy, update-free-shipping, update-app, delete, bulk-delete, activate, deactivate, fields |
|
|
310
|
+
| `discounts-code` | get, get-by-code, list, count, create-basic, create-bxgy, create-free-shipping, create-app, update-basic, update-bxgy, update-free-shipping, update-app, delete, bulk-delete, activate, deactivate, bulk-activate, bulk-deactivate, add-redeem-codes, delete-redeem-codes, fields |
|
|
311
|
+
| `disputes` | get, list, evidence get, evidence update |
|
|
312
|
+
| `draft-orders` | get, list, count, create, update, delete, duplicate, calculate, complete, create-from-order, preview-invoice, send-invoice, bulk-add-tags, bulk-remove-tags, bulk-delete, tags, saved-searches, delivery-options, saved-search, fields |
|
|
313
|
+
| `events` | get, list, count, fields |
|
|
314
|
+
| `file-saved-searches` | list, fields |
|
|
315
|
+
| `files` | get, list, upload, update, delete, fields |
|
|
316
|
+
| `finance` | payout, payouts, fields |
|
|
317
|
+
| `flow` | generate-signature, trigger-receive |
|
|
318
|
+
| `fulfillment-constraint-rules` | list, create, update, delete |
|
|
319
|
+
| `fulfillment-orders` | get, list, accept-request, reject-request, submit-request, accept-cancellation, reject-cancellation, submit-cancellation, cancel, close, open, hold, release-hold, reschedule, move, split, merge, report-progress, mark-prepared, set-deadline, reroute, fields |
|
|
320
|
+
| `fulfillment-services` | get, list, create, update, delete, fields |
|
|
321
|
+
| `fulfillments` | get, create, cancel, update-tracking, create-event, fields |
|
|
322
|
+
| `gift-cards` | get, list, count, config, create, update, credit, debit, deactivate, notify-customer, notify-recipient, fields |
|
|
323
|
+
| `graphql` | query, mutation |
|
|
324
|
+
| `inventory` | list, set, adjust, move |
|
|
325
|
+
| `inventory-items` | get, list, update, fields |
|
|
326
|
+
| `inventory-shipments` | get, create, create-in-transit, delete, add-items, remove-items, update-quantities, mark-in-transit, receive, set-tracking, fields |
|
|
327
|
+
| `inventory-transfers` | get, list, create, create-ready, edit, duplicate, mark-ready, cancel, set-items, remove-items, delete, fields |
|
|
328
|
+
| `locales` | list, fields |
|
|
329
|
+
| `locations` | get, list, count, create, update, delete, activate, deactivate, enable-local-pickup, disable-local-pickup, fields |
|
|
330
|
+
| `market-localizations` | list, fields |
|
|
331
|
+
| `market-web-presences` | list, fields |
|
|
332
|
+
| `marketing-activities` | get, list, create, create-external, update, update-external, upsert-external, delete-external, delete-all-external, create-engagement, delete-engagements, fields |
|
|
333
|
+
| `marketing-events` | get, list, delete, fields |
|
|
334
|
+
| `markets` | create, get, list, update, delete, fields |
|
|
335
|
+
| `menus` | create, get, list, update, delete, fields |
|
|
336
|
+
| `metafield-definition-tools` | validate, fields |
|
|
337
|
+
| `metafield-definitions` | create, get, list, update, delete, fields |
|
|
338
|
+
| `metafields` | list, delete, fields |
|
|
339
|
+
| `metaobject-definition-tools` | validate, fields |
|
|
340
|
+
| `metaobject-definitions` | create, get, list, update, delete, fields |
|
|
341
|
+
| `metaobjects` | create, get, list, update, delete, fields |
|
|
342
|
+
| `mobile-platform-applications` | list, get, create, update, delete |
|
|
343
|
+
| `order-edit` | begin, get, commit, add-variant, add-custom-item, set-quantity, add-discount, remove-discount, update-discount, add-shipping, remove-shipping, update-shipping, fields |
|
|
344
|
+
| `orders` | create, get, list, count, update, delete, add-tags, remove-tags, cancel, close, mark-paid, add-note, fulfill, create-mandate-payment, transaction-void, fields |
|
|
345
|
+
| `pages` | create, get, list, count, update, publish, unpublish, delete, fields |
|
|
346
|
+
| `payment-customizations` | get, list, create, update, delete, set-enabled, fields |
|
|
347
|
+
| `payment-terms` | templates, create, update, delete, send-reminder, fields |
|
|
348
|
+
| `point-of-sale` | get, fields |
|
|
349
|
+
| `price-lists` | get, list, count, create, update, delete, add-prices, update-prices, update-prices-by-product, delete-prices, add-quantity-rules, delete-quantity-rules, update-quantity-pricing, fields |
|
|
350
|
+
| `product-feeds` | list, create, update, incremental-sync, full-sync, delete, fields |
|
|
351
|
+
| `product-variants` | upsert, get, get-by-identifier, list, count, update, bulk-create, bulk-update, bulk-delete, bulk-reorder, append-media, detach-media, join-selling-plans, leave-selling-plans, update-relationships, fields |
|
|
352
|
+
| `products` | create, get, by-handle, by-identifier, list, count, tags, types, vendors, update, delete, duplicate, archive, unarchive, set-status, change-status, set, join-selling-plan-groups, leave-selling-plan-groups, option-update, options-create, options-delete, options-reorder, combined-listing-update, add-tags, remove-tags, set-price, publish, unpublish, publish-all, bundle-create, bundle-update, metafields upsert, media add, media upload, media list, media remove, media update, media reorder, create-media, update-media, delete-media, reorder-media, duplicate-job, operation, fields |
|
|
353
|
+
| `publications` | resolve, create, get, list, update, delete, fields |
|
|
354
|
+
| `publishables` | get, list, fields |
|
|
355
|
+
| `refunds` | get, calculate, create, fields |
|
|
356
|
+
| `resource-feedback` | create, fields |
|
|
357
|
+
| `returnable-fulfillments` | list, fields |
|
|
358
|
+
| `returns` | get, reason-definitions, returnable-fulfillments, calculate, create, request, approve-request, decline-request, cancel, close, reopen, process, refund, remove-item, fields |
|
|
359
|
+
| `reverse-deliveries` | get, create, fields |
|
|
360
|
+
| `reverse-fulfillment-orders` | get, dispose, fields |
|
|
361
|
+
| `saved-searches` | create, update, delete, list-products, list-orders, list-customers, list-draft-orders, list-collections, fields |
|
|
362
|
+
| `script-tags` | create, get, list, update, delete, fields |
|
|
363
|
+
| `segments` | create, get, list, count, filters, filter-suggestions, value-suggestions, migrations, update, delete, fields |
|
|
364
|
+
| `selling-plan-group-products` | add-products, remove-products, add-product-variants, remove-product-variants, fields |
|
|
365
|
+
| `selling-plan-groups` | create, get, list, update, delete, add-variants, remove-variants, fields |
|
|
366
|
+
| `server-pixels` | get, create, delete, update-pubsub, pubsub-update, update-eventbridge, fields |
|
|
367
|
+
| `shipping-packages` | update, make-default, delete |
|
|
368
|
+
| `shop` | billing-preferences, domain, online-store, public-api-versions, shop-pay-receipt, shop-pay-receipts |
|
|
369
|
+
| `shop-policies` | list, update |
|
|
370
|
+
| `shop-utils` | feature-enabled, fields |
|
|
371
|
+
| `shopify-functions` | schema, fields |
|
|
372
|
+
| `shopify-payments` | account, get, payout-alternate-currency-create, fields |
|
|
373
|
+
| `staff` | me, get, list, fields |
|
|
374
|
+
| `staged-uploads` | target-generate, targets-generate, fields |
|
|
375
|
+
| `store-credit` | get, credit, debit, fields |
|
|
376
|
+
| `storefront-access-tokens` | list, get, create, create-basic, delete, fields |
|
|
377
|
+
| `subscription-billing` | get-attempt, list-attempts, create-attempt, get-cycle, list-cycles, charge, bulk-charge, bulk-search, skip-cycle, unskip-cycle, edit-schedule, edit-cycle, delete-edits |
|
|
378
|
+
| `subscription-billing-cycles` | attempts, bulk-results, get, charge, skip, unskip, schedule-edit, contract-edit, contract-draft-commit, contract-draft-concatenate, edit-delete, edits-delete, fields |
|
|
379
|
+
| `subscription-contracts` | get, list, create, atomic-create, update, activate, pause, cancel, expire, fail, set-next-billing, change-product, fields |
|
|
380
|
+
| `subscription-drafts` | get, commit, update, add-line, update-line, remove-line, add-discount, update-discount, remove-discount, apply-code, add-free-shipping, update-free-shipping, fields |
|
|
381
|
+
| `tags` | add, remove |
|
|
382
|
+
| `tax` | configure-app, create-summary |
|
|
383
|
+
| `taxonomy` | categories, list |
|
|
384
|
+
| `tender-transactions` | list, fields |
|
|
385
|
+
| `themes` | get, list, create, update, delete, duplicate, publish, files-upsert, files-delete, files-copy, fields |
|
|
386
|
+
| `translations` | get, list, list-by-ids, register, remove, fields |
|
|
387
|
+
| `types` | help |
|
|
388
|
+
| `url-redirects` | create, get, list, count, saved-searches, import-create, import-submit, import-get, bulk-delete-all, bulk-delete-ids, bulk-delete-saved-search, bulk-delete-search, update, delete, fields |
|
|
389
|
+
| `validations` | create, get, list, update, delete, fields |
|
|
390
|
+
| `web-pixels` | create, get, update, delete, fields |
|
|
391
|
+
| `web-presences` | list, create, update, delete, fields |
|
|
392
|
+
| `webhooks` | count, create, get, list, update, pubsub-create, pubsub-update, event-bridge-create, event-bridge-update, delete, fields |
|
package/bin/shop-cli.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/* eslint-disable no-console */
|
|
3
|
+
const path = require('node:path')
|
|
4
|
+
const fs = require('node:fs')
|
|
5
|
+
|
|
6
|
+
process.env.SHOP_CLI_COMMAND = process.env.SHOP_CLI_COMMAND || 'shop-cli'
|
|
7
|
+
|
|
8
|
+
const repoRoot = path.join(__dirname, '..')
|
|
9
|
+
const cliPath = path.join(repoRoot, 'dist', 'cli.js')
|
|
10
|
+
|
|
11
|
+
if (!fs.existsSync(cliPath)) {
|
|
12
|
+
console.error(`Missing ${path.relative(repoRoot, cliPath)}. Did you run \`npm run build\`?`)
|
|
13
|
+
process.exit(1)
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
require(cliPath)
|
|
17
|
+
|
package/bin/shop.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/* eslint-disable no-console */
|
|
3
|
+
const path = require('node:path')
|
|
4
|
+
const fs = require('node:fs')
|
|
5
|
+
|
|
6
|
+
process.env.SHOP_CLI_COMMAND = process.env.SHOP_CLI_COMMAND || 'shop'
|
|
7
|
+
|
|
8
|
+
const repoRoot = path.join(__dirname, '..')
|
|
9
|
+
const cliPath = path.join(repoRoot, 'dist', 'cli.js')
|
|
10
|
+
|
|
11
|
+
if (!fs.existsSync(cliPath)) {
|
|
12
|
+
console.error(`Missing ${path.relative(repoRoot, cliPath)}. Did you run \`npm run build\`?`)
|
|
13
|
+
process.exit(1)
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
require(cliPath)
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { type Client } from './generated/admin-2026-04';
|
|
2
|
+
export { GenqlError } from './generated/admin-2026-04';
|
|
3
|
+
export type ShopifyAdminApiVersion = '2026-04' | (string & {});
|
|
4
|
+
export type RawGraphQLRequest = {
|
|
5
|
+
query: string;
|
|
6
|
+
variables?: Record<string, unknown>;
|
|
7
|
+
operationName?: string;
|
|
8
|
+
};
|
|
9
|
+
export type RawGraphQLResponse = {
|
|
10
|
+
data?: unknown;
|
|
11
|
+
errors?: Array<{
|
|
12
|
+
message: string;
|
|
13
|
+
locations?: Array<{
|
|
14
|
+
line: number;
|
|
15
|
+
column: number;
|
|
16
|
+
}>;
|
|
17
|
+
path?: Array<string | number>;
|
|
18
|
+
}>;
|
|
19
|
+
extensions?: unknown;
|
|
20
|
+
};
|
|
21
|
+
export type CreateShopifyAdminClientOptions = {
|
|
22
|
+
shopDomain?: string;
|
|
23
|
+
graphqlEndpoint?: string;
|
|
24
|
+
accessToken?: string;
|
|
25
|
+
apiVersion?: ShopifyAdminApiVersion;
|
|
26
|
+
fetch?: typeof fetch;
|
|
27
|
+
headers?: Record<string, string>;
|
|
28
|
+
verbose?: boolean;
|
|
29
|
+
};
|
|
30
|
+
export declare const createShopifyAdminClient: ({ shopDomain, graphqlEndpoint, accessToken, apiVersion, fetch: _fetch, headers, verbose, }: CreateShopifyAdminClientOptions) => Client;
|
|
31
|
+
export type RawGraphQLClient = {
|
|
32
|
+
request: (req: RawGraphQLRequest) => Promise<RawGraphQLResponse>;
|
|
33
|
+
};
|
|
34
|
+
export declare const createRawGraphQLClient: ({ shopDomain, graphqlEndpoint, accessToken, apiVersion, fetch: _fetch, headers, verbose, }: CreateShopifyAdminClientOptions) => RawGraphQLClient;
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var adminClient_exports = {};
|
|
20
|
+
__export(adminClient_exports, {
|
|
21
|
+
GenqlError: () => import_admin_2026_042.GenqlError,
|
|
22
|
+
createRawGraphQLClient: () => createRawGraphQLClient,
|
|
23
|
+
createShopifyAdminClient: () => createShopifyAdminClient
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(adminClient_exports);
|
|
26
|
+
var import_admin_2026_04 = require("./generated/admin-2026-04");
|
|
27
|
+
var import_admin_2026_042 = require("./generated/admin-2026-04");
|
|
28
|
+
var import_defaults = require("./defaults");
|
|
29
|
+
const normalizeShopDomain = (shopDomain) => {
|
|
30
|
+
let normalized = shopDomain.replace(/^https?:\/\//, "").replace(/\/+$/, "");
|
|
31
|
+
if (!normalized.endsWith(".myshopify.com")) {
|
|
32
|
+
normalized = `${normalized}.myshopify.com`;
|
|
33
|
+
}
|
|
34
|
+
return normalized;
|
|
35
|
+
};
|
|
36
|
+
const resolveGraphqlEndpoint = ({
|
|
37
|
+
graphqlEndpoint,
|
|
38
|
+
shopDomain,
|
|
39
|
+
apiVersion
|
|
40
|
+
}) => {
|
|
41
|
+
if (graphqlEndpoint) return graphqlEndpoint;
|
|
42
|
+
if (!shopDomain) {
|
|
43
|
+
throw new Error(
|
|
44
|
+
"Missing shop domain: pass --shop, set SHOPIFY_SHOP, or set GRAPHQL_ENDPOINT"
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
const normalizedShopDomain = normalizeShopDomain(shopDomain);
|
|
48
|
+
const resolvedApiVersion = (0, import_defaults.resolveAdminApiVersion)(apiVersion);
|
|
49
|
+
return `https://${normalizedShopDomain}/admin/api/${resolvedApiVersion}/graphql.json`;
|
|
50
|
+
};
|
|
51
|
+
const createShopifyAdminClient = ({
|
|
52
|
+
shopDomain,
|
|
53
|
+
graphqlEndpoint,
|
|
54
|
+
accessToken,
|
|
55
|
+
apiVersion,
|
|
56
|
+
fetch: _fetch,
|
|
57
|
+
headers,
|
|
58
|
+
verbose
|
|
59
|
+
}) => {
|
|
60
|
+
const url = resolveGraphqlEndpoint({ graphqlEndpoint, shopDomain, apiVersion });
|
|
61
|
+
const fetchImpl = _fetch ?? fetch;
|
|
62
|
+
const resolvedHeaders = () => ({
|
|
63
|
+
"Content-Type": "application/json",
|
|
64
|
+
...accessToken ? { "X-Shopify-Access-Token": accessToken } : {},
|
|
65
|
+
...headers ?? {}
|
|
66
|
+
});
|
|
67
|
+
if (verbose) {
|
|
68
|
+
return (0, import_admin_2026_04.createClient)({
|
|
69
|
+
url,
|
|
70
|
+
fetcher: async (body) => {
|
|
71
|
+
const headersObj = resolvedHeaders();
|
|
72
|
+
console.error(`POST ${url}`);
|
|
73
|
+
console.error("Headers:");
|
|
74
|
+
for (const [name, value] of Object.entries(headersObj)) {
|
|
75
|
+
console.error(` ${name}: ${value}`);
|
|
76
|
+
}
|
|
77
|
+
console.error("Body:");
|
|
78
|
+
console.error(JSON.stringify(body, null, 2));
|
|
79
|
+
console.error("");
|
|
80
|
+
const res = await fetchImpl(url, {
|
|
81
|
+
method: "POST",
|
|
82
|
+
headers: headersObj,
|
|
83
|
+
body: JSON.stringify(body)
|
|
84
|
+
});
|
|
85
|
+
if (!res.ok) {
|
|
86
|
+
throw new Error(`${res.statusText}: ${await res.text()}`);
|
|
87
|
+
}
|
|
88
|
+
return res.json();
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
return (0, import_admin_2026_04.createClient)({
|
|
93
|
+
url,
|
|
94
|
+
fetch: fetchImpl,
|
|
95
|
+
headers: resolvedHeaders
|
|
96
|
+
});
|
|
97
|
+
};
|
|
98
|
+
const createRawGraphQLClient = ({
|
|
99
|
+
shopDomain,
|
|
100
|
+
graphqlEndpoint,
|
|
101
|
+
accessToken,
|
|
102
|
+
apiVersion,
|
|
103
|
+
fetch: _fetch,
|
|
104
|
+
headers,
|
|
105
|
+
verbose
|
|
106
|
+
}) => {
|
|
107
|
+
const url = resolveGraphqlEndpoint({ graphqlEndpoint, shopDomain, apiVersion });
|
|
108
|
+
const fetchImpl = _fetch ?? fetch;
|
|
109
|
+
return {
|
|
110
|
+
request: async (req) => {
|
|
111
|
+
const reqHeaders = {
|
|
112
|
+
"Content-Type": "application/json",
|
|
113
|
+
...accessToken ? { "X-Shopify-Access-Token": accessToken } : {},
|
|
114
|
+
...headers ?? {}
|
|
115
|
+
};
|
|
116
|
+
if (verbose) {
|
|
117
|
+
console.error(`POST ${url}`);
|
|
118
|
+
console.error("Headers:");
|
|
119
|
+
for (const [name, value] of Object.entries(reqHeaders)) {
|
|
120
|
+
console.error(` ${name}: ${value}`);
|
|
121
|
+
}
|
|
122
|
+
console.error("Body:");
|
|
123
|
+
console.error(JSON.stringify(req, null, 2));
|
|
124
|
+
console.error("");
|
|
125
|
+
}
|
|
126
|
+
const res = await fetchImpl(url, {
|
|
127
|
+
method: "POST",
|
|
128
|
+
headers: reqHeaders,
|
|
129
|
+
body: JSON.stringify(req)
|
|
130
|
+
});
|
|
131
|
+
if (!res.ok) {
|
|
132
|
+
throw new Error(`HTTP ${res.status}: ${await res.text()}`);
|
|
133
|
+
}
|
|
134
|
+
return res.json();
|
|
135
|
+
}
|
|
136
|
+
};
|
|
137
|
+
};
|
|
138
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
139
|
+
0 && (module.exports = {
|
|
140
|
+
GenqlError,
|
|
141
|
+
createRawGraphQLClient,
|
|
142
|
+
createShopifyAdminClient
|
|
143
|
+
});
|
|
144
|
+
//# sourceMappingURL=adminClient.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type ShopifyAdminApiVersion } from '../adminClient';
|
|
2
|
+
export type CliClientOptions = {
|
|
3
|
+
shopDomain?: string;
|
|
4
|
+
graphqlEndpoint?: string;
|
|
5
|
+
accessToken?: string;
|
|
6
|
+
apiVersion?: ShopifyAdminApiVersion;
|
|
7
|
+
headers?: Record<string, string>;
|
|
8
|
+
verbose?: boolean;
|
|
9
|
+
};
|
|
10
|
+
export declare const createCliClientFromEnv: ({ shopDomain, graphqlEndpoint, accessToken, apiVersion, headers, verbose, }: CliClientOptions) => import("../generated/admin-2026-04").Client;
|