Skip to content

Commit f0656f4

Browse files
nelsonwittwerclaude
andcommitted
Move JSON search to doc search; restore top-level search
Per the doc-namespace plan, the JSON vector-store search lives at `doc search` instead of repurposing the top-level `search` command: - Add commands/doc/search.ts (class DocSearch), services/commands/doc/search.ts (docSearchService), and the colocated test; register as `doc:search`. - Add a `doc` topic description. - Revert the breaking change to top-level `search` — it goes back to the original browser behavior (handled/deprecated separately in #7778). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent b8d45bd commit f0656f4

16 files changed

Lines changed: 375 additions & 248 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@shopify/cli': minor
3+
---
4+
5+
Add `shopify doc search`, which queries the shopify.dev vector store and prints the most relevant documentation chunks as JSON to stdout. This makes it usable for programmatic and agent-driven discovery. The `query` argument is required, and two optional filters are available: `--api-name` (for example `admin`, `storefront`, `hydrogen`) and `--api-version` (for example `2025-10`, `latest`, `current`). To download a full document verbatim, use `doc fetch`.

.changeset/search-vector-store-json.md

Lines changed: 0 additions & 5 deletions
This file was deleted.
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// This is an autogenerated file. Don't edit this file manually.
2+
/**
3+
* The following flags are available for the `doc search` command:
4+
* @publicDocs
5+
*/
6+
export interface docsearch {
7+
/**
8+
* Limit results to a specific API (for example: admin, storefront, hydrogen, functions). Unrecognized values are ignored.
9+
* @environment SHOPIFY_FLAG_API_NAME
10+
*/
11+
'--api-name <value>'?: string
12+
13+
/**
14+
* Limit results to a specific API version (for example: 2025-10, latest, current).
15+
* @environment SHOPIFY_FLAG_API_VERSION
16+
*/
17+
'--api-version <value>'?: string
18+
19+
/**
20+
* Disable color output.
21+
* @environment SHOPIFY_FLAG_NO_COLOR
22+
*/
23+
'--no-color'?: ''
24+
25+
/**
26+
* Increase the verbosity of the output.
27+
* @environment SHOPIFY_FLAG_VERBOSE
28+
*/
29+
'--verbose'?: ''
30+
}

docs-shopify.dev/commands/interfaces/search.interface.ts

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,5 @@
44
* @publicDocs
55
*/
66
export interface search {
7-
/**
8-
* Limit results to a specific API (for example: admin, storefront, hydrogen, functions). Unrecognized values are ignored.
9-
* @environment SHOPIFY_FLAG_API_NAME
10-
*/
11-
'--api-name <value>'?: string
127

13-
/**
14-
* Limit results to a specific API version (for example: 2025-10, latest, current).
15-
* @environment SHOPIFY_FLAG_API_VERSION
16-
*/
17-
'--api-version <value>'?: string
18-
19-
/**
20-
* Disable color output.
21-
* @environment SHOPIFY_FLAG_NO_COLOR
22-
*/
23-
'--no-color'?: ''
24-
25-
/**
26-
* Increase the verbosity of the output.
27-
* @environment SHOPIFY_FLAG_VERBOSE
28-
*/
29-
'--verbose'?: ''
308
}

docs-shopify.dev/generated/generated_docs_data_v2.json

Lines changed: 49 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -2742,6 +2742,53 @@
27422742
"value": "export interface configautoupgradestatus {\n\n}"
27432743
}
27442744
},
2745+
"docsearch": {
2746+
"docs-shopify.dev/commands/interfaces/doc-search.interface.ts": {
2747+
"filePath": "docs-shopify.dev/commands/interfaces/doc-search.interface.ts",
2748+
"name": "docsearch",
2749+
"description": "The following flags are available for the `doc search` command:",
2750+
"isPublicDocs": true,
2751+
"members": [
2752+
{
2753+
"filePath": "docs-shopify.dev/commands/interfaces/doc-search.interface.ts",
2754+
"syntaxKind": "PropertySignature",
2755+
"name": "--api-name <value>",
2756+
"value": "string",
2757+
"description": "Limit results to a specific API (for example: admin, storefront, hydrogen, functions). Unrecognized values are ignored.",
2758+
"isOptional": true,
2759+
"environmentValue": "SHOPIFY_FLAG_API_NAME"
2760+
},
2761+
{
2762+
"filePath": "docs-shopify.dev/commands/interfaces/doc-search.interface.ts",
2763+
"syntaxKind": "PropertySignature",
2764+
"name": "--api-version <value>",
2765+
"value": "string",
2766+
"description": "Limit results to a specific API version (for example: 2025-10, latest, current).",
2767+
"isOptional": true,
2768+
"environmentValue": "SHOPIFY_FLAG_API_VERSION"
2769+
},
2770+
{
2771+
"filePath": "docs-shopify.dev/commands/interfaces/doc-search.interface.ts",
2772+
"syntaxKind": "PropertySignature",
2773+
"name": "--no-color",
2774+
"value": "''",
2775+
"description": "Disable color output.",
2776+
"isOptional": true,
2777+
"environmentValue": "SHOPIFY_FLAG_NO_COLOR"
2778+
},
2779+
{
2780+
"filePath": "docs-shopify.dev/commands/interfaces/doc-search.interface.ts",
2781+
"syntaxKind": "PropertySignature",
2782+
"name": "--verbose",
2783+
"value": "''",
2784+
"description": "Increase the verbosity of the output.",
2785+
"isOptional": true,
2786+
"environmentValue": "SHOPIFY_FLAG_VERBOSE"
2787+
}
2788+
],
2789+
"value": "export interface docsearch {\n /**\n * Limit results to a specific API (for example: admin, storefront, hydrogen, functions). Unrecognized values are ignored.\n * @environment SHOPIFY_FLAG_API_NAME\n */\n '--api-name <value>'?: string\n\n /**\n * Limit results to a specific API version (for example: 2025-10, latest, current).\n * @environment SHOPIFY_FLAG_API_VERSION\n */\n '--api-version <value>'?: string\n\n /**\n * Disable color output.\n * @environment SHOPIFY_FLAG_NO_COLOR\n */\n '--no-color'?: ''\n\n /**\n * Increase the verbosity of the output.\n * @environment SHOPIFY_FLAG_VERBOSE\n */\n '--verbose'?: ''\n}"
2790+
}
2791+
},
27452792
"help": {
27462793
"docs-shopify.dev/commands/interfaces/help.interface.ts": {
27472794
"filePath": "docs-shopify.dev/commands/interfaces/help.interface.ts",
@@ -4126,45 +4173,8 @@
41264173
"name": "search",
41274174
"description": "The following flags are available for the `search` command:",
41284175
"isPublicDocs": true,
4129-
"members": [
4130-
{
4131-
"filePath": "docs-shopify.dev/commands/interfaces/search.interface.ts",
4132-
"syntaxKind": "PropertySignature",
4133-
"name": "--api-name <value>",
4134-
"value": "string",
4135-
"description": "Limit results to a specific API (for example: admin, storefront, hydrogen, functions). Unrecognized values are ignored.",
4136-
"isOptional": true,
4137-
"environmentValue": "SHOPIFY_FLAG_API_NAME"
4138-
},
4139-
{
4140-
"filePath": "docs-shopify.dev/commands/interfaces/search.interface.ts",
4141-
"syntaxKind": "PropertySignature",
4142-
"name": "--api-version <value>",
4143-
"value": "string",
4144-
"description": "Limit results to a specific API version (for example: 2025-10, latest, current).",
4145-
"isOptional": true,
4146-
"environmentValue": "SHOPIFY_FLAG_API_VERSION"
4147-
},
4148-
{
4149-
"filePath": "docs-shopify.dev/commands/interfaces/search.interface.ts",
4150-
"syntaxKind": "PropertySignature",
4151-
"name": "--no-color",
4152-
"value": "''",
4153-
"description": "Disable color output.",
4154-
"isOptional": true,
4155-
"environmentValue": "SHOPIFY_FLAG_NO_COLOR"
4156-
},
4157-
{
4158-
"filePath": "docs-shopify.dev/commands/interfaces/search.interface.ts",
4159-
"syntaxKind": "PropertySignature",
4160-
"name": "--verbose",
4161-
"value": "''",
4162-
"description": "Increase the verbosity of the output.",
4163-
"isOptional": true,
4164-
"environmentValue": "SHOPIFY_FLAG_VERBOSE"
4165-
}
4166-
],
4167-
"value": "export interface search {\n /**\n * Limit results to a specific API (for example: admin, storefront, hydrogen, functions). Unrecognized values are ignored.\n * @environment SHOPIFY_FLAG_API_NAME\n */\n '--api-name <value>'?: string\n\n /**\n * Limit results to a specific API version (for example: 2025-10, latest, current).\n * @environment SHOPIFY_FLAG_API_VERSION\n */\n '--api-version <value>'?: string\n\n /**\n * Disable color output.\n * @environment SHOPIFY_FLAG_NO_COLOR\n */\n '--no-color'?: ''\n\n /**\n * Increase the verbosity of the output.\n * @environment SHOPIFY_FLAG_VERBOSE\n */\n '--verbose'?: ''\n}"
4176+
"members": [],
4177+
"value": "export interface search {\n\n}"
41684178
}
41694179
},
41704180
"storeauth": {

packages/cli/README.md

Lines changed: 40 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
* [`shopify config autoupgrade off`](#shopify-config-autoupgrade-off)
4040
* [`shopify config autoupgrade on`](#shopify-config-autoupgrade-on)
4141
* [`shopify config autoupgrade status`](#shopify-config-autoupgrade-status)
42+
* [`shopify doc search [query]`](#shopify-doc-search-query)
4243
* [`shopify help [command] [flags]`](#shopify-help-command-flags)
4344
* [`shopify hydrogen build`](#shopify-hydrogen-build)
4445
* [`shopify hydrogen check RESOURCE`](#shopify-hydrogen-check-resource)
@@ -1212,6 +1213,37 @@ DESCRIPTION
12121213
Run `shopify config autoupgrade on` or `shopify config autoupgrade off` to configure it.
12131214
```
12141215

1216+
## `shopify doc search [query]`
1217+
1218+
Query the shopify.dev vector store and print the most relevant documentation chunks as JSON. Best for programmatic discovery — surfacing the relevant pieces of documentation for a topic, rather than retrieving a whole document. To download a full document verbatim, use `doc fetch`.
1219+
1220+
```
1221+
USAGE
1222+
$ shopify doc search [query]
1223+
1224+
ARGUMENTS
1225+
QUERY The search query.
1226+
1227+
FLAGS
1228+
--api-name=<value> [env: SHOPIFY_FLAG_API_NAME] Limit results to a specific API (for example: admin, storefront,
1229+
hydrogen, functions). Unrecognized values are ignored.
1230+
--api-version=<value> [env: SHOPIFY_FLAG_API_VERSION] Limit results to a specific API version (for example: 2025-10,
1231+
latest, current).
1232+
--no-color [env: SHOPIFY_FLAG_NO_COLOR] Disable color output.
1233+
--verbose [env: SHOPIFY_FLAG_VERBOSE] Increase the verbosity of the output.
1234+
1235+
DESCRIPTION
1236+
Query the shopify.dev vector store and print the most relevant documentation chunks as JSON. Best for programmatic
1237+
discovery — surfacing the relevant pieces of documentation for a topic, rather than retrieving a whole document. To
1238+
download a full document verbatim, use `doc fetch`.
1239+
1240+
EXAMPLES
1241+
# search shopify.dev for a topic
1242+
shopify doc search "subscribe to webhooks"
1243+
# narrow the search to a specific API and version
1244+
shopify doc search "create a product" --api-name admin --api-version latest
1245+
```
1246+
12151247
## `shopify help [command] [flags]`
12161248

12171249
Display help for Shopify CLI
@@ -2083,33 +2115,22 @@ DESCRIPTION
20832115

20842116
## `shopify search [query]`
20852117

2086-
Query the shopify.dev vector store and print the most relevant documentation chunks as JSON. Best for programmatic discovery — surfacing the relevant pieces of documentation for a topic, rather than retrieving a whole document. To download a full document verbatim, use `fetch-doc`.
2118+
Starts a search on shopify.dev.
20872119

20882120
```
20892121
USAGE
20902122
$ shopify search [query]
20912123
2092-
ARGUMENTS
2093-
QUERY The search query.
2094-
2095-
FLAGS
2096-
--api-name=<value> [env: SHOPIFY_FLAG_API_NAME] Limit results to a specific API (for example: admin, storefront,
2097-
hydrogen, functions). Unrecognized values are ignored.
2098-
--api-version=<value> [env: SHOPIFY_FLAG_API_VERSION] Limit results to a specific API version (for example: 2025-10,
2099-
latest, current).
2100-
--no-color [env: SHOPIFY_FLAG_NO_COLOR] Disable color output.
2101-
--verbose [env: SHOPIFY_FLAG_VERBOSE] Increase the verbosity of the output.
2102-
21032124
DESCRIPTION
2104-
Query the shopify.dev vector store and print the most relevant documentation chunks as JSON. Best for programmatic
2105-
discovery — surfacing the relevant pieces of documentation for a topic, rather than retrieving a whole document. To
2106-
download a full document verbatim, use `fetch-doc`.
2125+
Starts a search on shopify.dev.
21072126
21082127
EXAMPLES
2109-
# search shopify.dev for a topic
2110-
shopify search "subscribe to webhooks"
2111-
# narrow the search to a specific API and version
2112-
shopify search "create a product" --api-name admin --api-version latest
2128+
# open the search modal on Shopify.dev
2129+
shopify search
2130+
# search for a term on Shopify.dev
2131+
shopify search <query>
2132+
# search for a phrase on Shopify.dev
2133+
shopify search "<a search query separated by spaces>"
21132134
```
21142135

21152136
## `shopify store auth`

packages/cli/oclif.manifest.json

Lines changed: 62 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -3424,6 +3424,65 @@
34243424
"strict": true,
34253425
"summary": "Watch and prints out changes to an app."
34263426
},
3427+
"doc:search": {
3428+
"aliases": [
3429+
],
3430+
"args": {
3431+
"query": {
3432+
"description": "The search query.",
3433+
"name": "query",
3434+
"required": true
3435+
}
3436+
},
3437+
"description": "Query the shopify.dev vector store and print the most relevant documentation chunks as JSON. Best for programmatic discovery — surfacing the relevant pieces of documentation for a topic, rather than retrieving a whole document. To download a full document verbatim, use `doc fetch`.",
3438+
"enableJsonFlag": false,
3439+
"examples": [
3440+
"# search shopify.dev for a topic\n shopify doc search \"subscribe to webhooks\"\n\n # narrow the search to a specific API and version\n shopify doc search \"create a product\" --api-name admin --api-version latest\n "
3441+
],
3442+
"flags": {
3443+
"api-name": {
3444+
"description": "Limit results to a specific API (for example: admin, storefront, hydrogen, functions). Unrecognized values are ignored.",
3445+
"env": "SHOPIFY_FLAG_API_NAME",
3446+
"hasDynamicHelp": false,
3447+
"multiple": false,
3448+
"name": "api-name",
3449+
"type": "option"
3450+
},
3451+
"api-version": {
3452+
"description": "Limit results to a specific API version (for example: 2025-10, latest, current).",
3453+
"env": "SHOPIFY_FLAG_API_VERSION",
3454+
"hasDynamicHelp": false,
3455+
"multiple": false,
3456+
"name": "api-version",
3457+
"type": "option"
3458+
},
3459+
"no-color": {
3460+
"allowNo": false,
3461+
"description": "Disable color output.",
3462+
"env": "SHOPIFY_FLAG_NO_COLOR",
3463+
"hidden": false,
3464+
"name": "no-color",
3465+
"type": "boolean"
3466+
},
3467+
"verbose": {
3468+
"allowNo": false,
3469+
"description": "Increase the verbosity of the output.",
3470+
"env": "SHOPIFY_FLAG_VERBOSE",
3471+
"hidden": false,
3472+
"name": "verbose",
3473+
"type": "boolean"
3474+
}
3475+
},
3476+
"hasDynamicHelp": false,
3477+
"hiddenAliases": [
3478+
],
3479+
"id": "doc:search",
3480+
"pluginAlias": "@shopify/cli",
3481+
"pluginName": "@shopify/cli",
3482+
"pluginType": "core",
3483+
"strict": true,
3484+
"usage": "doc search [query]"
3485+
},
34273486
"docs:generate": {
34283487
"aliases": [
34293488
],
@@ -5649,49 +5708,15 @@
56495708
],
56505709
"args": {
56515710
"query": {
5652-
"description": "The search query.",
5653-
"name": "query",
5654-
"required": true
5711+
"name": "query"
56555712
}
56565713
},
5657-
"description": "Query the shopify.dev vector store and print the most relevant documentation chunks as JSON. Best for programmatic discovery — surfacing the relevant pieces of documentation for a topic, rather than retrieving a whole document. To download a full document verbatim, use `fetch-doc`.",
5714+
"description": "Starts a search on shopify.dev.",
56585715
"enableJsonFlag": false,
56595716
"examples": [
5660-
"# search shopify.dev for a topic\n shopify search \"subscribe to webhooks\"\n\n # narrow the search to a specific API and version\n shopify search \"create a product\" --api-name admin --api-version latest\n "
5717+
"# open the search modal on Shopify.dev\n shopify search\n\n # search for a term on Shopify.dev\n shopify search <query>\n\n # search for a phrase on Shopify.dev\n shopify search \"<a search query separated by spaces>\"\n "
56615718
],
56625719
"flags": {
5663-
"api-name": {
5664-
"description": "Limit results to a specific API (for example: admin, storefront, hydrogen, functions). Unrecognized values are ignored.",
5665-
"env": "SHOPIFY_FLAG_API_NAME",
5666-
"hasDynamicHelp": false,
5667-
"multiple": false,
5668-
"name": "api-name",
5669-
"type": "option"
5670-
},
5671-
"api-version": {
5672-
"description": "Limit results to a specific API version (for example: 2025-10, latest, current).",
5673-
"env": "SHOPIFY_FLAG_API_VERSION",
5674-
"hasDynamicHelp": false,
5675-
"multiple": false,
5676-
"name": "api-version",
5677-
"type": "option"
5678-
},
5679-
"no-color": {
5680-
"allowNo": false,
5681-
"description": "Disable color output.",
5682-
"env": "SHOPIFY_FLAG_NO_COLOR",
5683-
"hidden": false,
5684-
"name": "no-color",
5685-
"type": "boolean"
5686-
},
5687-
"verbose": {
5688-
"allowNo": false,
5689-
"description": "Increase the verbosity of the output.",
5690-
"env": "SHOPIFY_FLAG_VERBOSE",
5691-
"hidden": false,
5692-
"name": "verbose",
5693-
"type": "boolean"
5694-
}
56955720
},
56965721
"hasDynamicHelp": false,
56975722
"hiddenAliases": [

packages/cli/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,9 @@
9494
"scope": "shopify",
9595
"topicSeparator": " ",
9696
"topics": {
97+
"doc": {
98+
"description": "Search and fetch documentation from shopify.dev."
99+
},
97100
"hydrogen": {
98101
"description": "Build Hydrogen storefronts."
99102
},

0 commit comments

Comments
 (0)