dotnet-inspect
CLI tool for inspecting .NET libraries and NuGet packages. It is for .NET what docker inspect and kubectl describe are for container land — view metadata, APIs, vulnerabilities, provenance, and compare versions.
Installation
dotnet tool install -g dotnet-inspect
Or run without installing (like npx):
dnx dotnet-inspect -y -- <command>
Quick Reference
| Command | Purpose |
|---|
package X | Package metadata, dependencies, files, versions |
library X | Library metadata, symbols, SourceLink audit, dependency tree |
type | Discover types (terse, no docs) — use --shape for hierarchy |
member X | Inspect members (docs on by default, supports dotted syntax) |
diff X | Compare versions with breaking/additive classification |
extensions X | Find extension methods/properties for a type |
implements X | Find types implementing an interface or extending a class |
depends X | Walk dependency graphs — type hierarchy, package deps, library refs (--mermaid for diagrams) |
find X | Search for types across packages, frameworks, and local assets |
source X | SourceLink URLs — type or member level, --cat to fetch content |
Bare Names
A bare name like dotnet-inspect System.Text.Json uses a router to pick the best source. Platform libraries (System.*, Microsoft.AspNetCore) resolve to the installed SDK by default. Other names resolve to NuGet packages. Use explicit package or library --package to override.
Common Flags
| Flag | Description |
|---|
-v:q/m/n/d | Verbosity: quiet, minimal (default), normal, detailed |
--oneline | Compact columnar output, one result per line |
--platform | Search all platform frameworks (find, extensions, implements) |
--json | JSON output |
--mermaid | Mermaid diagram output (depends command) |
-s Name | Include section (glob-capable: -s Ext*) |
-x Name | Exclude section |
--shape | Type shape diagram (hierarchy + members) — type command |
--all | Include non-public, hidden, and obsolete members |
--docs / --no-docs | Control XML docs — member has docs on by default |
--source-link-audit | SourceLink/determinism audit |
-T:q/d | Tips verbosity (contextual hints on stderr) |
-n N / --head N / -N | First N lines of output (like head) |
--tail N | Last N lines of output (like tail) |
Commands
package
Inspect NuGet packages. This is the default command for bare names that don't match platform libraries.
dotnet-inspect package System.Text.Json # Metadata (latest version)
dotnet-inspect package System.Text.Json@8.0.0 -v:d # Detailed (shows vulnerabilities)
dotnet-inspect package System.Text.Json --versions # List available versions
dotnet-inspect package System.Text.Json --version 11.0.0-preview* # Wildcard version
dotnet-inspect package System.Text.Json --layout --lib # File tree (lib/ only)
dotnet-inspect package System.Text.Json --dependencies # Package dependency tree
dotnet-inspect package System.Text.Json --tfms # List target frameworks
Multi-library packages
Some packages bundle multiple libraries per TFM (e.g., Microsoft.Azure.SignalR).
dotnet-inspect package Microsoft.Azure.SignalR # Shows Libraries: 2
dotnet-inspect package Microsoft.Azure.SignalR --layout # File tree
dotnet-inspect member Microsoft.Azure.SignalR -v:q --library Microsoft.Azure.SignalR.Common.dll # Secondary library
Custom NuGet sources
dotnet-inspect package MyPackage --source https://my-feed/v3/index.json
dotnet-inspect package MyPackage --add-source https://dev-feed/v3/index.json --prerelease
dotnet-inspect package MyPackage --nugetconfig ./nuget.config
library
Inspect a library — from platform, NuGet package, or local file.
dotnet-inspect library System.Text.Json # Platform library (runtime)
dotnet-inspect library --package System.Text.Json # Library from NuGet package
dotnet-inspect library ./bin/MyLib.dll # Local file
dotnet-inspect library --package System.Text.Json -s # List 13 available sections
dotnet-inspect library --package System.Text.Json --source-link-audit # SourceLink audit
dotnet-inspect library Microsoft.Extensions.AI.OpenAI --dependencies # Dependency tree (visual)
dotnet-inspect library System.Text.Json --references -s Lib* # Direct references
dotnet-inspect library --package System.Text.Json --extract-resources resources/ # Extract resources
type
Discover types in a package or library — terse output, no docs by default.