diff --git a/.changeset/doc-fetch-language.md b/.changeset/doc-fetch-language.md new file mode 100644 index 00000000000..cc9f16ec24f --- /dev/null +++ b/.changeset/doc-fetch-language.md @@ -0,0 +1,5 @@ +--- +'@shopify/cli': minor +--- + +Add `--language` to `doc fetch` to filter shopify.dev Markdown code examples to a single language. diff --git a/docs-shopify.dev/generated/generated_docs_data_v2.json b/docs-shopify.dev/generated/generated_docs_data_v2.json index f8260ae67a9..9f058f5b0c3 100644 --- a/docs-shopify.dev/generated/generated_docs_data_v2.json +++ b/docs-shopify.dev/generated/generated_docs_data_v2.json @@ -3174,6 +3174,15 @@ "description": "The following flags are available for the `doc fetch` command:", "isPublicDocs": true, "members": [ + { + "filePath": "docs-shopify.dev/commands/interfaces/doc-fetch.interface.ts", + "syntaxKind": "PropertySignature", + "name": "--language ", + "value": "string", + "description": "Filter code examples in the returned Markdown to this language. Supply the language of the app you are building so examples match your stack. Optional — if omitted, or if shopify.dev does not recognize the language for a given page, the document includes examples in every language.", + "isOptional": true, + "environmentValue": "SHOPIFY_FLAG_LANGUAGE" + }, { "filePath": "docs-shopify.dev/commands/interfaces/doc-fetch.interface.ts", "syntaxKind": "PropertySignature", @@ -3210,7 +3219,7 @@ "environmentValue": "SHOPIFY_FLAG_VERBOSE" } ], - "value": "export interface docfetch {\n /**\n * Disable color output.\n * @environment SHOPIFY_FLAG_NO_COLOR\n */\n '--no-color'?: ''\n\n /**\n * Write the document to this file path instead of printing it to stdout.\n * @environment SHOPIFY_FLAG_OUTPUT\n */\n '--output '?: string\n\n /**\n * The shopify.dev URL to fetch.\n * @environment SHOPIFY_FLAG_URL\n */\n '--url ': string\n\n /**\n * Increase the verbosity of the output. May include sensitive data.\n * @environment SHOPIFY_FLAG_VERBOSE\n */\n '--verbose'?: ''\n}" + "value": "export interface docfetch {\n /**\n * Filter code examples in the returned Markdown to this language. Supply the language of the app you are building so examples match your stack. Optional — if omitted, or if shopify.dev does not recognize the language for a given page, the document includes examples in every language.\n * @environment SHOPIFY_FLAG_LANGUAGE\n */\n '--language '?: string\n\n /**\n * Disable color output.\n * @environment SHOPIFY_FLAG_NO_COLOR\n */\n '--no-color'?: ''\n\n /**\n * Write the document to this file path instead of printing it to stdout.\n * @environment SHOPIFY_FLAG_OUTPUT\n */\n '--output '?: string\n\n /**\n * The shopify.dev URL to fetch.\n * @environment SHOPIFY_FLAG_URL\n */\n '--url ': string\n\n /**\n * Increase the verbosity of the output. May include sensitive data.\n * @environment SHOPIFY_FLAG_VERBOSE\n */\n '--verbose'?: ''\n}" } }, "docsearch": { diff --git a/packages/cli/README.md b/packages/cli/README.md index 2cf7e7739ac..6e0e9c728ad 100644 --- a/packages/cli/README.md +++ b/packages/cli/README.md @@ -1598,7 +1598,7 @@ FLAGS [env: SHOPIFY_FLAG_NAME] -p, --path= - [default: .] [env: SHOPIFY_FLAG_PATH] + [default: ./packages/cli] [env: SHOPIFY_FLAG_PATH] --auth-alias= Alias of the Shopify account to use for authentication. @@ -2134,13 +2134,21 @@ DESCRIPTION ## `shopify doc fetch` -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 `doc search`. +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. Pass `--language` for the language of the app you are building so code examples match your stack. For finding the relevant pieces of content across shopify.dev instead, use `doc search`. ``` USAGE - $ shopify doc fetch --url [--no-color] [--output ] [--verbose] + $ shopify doc fetch --url [--language + javascript|typescript|python|ruby|php|rust|curl|liquid|graphql|html] [--no-color] [--output ] [--verbose] FLAGS + --language=