[Feature] Add --language to doc fetch - #8517
Open
jplhomer wants to merge 1 commit into
Open
Conversation
shopify.dev can filter Markdown examples via Accept-Language. Pass the language of the app you are building; unrecognized values fall back to the full document. Co-authored-by: AI (Pi/Grok 4.6) <noreply@pi.dev>
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Generated help/manifest content now shows --path defaulting to ./packages/cli, which is incorrect for end users and should be corrected before merging.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Adds support for fetching shopify.dev Markdown with language-specific code examples, enabling agents (and users) to request docs tailored to an app’s programming language.
Changes:
- Add
--languagetoshopify doc fetchand forward it viaAccept-Languageon the HTTP request. - Add test coverage verifying
Accept-Languageis sent when provided. - Update generated CLI docs/artifacts and add a changeset for the new flag.
File summaries
| File | Description |
|---|---|
| packages/cli/src/cli/services/commands/doc/fetch.ts | Adds optional language parameter and conditionally sends Accept-Language header. |
| packages/cli/src/cli/services/commands/doc/fetch.test.ts | Adds assertion that Accept-Language is included in the fetch headers. |
| packages/cli/src/cli/commands/doc/fetch.ts | Introduces --language flag (with options/env) and wires it into the service call + help text/examples. |
| packages/cli/README.md | Updates generated command docs for doc fetch (and also changes an unrelated --path default). |
| packages/cli/oclif.manifest.json | Updates generated manifest for doc fetch (and also changes --path defaults). |
| docs-shopify.dev/generated/generated_docs_data_v2.json | Updates generated public docs data to include the new --language flag. |
| .changeset/doc-fetch-language.md | Declares a minor bump for the new user-facing flag. |
Review details
Suppressed comments (1)
packages/cli/oclif.manifest.json:4949
- Same issue here: the manifest renders the
--pathdefault as./packages/cliinstead of the intended current-directory default. This should be represented as.(or omitted) so--helpoutput stays accurate.
"path": {
"char": "p",
"default": "./packages/cli",
"description": "The path to run tests in. Defaults to current directory.",
- Files reviewed: 6/7 changed files
- Comments generated: 2
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
3155
to
3158
| "path": { | ||
| "char": "p", | ||
| "default": ".", | ||
| "default": "./packages/cli", | ||
| "env": "SHOPIFY_FLAG_PATH", |
|
|
||
| -p, --path=<value> | ||
| [default: .] [env: SHOPIFY_FLAG_PATH] | ||
| [default: ./packages/cli] [env: SHOPIFY_FLAG_PATH] |
dmerand
approved these changes
Sep 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
WHY are these changes introduced?
shopify.dev can now filter Markdown code examples to a single language. Agents fetching docs should be able to request examples in the language of the app they are building.
WHAT is this pull request doing?
Add
--languagetodoc fetch. When set, the request includesAccept-Languageso shopify.dev can return examples for that language. Help text lists the known keys and tells agents to pass the language of the app they are building. If shopify.dev does not recognize the language for a page, it returns the unfiltered document.How to manually test your changes?
Ruby should drop JavaScript examples. Python may fall back to all examples if that page has none.
Checklist
patchfor bug fixes ·minorfor new features ·majorfor breaking changes) and added a changeset withpnpm changeset add