Skip to content

Fix CLI shell references and refactor MCP client defaults#126

Merged
TianqiZhang merged 3 commits intoMicrosoftDocs:mainfrom
TianqiZhang:fix/cli-shell-refs-and-client-refactor
Mar 16, 2026
Merged

Fix CLI shell references and refactor MCP client defaults#126
TianqiZhang merged 3 commits intoMicrosoftDocs:mainfrom
TianqiZhang:fix/cli-shell-refs-and-client-refactor

Conversation

@TianqiZhang
Copy link
Collaborator

@TianqiZhang TianqiZhang commented Mar 13, 2026

Summary

  • Replace "via Bash" with "from the command line" in skill docs — the Learn CLI works in any shell, not just Bash
  • Change code block language markers from ```bash to ```sh for shell-agnostic examples
  • Rename MCP client name from mslearn to learn-cli
  • Centralize clientName and clientVersion defaults in context.ts instead of duplicating them in every command file

Test plan

  • npm run build passes
  • All 32 unit tests pass (npm test)
  • Verify CLI connects to endpoint correctly with new client name (mslearn doctor)

🤖 Generated with Claude Code

- 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>
Copilot AI review requested due to automatic review settings March 13, 2026 06:43
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 Bashfrom the command line, bash → sh).
  • Update MCP client identification default name to learn-cli.
  • Centralize clientName/clientVersion defaults in createDefaultContext() 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.

TianqiZhang and others added 2 commits March 13, 2026 14:53
- 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>
@TianqiZhang TianqiZhang merged commit abe8ea1 into MicrosoftDocs:main Mar 16, 2026
2 checks passed
@TianqiZhang TianqiZhang deleted the fix/cli-shell-refs-and-client-refactor branch March 16, 2026 02:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants