Search official Microsoft documentation via the mslearn CLI ( @microsoft/learn-cli).
bash
npm install -g @microsoft/learn-cli
If not installed, prefix commands with npx @microsoft/learn-cli instead of mslearn.
bash
mslearn search "Azure Functions Python v2 programming model"
Returns up to 10 results with title, URL, and content excerpt.
bash
mslearn code-search "upload file to blob storage" --language csharp
Supported languages: csharp, javascript, typescript, python, powershell, java, go, rust, ruby, php
bash
mslearn fetch "https://learn.microsoft.com/..." [--section "heading"] [--max-chars 5000]
searchcode-search with --languagefetchfetch the URL from search results--json for machine-readable output when chaining with other tools.code-search over search when the user is actively writing code.