- name
- microsoft-learn
- description
- >
Microsoft Learn
Search official Microsoft documentation via the mslearn CLI (@microsoft/learn-cli).
Setup
npm install -g @microsoft/learn-cliIf not installed, prefix commands with npx @microsoft/learn-cli instead of mslearn.
Commands
search — Find documentation
mslearn search "Azure Functions Python v2 programming model"Returns up to 10 results with title, URL, and content excerpt.
code-search — Find working code samples
mslearn code-search "upload file to blob storage" --language csharpSupported languages: csharp, javascript, typescript, python, powershell, java, go, rust, ruby, php
fetch — Get full page content
mslearn fetch "https://learn.microsoft.com/..." [--section "heading"] [--max-chars 5000]When to use which
- User asks a concept/how-to question →
search - User needs code examples or is debugging →
code-searchwith--language - You already have a docs URL and need details →
fetch - Search results are too brief →
fetchthe URL from search results
Tips
- Add
--jsonfor machine-readable output when chaining with other tools. - If no results, rephrase with more specific Microsoft product names.
- Prefer
code-searchoversearchwhen the user is actively writing code.