Skip to content

Commit d4955c4

Browse files
committed
Trim README to a concise overview; defer detail to the Shop skill
1 parent a342e07 commit d4955c4

1 file changed

Lines changed: 15 additions & 187 deletions

File tree

README.md

Lines changed: 15 additions & 187 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,14 @@
11
# Shop CLI
22

3-
Personal shopping CLI for the Shop catalog: search millions of stores, look up
4-
products, sign in to your Shop account, build and complete UCP checkouts, and
5-
search your orders for tracking, returns, and reorders.
3+
Personal shopping CLI for the Shop catalog: search millions of stores, look up products, sign in to your Shop account, build and complete UCP checkouts, and search your orders for tracking, returns, and reorders.
64

7-
It talks to the Shopify Global Catalog over MCP and to Shop's auth, checkout,
8-
and orders APIs. Tokens are stored in your OS secret store (Keychain on macOS,
9-
the equivalent secret service elsewhere) via `keytar` — nothing sensitive is
10-
written to disk in plaintext.
5+
It talks to the Shopify Global Catalog over MCP and to Shop's auth, checkout, and orders APIs. Tokens are stored in your OS secret store via `keytar`.
116

127
## Companion to the Shop skill
138

14-
This CLI is the companion to the **Shop skill**, the agent-facing playbook that
15-
drives the end-to-end shopping conversation (offer sign-in → search → show
16-
products → visualize → checkout → orders). The skill calls these commands under
17-
the hood, and when the CLI can't be installed its reference files mirror every
18-
command via the direct API.
9+
This CLI is the companion to the **Shop skill**, the agent-facing playbook that drives the end-to-end shopping conversation. The skill calls these commands under the hood and documents every command, flag, and workflow in full.
1910

20-
The skill lives at **https://shop.app/SKILL.md**.
11+
The skill lives at **https://shop.app/SKILL.md** — see it for the complete reference.
2112

2213
## Install
2314

