Documentation
Install
dotnet tool install -g bnl-dotnet
Commands
| Command | Tier | What it does |
|---|---|---|
basic [path] |
Free | Lists every analyzable method, in the form to type back in. |
basic [path] <method> |
Free | Diagrams one method in isolation - full LINQ decomposition and call styling, but never follows a call into another method's own diagram. |
endpoint [path] |
Paid | Lists every controller action (ASP.NET Core Web API entry point). |
endpoint [path] <action> |
Paid | Full composed diagram for one controller action - every method it reaches, spliced into one page. |
method [path] |
Paid | Lists every analyzable method - broader than endpoint, not just controller actions. |
method [path] <method> |
Paid | Full composed diagram starting from any method - the paid counterpart to basic. |
license <key> |
- | Activates a license key locally, so it's picked up by every future run. |
Finding your project
Run it from the folder containing your API, the way you would dotnet build:
bnl-dotnet endpoint OrdersController.GetById
[path] is a .sln, .slnx or .csproj (or a folder containing one). Leave it out and the one in the current folder is used - a solution if there is exactly one, otherwise the one project; if there are several, you're asked to pick. With a single argument, it's treated as the project if it looks like one and as the method otherwise.
Naming a method
Write Type.Method. Add the namespace (Orders.Api.OrdersController.Get) if the same type name exists in two places, and parameter types (OrdersController.Get(int)) to pick one overload. If a name matches several methods the tool lists them and stops rather than guessing. The list commands print each method in the form to type back in.
Choosing from a menu
Don't know the method's name? Run any of basic, endpoint or method with -i:
bnl-dotnet basic --interactive
bnl-dotnet endpoint -i
You get one alphabetical list (for endpoint, each controller action with its HTTP verb and route), 15 rows to a page. Use the up and down arrows to move and page, or start typing to filter the list; press Enter to generate the diagram for the highlighted entry. The equivalent typed command is printed, so you can skip the menu next time. --interactive needs a terminal, so it can't be used when output is piped, and can't be combined with --stdout or with a method name.
Output
By default the diagram is written to <Type.Method>.mmd in the current folder.
| Option | What it does |
|---|---|
-o, --output <path> | Write to this file - or, if it's a folder (existing, or ending in /), to <Type.Method>.mmd inside it. Missing folders are created. |
--stdout | Write the diagram to standard output and nothing else, so it can be redirected or piped. Can't be combined with -o. |
-f, --format <mermaid|markdown> | mermaid (default) is the bare diagram; markdown wraps it in a ```mermaid fence (.md) so it renders on GitHub or in a README or PR. |
--depth <n> | endpoint and method only. How many levels of calls to follow (default 25); 1 draws just the starting method. |
-i, --interactive | Choose the method from a menu instead of naming it - see Choosing from a menu. |
-q, --quiet | Suppress informational output. |
--verbose | Show every message MSBuild produced while loading the project. A long list is otherwise summarized in one line. |
--version | Print the tool version. |
bnl-dotnet endpoint OrdersController.GetById --stdout > orders-get.mmd
bnl-dotnet endpoint OrdersController.GetById -o docs/ --format markdown
With --stdout, STDOUT carries only the diagram: the license line, progress spinner and notes aren't printed at all. A successful run writes nothing to STDERR; errors (and any license warning that needs your attention) go to STDERR, and a failed run writes nothing to STDOUT. Exit codes are 0 on success and non-zero on failure. When STDOUT is piped, endpoint and method with no method print one reference per line, so bnl-dotnet endpoint | fzf works.
On Windows PowerShell 5.1, > re-encodes output as UTF-16 - use -o there (PowerShell 7 and other shells are fine).
Licensing
basic is free forever, with no signup. endpoint and method need an Individual or Team license. After subscribing you'll get a license key by email; activate it once with:
bnl-dotnet license dgcli_...
This persists the key locally under your user profile, so it's picked up automatically on every later run. For CI, set it as an environment variable instead:
BNL_DOTNET_LICENSE=dgcli_...
The license works fully offline day to day - the CLI checks in with the license server only as your key nears its renewal date, and only to fetch a freshly-dated key if your subscription is still active. If that check can't reach the server at all, the CLI keeps working on the last-known-good key for a generous grace period rather than breaking your pipeline over a connectivity gap - only an explicit "this subscription has lapsed" from a reachable server stops it immediately. Keys are never tied to a specific machine.
Every run shows its license status
Every command prints a one-line status so it's always visible what tier you're running as - License: Free, License: Individual (you@example.com), or License: Team (you@example.com).