You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add --output flag and drop --content-type from fetch-doc
- `--output <path>` (`-o`) writes the document to a file (creating any
missing parent directories) instead of printing to stdout.
- Remove the `--content-type` flag: fetch-doc now always requests the
Markdown representation. Returning HTML is noisy and expensive and not
a behavior we want to encourage.
- Regenerate oclif manifest, README, and shopify.dev docs.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: .changeset/add-fetch-doc-command.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,4 +2,4 @@
2
2
'@shopify/cli': minor
3
3
---
4
4
5
-
Add a `shopify fetch-doc` command that downloads a document from shopify.dev and prints it to stdout. It requests the Markdown representation by default (overridable with `--content-type`), giving agents an easy way to pull instructional content from the centralized docs.
5
+
Add a `shopify fetch-doc` command that downloads a document from shopify.dev and prints it to stdout, or writes it to a file with `--output`. It requests the Markdown representation that every shopify.dev page has, giving agents an easy way to pull instructional content from the centralized docs verbatim.
Copy file name to clipboardExpand all lines: packages/cli/README.md
+13-11Lines changed: 13 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1215,7 +1215,7 @@ DESCRIPTION
1215
1215
1216
1216
## `shopify fetch-doc [URL]`
1217
1217
1218
-
Download a complete document from shopify.dev. Every page on shopify.dev has a Markdown version, and that is what this tool returns by default. Use this to pull an entire document verbatim — for example, a set of instructions an agent follows like a centrally-served skill. For finding the relevant pieces of content across shopify.dev instead, use `search`.
1218
+
Download a complete document from shopify.dev. Every page on shopify.dev has a Markdown version, and that is what this tool returns. Use this to pull an entire document verbatim — for example, a set of instructions an agent follows like a centrally-served skill. For finding the relevant pieces of content across shopify.dev instead, use `search`.
1219
1219
1220
1220
```
1221
1221
USAGE
@@ -1225,22 +1225,24 @@ ARGUMENTS
1225
1225
URL The shopify.dev URL to fetch.
1226
1226
1227
1227
FLAGS
1228
-
--content-type=<value> [env: SHOPIFY_FLAG_CONTENT_TYPE] The Accept content type to request (defaults to
1229
-
text/markdown).
1230
-
--no-color [env: SHOPIFY_FLAG_NO_COLOR] Disable color output.
1231
-
--verbose [env: SHOPIFY_FLAG_VERBOSE] Increase the verbosity of the output.
1228
+
-o, --output=<value> [env: SHOPIFY_FLAG_OUTPUT] Write the document to this file path instead of printing it to
1229
+
stdout.
1230
+
--no-color [env: SHOPIFY_FLAG_NO_COLOR] Disable color output.
1231
+
--verbose [env: SHOPIFY_FLAG_VERBOSE] Increase the verbosity of the output.
1232
1232
1233
1233
DESCRIPTION
1234
1234
Download a complete document from shopify.dev. Every page on shopify.dev has a Markdown version, and that is what this
1235
-
tool returns by default. Use this to pull an entire document verbatim — for example, a set of instructions an agent
1236
-
follows like a centrally-served skill. For finding the relevant pieces of content across shopify.dev instead, use
1237
-
`search`.
1235
+
tool returns. Use this to pull an entire document verbatim — for example, a set of instructions an agent follows like
1236
+
a centrally-served skill. For finding the relevant pieces of content across shopify.dev instead, use `search`.
1238
1237
1239
1238
EXAMPLES
1240
1239
# fetch the Markdown version of a Shopify.dev page
Copy file name to clipboardExpand all lines: packages/cli/oclif.manifest.json
+12-10Lines changed: 12 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -3544,20 +3544,13 @@
3544
3544
"required": true
3545
3545
}
3546
3546
},
3547
-
"description": "Download a complete document from shopify.dev. Every page on shopify.dev has a Markdown version, and that is what this tool returns by default. Use this to pull an entire document verbatim — for example, a set of instructions an agent follows like a centrally-served skill. For finding the relevant pieces of content across shopify.dev instead, use `search`.",
3547
+
"description": "Download a complete document from shopify.dev. Every page on shopify.dev has a Markdown version, and that is what this tool returns. Use this to pull an entire document verbatim — for example, a set of instructions an agent follows like a centrally-served skill. For finding the relevant pieces of content across shopify.dev instead, use `search`.",
3548
3548
"enableJsonFlag": false,
3549
3549
"examples": [
3550
-
"# fetch the Markdown version of a Shopify.dev page\n shopify fetch-doc https://shopify.dev/docs/api/shopify-cli\n\n # fetch the HTML version of a Shopify.dev page\n shopify fetch-doc https://shopify.dev/docs/api/shopify-cli --content-type text/html\n"
3550
+
"# fetch the Markdown version of a Shopify.dev page\nshopify fetch-doc https://shopify.dev/docs/api/shopify-cli",
3551
+
"# save the document to a file instead of printing it\nshopify fetch-doc https://shopify.dev/docs/api/shopify-cli --output docs/shopify-cli.md"
3551
3552
],
3552
3553
"flags": {
3553
-
"content-type": {
3554
-
"description": "The Accept content type to request (defaults to text/markdown).",
3555
-
"env": "SHOPIFY_FLAG_CONTENT_TYPE",
3556
-
"hasDynamicHelp": false,
3557
-
"multiple": false,
3558
-
"name": "content-type",
3559
-
"type": "option"
3560
-
},
3561
3554
"no-color": {
3562
3555
"allowNo": false,
3563
3556
"description": "Disable color output.",
@@ -3566,6 +3559,15 @@
3566
3559
"name": "no-color",
3567
3560
"type": "boolean"
3568
3561
},
3562
+
"output": {
3563
+
"char": "o",
3564
+
"description": "Write the document to this file path instead of printing it to stdout.",
3565
+
"env": "SHOPIFY_FLAG_OUTPUT",
3566
+
"hasDynamicHelp": false,
3567
+
"multiple": false,
3568
+
"name": "output",
3569
+
"type": "option"
3570
+
},
3569
3571
"verbose": {
3570
3572
"allowNo": false,
3571
3573
"description": "Increase the verbosity of the output.",
Copy file name to clipboardExpand all lines: packages/cli/src/cli/commands/fetch-doc.ts
+9-10Lines changed: 9 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -5,17 +5,15 @@ import {Args, Flags} from '@oclif/core'
5
5
6
6
exportdefaultclassFetchDocextendsCommand{
7
7
staticdescription=
8
-
'Download a complete document from shopify.dev. Every page on shopify.dev has a Markdown version, and that is what this tool returns by default. Use this to pull an entire document verbatim — for example, a set of instructions an agent follows like a centrally-served skill. For finding the relevant pieces of content across shopify.dev instead, use `search`.'
8
+
'Download a complete document from shopify.dev. Every page on shopify.dev has a Markdown version, and that is what this tool returns. Use this to pull an entire document verbatim — for example, a set of instructions an agent follows like a centrally-served skill. For finding the relevant pieces of content across shopify.dev instead, use `search`.'
9
9
10
10
staticusage=`fetch-doc [URL]`
11
11
12
12
staticexamples=[
13
13
`# fetch the Markdown version of a Shopify.dev page
0 commit comments