@@ -31,197 +22,34 @@ Or with npm:
3122
npm install --global @shopify/shop-cli
3223
```
3324

34-
From source:
35-
36-
```bash
37-
git clone https://github.com/Shopify/shop-cli && cd shop-cli
38-
pnpm install && pnpm build && pnpm link --global
39-
shop --help
40-
```
41-
4225
Requires Node.js >= 20.
4326

44-
## Quick start
27+
## Usage
4528

4629
```bash
4730
shop --help
4831
shop auth status
4932
shop search "trail running shoes" --limit 10
5033
shop catalog lookup gid://shopify/ProductVariant/50362300006715
51-
```
52-
53-
## Global options
54-
55-
These apply to every command:
56-
57-
```text
58-
--country <ISO2> Buyer country as a catalog *context* signal (default: US).
59-
Not a ships-to filter. Transient — use `shop config
60-
set-country` to persist a default.
61-
--profile-url <url> UCP agent profile URL for global catalog calls.
62-
--format md|json Output format for catalog (search/lookup/get-product)
63-
results: md (default) or json. md is far more compact;
64-
json payloads are large. Auth and checkout always emit
65-
JSON; orders always emit markdown.
66-
--memory-store Use in-memory token storage (for tests and dry runs).
67-
```
68-
69-
## Commands
70-
71-
### Search the catalog
72-
73-
`shop search` is the single entry point for catalog discovery — free-text,
74-
similar items (`--like-id`), and visual search (`--image`). The query argument is
75-
optional when you pass `--like-id` or `--image`.
76-
77-
```bash
78-
shop search "black crewneck sweater" --limit 10
79-
shop search "boots" --country US --ships-to US --ships-from US
80-
shop search "tshirt" --color White --size M --gender Female
81-
shop search --like-id gid://shopify/p/abc123
82-
shop search --image ./photo.jpg
83-
```
84-
85-
Useful flags:
86-
87-
```text
88-
--country <ISO2> Buyer country context for this call
89-
--ships-to <ISO2> Destination filter (hard filter). Alone, also
90-
localizes catalog context to that country.
91-
--ships-to-region <code> ships-to region (requires --ships-to)
92-
--ships-to-postal <code> ships-to postal code (requires --ships-to)
93-
--ships-from <ISO2> Merchant origin country
94-
-l, --limit <number> Result limit, 1-50
95-
--min-price / --max-price Price bounds in minor units (15000 = $150.00)
96-
--currency <code> Currency signal
97-
--language <code> Language signal
98-
--intent <text> Buyer intent context
99-
--condition <list> Comma list, e.g. new,secondhand
100-
--include-unavailable Include out-of-stock products
101-
--shop-id <id...> Filter to specific shop IDs
102-
--category <id...> Filter to taxonomy category IDs
103-
--color/--size/--gender Comma-list taxonomy attribute filters
104-
--like-id <id...> Find similar items (product gid only)
105-
--image <path> Find similar items by image (CLI base64-encodes it)
106-
--view <name> Catalog response view
107-
--format md|json (global) output format
108-
```
109-
110-
### Catalog lookup & product detail
111-
112-
Use `lookup` for IDs you already hold (orders, wishlist, reorder); use
113-
`get-product` for a full product detail record including variant `checkout_url`.
114-
115-
```bash
116-
shop catalog lookup <product-or-variant-id...>
117-
shop catalog lookup gid://shopify/ProductVariant/50362300006715 --include-unavailable
118-
shop catalog get-product gid://shopify/p/abc --select Color=Black --select Size=M
119-
```
120-
121-
`lookup` flags: `--country`, `--currency`, `--ships-to[-region|-postal]`,
122-
`--include-unavailable`, `--condition`, `--view`.
123-
`get-product` flags: `--country`, `--currency`, `--select Name=Label`,
124-
`--preference Name`, `--view`.
125-
126-
### Auth
127-
128-
Sign-in is optional (search works signed-out) but unlocks shipping rates, your
129-
default address, and order history. Tokens are stored in the OS secret store.
130-
131-
```bash
132-
shop auth status # check whether stored auth is valid
133-
shop auth logout # delete stored tokens and preferences
134-
```
135-
136-
There are two ways to sign in:
137-
138-
```bash
139-
# Blocking: runs device authorization end-to-end and stores tokens
140-
shop auth login --device-name "My laptop"
141-
142-
# Non-blocking (preferred for agents): two steps
143-
shop auth device-code --device-name "My laptop" # prints the sign-in URL
144-
# ...user authorizes in the browser...
145-
shop auth poll # exchanges + stores tokens;
146-
# re-run while it reports pending
147-
```
148-
149-
### Checkout
150-
151-
UCP checkout runs on the merchant's domain. Checkout JSON is read from stdin
152-
with `--checkout-stdin`. `--shop-domain` must be a bare merchant hostname (no
153-
scheme, path, port, or IP).
154-
155-
```bash
156-
# Create from a variant
157-
printf '{"email":"buyer@example.com"}' | \
158-
shop checkout create \
159-
--shop-domain example.myshopify.com \
160-
--variant-id 123 --quantity 1 \
161-
--checkout-stdin
162-
163-
# Create from an existing cart
164-
printf '{"cart_id":"cart_123","line_items":[]}' | \
165-
shop checkout create --shop-domain example.myshopify.com --checkout-stdin
166-
167-
# Update an existing checkout
168-
printf '{"fulfillment":{"methods":[]}}' | \
169-
shop checkout update \
170-
--shop-domain example.myshopify.com \
171-
--checkout-id CHECKOUT_ID --checkout-stdin
172-
173-
# Complete (pipe the create_checkout response so its payment instruments are echoed back)
174-
printf '%s' "$CREATE_CHECKOUT_RESPONSE" | \
175-
shop checkout complete \
176-
--shop-domain example.myshopify.com \
177-
--checkout-id CHECKOUT_ID --checkout-stdin \
178-
--idempotency-key UNIQUE_KEY --confirm
179-
```
180-
181-
`shop checkout complete` **requires `--confirm`** and refuses to run without it.
182-
Only complete after confirming the item, variant, quantity, price, shipping
183-
address, shipping method, and total cost with the user. Use a fresh
184-
`--idempotency-key` per distinct purchase intent.
185-
186-
`create`/`update`/`complete` surface UCP `messages[]` warnings (e.g.
187-
`final_sale`, `prop65`, `age_restricted`, disclosures) above the raw JSON so they
188-
aren't missed. The buyer public IP is forwarded to the merchant for fraud/risk
189-
checks — auto-detected via `api.ipify.org`, overridable with `--buyer-ip` or the
190-
`SHOP_BUYER_IP` environment variable.
191-
192-
### Orders
193-
194-
Requires sign-in. Returns a markdown summary.
195-
196-
```bash
19734
shop orders search --type recent
198-
shop orders search --type tracking --query "running shoes" --date-from 2026-01-01
199-
shop orders search --type order_info --query "order #1234"
200-
shop orders search --type returns --query "jacket"
201-
shop orders search --type reorder --query "coffee"
20235
```
20336

204-
`--type` is one of `recent`, `tracking`, `order_info`, `returns`, `reorder`.
205-
Other flags: `--query`, `--date-from`, `--date-to`, `--cursor`.
206-
207-
### Config
37+
## Commands
20838

209-
Persist CLI preferences (stored alongside auth in the OS secret store).
39+
- `shop search` — search the catalog by text, similar items (`--like-id`), or image (`--image`).
40+
- `shop catalog lookup` / `shop catalog get-product` — look up IDs you already hold and fetch full product detail.
41+
- `shop auth` — sign in (`login`, or the non-blocking `device-code` + `poll`), check `status`, or `logout`.
42+
- `shop checkout``create`, `update`, and `complete` a UCP checkout on the merchant domain (`complete` requires `--confirm`).
43+
- `shop orders search` — search recent orders, tracking, order info, returns, and reorder candidates.
44+
- `shop config` — persist CLI preferences such as a default country.
21045

211-
```bash
212-
shop config set-country US # default --country when not passed explicitly
213-
shop config show # show stored preferences
214-
```
46+
Run `shop <command> --help` for the flags on any command, and see the [Shop skill](https://shop.app/SKILL.md) for the full reference and shopping workflow.
21547

21648
## Personal-use limits
21749

218-
This CLI is for individual end-users only. Building commercial services, resale
219-
platforms, aggregators, or anything that provides third parties with
220-
programmatic access to Shopify's catalog, checkout, delegated payments, or
221-
aggregated user data is prohibited.
50+
This CLI is for individual end-users only. Building commercial services, resale platforms, aggregators, or anything that provides third parties with programmatic access to Shopify's catalog, checkout, delegated payments, or aggregated user data is prohibited.
22251

223-
See https://help.shop.app/shop/shopping/personal-agents for accepted and
224-
prohibited use.
52+
See https://help.shop.app/shop/shopping/personal-agents for accepted and prohibited use.
22553

22654
## License
22755

0 commit comments

Comments
 (0)