| title | Standalone CLI |
|---|---|
| description | Run the devtools from the command line, build a static report, or start an MCP server. |
The package installs an ng-devtools binary. Run it from the root of your Angular workspace, or point it there with --root. It scans the source files in that folder, so it works without starting your app.
| Command | What it does |
|---|---|
dev |
Starts a local server with the devtools UI. |
build |
Writes a static copy of the devtools with the scan. |
mcp |
Starts an MCP server over stdio for coding agents. |
ng-devtools --version prints the package version. An unknown command or flag prints one error line and exits with code 1. ng-devtools --help lists the commands and flags.
| Flag | What it does |
|---|---|
--root <dir> |
The project folder to scan. The default is NG_DEVTOOLS_ROOT, then the working directory. |
--config <file> |
A JSON file with the devtools options. The default is NG_DEVTOOLS_CONFIG, then ng-devtools.config.json in the project folder, if it exists. |
--read-only |
Sets agent.readOnly: drops the agent tools that act on the page or the server. See Inspectors and agent tools. |
If the project folder has no angular.json and no package.json that depends on @angular/core, the CLI prints a warning on stderr, because the scans find nothing there.
The file holds the same options as createNgDevtools(), as JSON:
// ng-devtools.config.json
{
"inspectors": {"analog": false},
"agent": {"readOnly": true},
"redaction": {"secretNames": ["passport"]}
}A missing --config file or invalid JSON stops the command with an error.
npx @santoshyadavdev/ng-devtools devpnpm dlx @santoshyadavdev/ng-devtools devyarn dlx @santoshyadavdev/ng-devtools devbunx @santoshyadavdev/ng-devtools devWith the package installed in your project, call the binary through your package manager:
npx ng-devtools dev
npx ng-devtools build --outDir dist-report
npx ng-devtools mcpThe default command starts a local server with the devtools UI. dev is optional: npx @santoshyadavdev/ng-devtools does the same.
npx @santoshyadavdev/ng-devtools dev --port 9999 --openWhen the server is ready, it prints the version, the panel URL and the MCP endpoint:
ng-devtools v0.0.5
Panel: http://localhost:9999/
MCP: http://localhost:9999/__mcp
If you pass no --port and port 9999 is taken, it also prints the port it uses instead.
| Flag | What it does |
|---|---|
--port <port> |
Port to listen on. The default is 9999. If it is taken, a random free port is used. |
--host <host> |
Host to bind to. The default is localhost. |
--open, --no-open |
Open the browser on start, or not. |
--no-auth |
Turn off the one-time code the server asks for. |
--mcp, --no-mcp |
Mount the MCP endpoint at /__mcp, or not. It is on by default. |
localhost by default and asks for a one-time code. Changing --host or passing --no-auth widens who can reach it. See Access and redaction.
No page is connected to the CLI server. The tabs show what your source declares:
For live data, mount the devtools in your app's own server. See Angular CLI and Express or Vite and Analog.build writes a self-contained static copy of the devtools with the source scan baked in: components, routes, signals, providers, pipes, NgRx declarations and build metadata.
npx @santoshyadavdev/ng-devtools build --outDir dist-report| Flag | What it does |
|---|---|
--outDir <dir> |
Output directory. The default is dist-static. It is emptied first. |
--pretty |
Pretty-print the data files. They get larger on disk. |
--force |
Empty --outDir even when it holds files that are not a previous report. |
The build deletes everything in --outDir before it writes the report. To protect your files, it stops with an error when --outDir is:
- the working directory or one of its parents, even with
--force. With--root, this covers both the folder you ran the command from and the--rootfolder, - a file, or a folder that is not empty and has no
__connection.json(so it is not a previous report), unless you pass--force.
The output is static files. Open it offline or host it on any static file server. It is a snapshot of your source at build time, so rebuild it after code changes.
mcp starts an *MCP server over stdio for coding agents:
npx @santoshyadavdev/ng-devtools mcpYour agent client runs this command for you. MCP server covers client setup.
The stdio server has no page connected, so it registers only the tools that read your source files. The tools that need a page, such as highlight, navigate, form-action and the forms and router tools, are left out. For live data, point your agent at the HTTP endpoint of a running app instead. On a hub it lives at /__devframes/__mcp.
--root.
Without --port, the server picks a random free port and prints it. Pass --port to choose one yourself.
Client setup for stdio, and the HTTP endpoint for live data.
Mount the hub in your app for live inspectors.