Skip to content

Getting started ​

CodeGuard runs local, deterministic analysis over supported JavaScript and TypeScript files. It does not execute project code or call an AI model.

Build from the repository ​

With Node.js 24 installed:

sh
nvm use
npm ci
npm run build

Analyze a project ​

sh
node dist/cli/index.js check /path/to/project
node dist/cli/index.js check /path/to/project --json

On Windows, use a path such as C:\work\my-project, or run from the project directory with node <checkout>\dist\cli\index.js check ..

Create a starter codeguard.config.json in the current directory with:

sh
node dist/cli/index.js init

The command will not overwrite an existing config. For configuration and rule options, see Configuration.

Exit codes ​

  • 0: analysis completed without error-severity diagnostics.
  • 1: analysis completed and found one or more errors.
  • 2: invalid configuration or an execution failure.

Use MCP ​

Start a server scoped to one project:

sh
node dist/cli/index.js mcp --root /path/to/project

The root argument is required. For MCP client setup, see MCP setup.