Fix CLI shell references and refactor MCP client defaults#126
Merged
TianqiZhang merged 3 commits intoMicrosoftDocs:mainfrom Mar 16, 2026
Merged
Conversation
- Replace "via Bash" with "from the command line" in skill docs since the Learn CLI works in any shell, not just Bash - Change code block language markers from ```bash to ```sh - Rename MCP client name from "mslearn" to "learn-cli" - Centralize clientName and clientVersion defaults in context.ts instead of repeating them in every command file Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Updates Learn skill documentation to be shell-agnostic and refactors the CLI’s MCP client identification/defaults to reduce per-command duplication.
Changes:
- Adjust skill docs wording and code fences to avoid Bash-specific guidance (
via Bash→from the command line,bash →sh). - Update MCP client identification default name to
learn-cli. - Centralize
clientName/clientVersiondefaults increateDefaultContext()and simplify command client creation.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| skills/microsoft-skill-creator/SKILL.md | Make CLI fallback guidance shell-agnostic (sh fences, wording). |
| skills/microsoft-docs/SKILL.md | Same shell-agnostic doc updates for CLI fallback. |
| skills/microsoft-code-reference/SKILL.md | Same shell-agnostic doc updates for CLI fallback. |
| cli/src/mcp/client.ts | Change default MCP client name to learn-cli. |
| cli/src/context.ts | Inject default clientName/clientVersion via context-level createClient. |
| cli/src/commands/search.ts | Rely on context defaults; pass only endpoint to createClient. |
| cli/src/commands/fetch.ts | Rely on context defaults; pass only endpoint to createClient. |
| cli/src/commands/doctor.ts | Rely on context defaults; pass only endpoint to createClient. |
| cli/src/commands/code-search.ts | Rely on context defaults; pass only endpoint to createClient. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Export DEFAULT_CLIENT_NAME from client.ts as single source of truth - Pass context's fetchImpl to createClient so MCP client and probeEndpoint use the same fetch implementation Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Remove fetchImpl and clientName from CliContext; client.ts already defaults both internally - Make DEFAULT_CLIENT_NAME a private constant (no need to export) - Default probeEndpoint's fetchImpl parameter to globalThis.fetch - Simplify configureOutput wrappers in index.ts - context.ts only injects clientVersion (needs access to package version) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
partychen
approved these changes
Mar 16, 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.
Summary
```bashto```shfor shell-agnostic examplesmslearntolearn-cliclientNameandclientVersiondefaults incontext.tsinstead of duplicating them in every command fileTest plan
npm run buildpassesnpm test)mslearn doctor)🤖 Generated with Claude Code