Installation
codeanalyzer-typescript is distributed as source on the GitHub repository. You build it once with Bun into a standalone native binary, then run that binary anywhere.
Prerequisites
Section titled “Prerequisites”- Bun 1.0 or higher — used to install dependencies, run, and compile the analyzer.
Install Bun
Section titled “Install Bun”curl -fsSL https://bun.sh/install | bashbrew install oven-sh/bun/bunnpm install -g bunBuild the analyzer
Section titled “Build the analyzer”Clone the repository, install dependencies, and compile the binary:
git clone https://github.com/codellm-devkit/codeanalyzer-tscd codeanalyzer-tsbun installbun run build # -> dist/codeanalyzer-typescriptbun run build produces a standalone native binary at dist/codeanalyzer-typescript — it bundles the runtime, so neither Bun nor Node is needed to run it afterward. Verify it:
./dist/codeanalyzer-typescript --helpWhy your project needs its dependencies
Section titled “Why your project needs its dependencies”To resolve types and call targets the way the project actually compiles, codeanalyzer-typescript drives the TypeScript compiler against the project’s own node_modules. By default it materializes those dependencies before parsing — running the project’s package manager with --ignore-scripts so packages’ .d.ts/JS files are present without compiling native addons.
This means the project you analyze should be a normal Node/TypeScript project (a package.json, ideally a tsconfig.json). A few notes:
node_modulesis installed in place. Node’s module resolution requires it to live in the project tree, so the analyzer installs there and reuses it on later runs.- Already have
node_modules? Pass--no-buildto skip materialization and reuse the prepared tree. --eagerreinstalls dependencies from scratch, mirroring a clean rebuild.- It degrades, never crashes. If the install fails (offline, a broken dependency), the analyzer logs a warning and continues with partial type information rather than aborting.
Optional: CodeQL (level 2)
Section titled “Optional: CodeQL (level 2)”Level-2 analysis (--analysis-level 2) is designed to enrich the call graph with CodeQL. You do not need to install anything for it today — it is an experimental, not-yet-implemented stub that currently falls back to the level-1 graph.
Development
Section titled “Development”The project uses Bun as its toolchain.
git clone https://github.com/codellm-devkit/codeanalyzer-tscd codeanalyzer-tsbun installbun run start -- --input /path/to/typescript/project # run from sourcebun run typecheck # tsc --noEmit