| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
日本語版は README.ja.md です。
code-map is a GitHub Copilot CLI extension that adds the /code-map custom command. It analyzes a .NET solution and renders a project dependency map as a text summary, Mermaid diagram, and interactive preview when the host supports canvases.
.github/code-map/
extension.mjs # Copilot CLI extension entry point and canvas preview
code-map.cs # C# analyzer invoked by the extension
LICENSE # MIT License
README.md
README.ja.md
SECURITY.md
Run the command from Copilot CLI in a repository or directory that contains a .NET solution:
/code-map [directory-or-solution] [max-projects] [max-edges]
Arguments:
| Argument | Description | Default |
|---|---|---|
| directory-or-solution | A .sln or .slnx file, or a directory to search for solution files. | Current working directory |
| max-projects | Maximum number of projects shown in the diagram. | 40 |
| max-edges | Maximum number of project-reference edges shown in the diagram. | 80 |
Examples:
/code-map
/code-map ./MyApp.sln
/code-map ./src 25 50
If a directory contains multiple solution files, the extension asks you to choose one when interactive UI is available. Without interactive UI, it uses the first discovered solution.
The command reports:
When a canvas is available, /code-map opens an interactive dependency map. Use the Projects/Namespaces toggle to switch granularity, and click a node to highlight connected references. Cycle nodes and edges stay highlighted in red. When a canvas is unavailable, the command logs Mermaid source inline.
The C# analyzer:
Namespace analysis covers C# projects only. It reads *.cs files under each project (excluding bin/obj), so it includes namespaces that are referenced through using directives and may include unused usings. Cycle detection runs on the full dependency graph, so cycles are still reported even when the diagram is truncated.
| Problem | What to check |
|---|---|
| dotnet execution fails | Confirm dotnet is installed, on PATH, and supports C# file-based apps. |
| No solution is found | Pass a .sln or .slnx file directly, or run from a directory containing one. |
| Invalid limit error | max-projects and max-edges must be positive integers. |
| Canvas does not open | The current Copilot CLI host may not support canvases; use the Mermaid output fallback. |
| Namespaces toggle is disabled | No namespace graph was produced. Namespace analysis only runs for C# (.csproj) projects. |
| First run is slow or fails offline | The first analyzer run restores Microsoft.CodeAnalysis.CSharp from NuGet. Run once with network access to cache it. |
| Browser preview cannot render | Check network access to cdn.jsdelivr.net; the local preview loads Mermaid from that CDN. |
| Some project references are missing | References outside the selected solution are summarized as warnings instead of being drawn as nodes. |
There is no package manifest in this repository. The extension is implemented as a single JavaScript module and a C# file-based analyzer.
Useful checks:
node --check .github\code-map\extension.mjs
dotnet .github\code-map\code-map.cs -- --output <output.json> --solution <solution.sln>This project is licensed under the MIT License. See LICENSE.
See SECURITY.md for supported versions and vulnerability reporting guidance.
| Back | FazBrowse Home | New Git URL |