Prebuilt codeanalyzer-typescript backend binary for CLDK (codellm-devkit).
Project description
A TypeScript Static Analysis Toolkit (and Library)
A comprehensive static analysis tool for TypeScript and JavaScript source code that
produces the canonical CodeLLM-DevKit (CLDK) analysis.json — a symbol table plus a
resolver-based call graph — using the TypeScript compiler via ts-morph.
It is the TypeScript backend behind CLDK,
mirroring its Python and
Java siblings.
Install
pip install codeanalyzer-typescript
The wheel bundles a prebuilt, self-contained cants binary for your platform (no Bun or
Node required to run it) and installs a cants command on your PATH. CLDK's Python SDK
depends on this package to locate the analyzer backend.
Usage
The analyzer provides a command-line interface for performing static analysis on TypeScript/JavaScript projects.
Basic Usage
cants --input /path/to/typescript/project
Command Line Options
To view the available options, run cants --help:
Usage: cants [options]
CLDK TypeScript analyzer — emits the canonical analysis.json
(symbol table + resolver call graph).
Options:
-i, --input <path> project root to analyze
-o, --output <dir> output directory for analysis.json
(omit ⇒ compact JSON to stdout)
-f, --format <fmt> output format: json | msgpack (default: "json")
-a, --analysis-level <n> analysis depth: 1 = symbol table + tsc resolver
call graph + RTA (default); 2 = call graph
(default: "1")
-t, --target-files <paths...> restrict analysis to specific files (incremental)
--skip-tests skip test trees (default)
--include-tests include test trees
--eager force a clean rebuild instead of reusing the cache
--lazy reuse the cache (default)
--no-build skip dependency materialization
(use a prepared node_modules)
--no-phantoms disable phantom (external) nodes for imported/
required library calls
-c, --cache-dir <dir> cache/intermediate directory
-v, --verbose increase verbosity (repeatable)
-h, --help display help for command
Examples
-
Basic analysis (symbol table + call graph):
cants --input ./my-ts-project
This prints the analysis to stdout as compact JSON. To save it instead, use
--output:cants --input ./my-ts-project --output /path/to/analysis-results
The results are written to
analysis.jsonin the specified directory. -
Change output format to msgpack:
cants --input ./my-ts-project --output /path/to/analysis-results --format msgpack
This saves the results to
analysis.msgpack, a binary format that is more compact for storage and transmission. -
Selecting an analysis level:
cants --input ./my-ts-project --analysis-level 2
Every run produces a symbol table and a call graph. Edges come from the TypeScript compiler's resolver plus Rapid Type Analysis (RTA), with phantom nodes for calls into imported libraries.
-
Incremental analysis of specific files:
cants --input ./my-ts-project --target-files src/a.ts src/b.ts
Restricts the analysis to the named files, reusing the cached analysis for the rest of the project.
-
Force a clean rebuild with a custom cache directory:
cants --input ./my-ts-project --eager --cache-dir /path/to/custom-cache
--eagerrebuilds the analysis cache from scratch. If--cache-diris omitted, the cache defaults to.codeanalyzerinside the project root.
Output
By default, analysis results are printed to stdout as compact JSON. When --output is given,
results are saved to analysis.json (or analysis.msgpack with --format msgpack) in the
specified directory.
The output document is a TSApplication with the following top-level shape:
{
"symbol_table": { /* file path → module (classes, interfaces, enums,
type aliases, functions, namespaces, variables, …) */ },
"call_graph": [ /* CALL_DEP edges: { source, target, weight,
provenance, tags } keyed by callable signature */ ],
"external_symbols": { /* phantom stubs for call targets outside the project
(imported libraries / Node builtins) */ },
"entrypoints": { /* framework-detected entrypoints (empty at level 1) */ }
}
Caller- and callee-side identifiers are produced by a single signature canonicalizer, so call
graph source/target values byte-match the corresponding symbol_table (or
external_symbols) keys.
License
Apache 2.0 — see LICENSE.
About this package
This distributes the compiled cants binary as a set of
platform-specific Python wheels, published to PyPI as codeanalyzer-typescript.
The CLDK Python SDK depends on this package and calls
codeanalyzer_typescript.bin_path() to locate the analyzer binary. The binary is
built from this repo's src/ with bun build --compile, so it is fully
self-contained (no Node/Bun needed at runtime).
Why platform wheels?
A bun --compile binary is platform-specific and large (~85–120 MB, since it embeds the
Bun runtime, the bundled TypeScript compiler, and the Jelly call-graph engine) — there is
no single cross-platform artifact (the way a JVM backend could ship one .jar). So we ship
one wheel per OS/arch, tagged py3-none-<platform> (the binary is Python-agnostic — no
per-Python-version matrix), and let pip resolve the correct one at install time. The wheel
is a zip, so the upload itself compresses to ~30–40 MB (well under PyPI's 100 MB limit).
There is intentionally no usable sdist: the binary cannot be built without Bun.
Building & publishing
python -m pip install build wheel hatchling twine
./build_wheels.sh # cross-compiles every target via Bun, emits ./dist/*.whl
twine upload dist/*.whl
build_wheels.sh loops over the Bun targets, compiles each binary into
src/codeanalyzer_typescript/_bin/, builds a pure wheel, and retags it to the platform.
Bun cross-compiles all targets from a single host, so this does not need a CI runner
matrix.
Versioning
The released version comes from the git tag. A push of vX.Y.Z triggers the
release workflow, which derives X.Y.Z from the tag, verifies it matches this
repo's package.json version (failing fast on mismatch), and stamps it into
__init__.py via $PKG_VERSION — hatch reads __version__ as the wheel version
(pyproject.toml declares dynamic = ["version"]). So the GitHub Release tag, the
PyPI wheel version, and the npm package.json version are always in lockstep.
To cut a release: bump package.json version, then push the matching tag, e.g.
npm version 0.2.0 --no-git-tag-version # or edit package.json
git commit -am "Release v0.2.0" && git tag v0.2.0 && git push --tags
For a local wheel build, override the fallback version explicitly:
PKG_VERSION=0.2.0 ./build_wheels.sh.
One thing still tracked by hand: the python-sdk pin — [tool.backend-versions] codeanalyzer-typescript and the dependencies entry
codeanalyzer-typescript==<version> — must be bumped to consume a new release.
SDK integration
In the python-sdk, TSCodeanalyzer._get_codeanalyzer_exec() resolves the binary in
this order: analysis_backend_path → $CODEANALYZER_TS_BIN → this package →
in-tree bundled bin/. Adding codeanalyzer-typescript to the SDK's dependencies
makes the binary available automatically on install.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file codeanalyzer_typescript-0.3.0-py3-none-win_amd64.whl.
File metadata
- Download URL: codeanalyzer_typescript-0.3.0-py3-none-win_amd64.whl
- Upload date:
- Size: 42.7 MB
- Tags: Python 3, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
820478598f08c139f8301dda3fe1f299e2a4d9dff904bd44b77590d84a55462a
|
|
| MD5 |
a5c87d4507cee7808c5803f10f41650a
|
|
| BLAKE2b-256 |
e3beaf6c97d4073d1a23ca4d05a714cd0531fe6869e55fca036eb0ed3c71b6b9
|
Provenance
The following attestation bundles were made for codeanalyzer_typescript-0.3.0-py3-none-win_amd64.whl:
Publisher:
release.yml on codellm-devkit/codeanalyzer-ts
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
codeanalyzer_typescript-0.3.0-py3-none-win_amd64.whl -
Subject digest:
820478598f08c139f8301dda3fe1f299e2a4d9dff904bd44b77590d84a55462a - Sigstore transparency entry: 1864450115
- Sigstore integration time:
-
Permalink:
codellm-devkit/codeanalyzer-ts@d550ac0f378684f1815431e4339fa77da5b0716f -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/codellm-devkit
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@d550ac0f378684f1815431e4339fa77da5b0716f -
Trigger Event:
push
-
Statement type:
File details
Details for the file codeanalyzer_typescript-0.3.0-py3-none-manylinux2014_x86_64.whl.
File metadata
- Download URL: codeanalyzer_typescript-0.3.0-py3-none-manylinux2014_x86_64.whl
- Upload date:
- Size: 40.3 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a82efe17d75c084dc3d80c46f82eb23b01b4ed84101fee14e0a1c11c14a2c9f6
|
|
| MD5 |
efa5e465d8721c1a1108c3437ebeb7b7
|
|
| BLAKE2b-256 |
0bb04e20a07b6515b053d845768f17b5707ae4dce8ef467e3a3b6550ef102a1b
|
Provenance
The following attestation bundles were made for codeanalyzer_typescript-0.3.0-py3-none-manylinux2014_x86_64.whl:
Publisher:
release.yml on codellm-devkit/codeanalyzer-ts
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
codeanalyzer_typescript-0.3.0-py3-none-manylinux2014_x86_64.whl -
Subject digest:
a82efe17d75c084dc3d80c46f82eb23b01b4ed84101fee14e0a1c11c14a2c9f6 - Sigstore transparency entry: 1864450282
- Sigstore integration time:
-
Permalink:
codellm-devkit/codeanalyzer-ts@d550ac0f378684f1815431e4339fa77da5b0716f -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/codellm-devkit
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@d550ac0f378684f1815431e4339fa77da5b0716f -
Trigger Event:
push
-
Statement type:
File details
Details for the file codeanalyzer_typescript-0.3.0-py3-none-manylinux2014_aarch64.whl.
File metadata
- Download URL: codeanalyzer_typescript-0.3.0-py3-none-manylinux2014_aarch64.whl
- Upload date:
- Size: 40.1 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7e5acdb9a01aad12afb66b79acb27e5149a02ead15866ed50ce13a92f6fed2ca
|
|
| MD5 |
1b27b32250f98f09ffa47bd275d19d04
|
|
| BLAKE2b-256 |
d855e89011898b477a12a114f5eedefa3511ed06a4cd2ccf02acbb7d47631232
|
Provenance
The following attestation bundles were made for codeanalyzer_typescript-0.3.0-py3-none-manylinux2014_aarch64.whl:
Publisher:
release.yml on codellm-devkit/codeanalyzer-ts
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
codeanalyzer_typescript-0.3.0-py3-none-manylinux2014_aarch64.whl -
Subject digest:
7e5acdb9a01aad12afb66b79acb27e5149a02ead15866ed50ce13a92f6fed2ca - Sigstore transparency entry: 1864449787
- Sigstore integration time:
-
Permalink:
codellm-devkit/codeanalyzer-ts@d550ac0f378684f1815431e4339fa77da5b0716f -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/codellm-devkit
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@d550ac0f378684f1815431e4339fa77da5b0716f -
Trigger Event:
push
-
Statement type:
File details
Details for the file codeanalyzer_typescript-0.3.0-py3-none-macosx_11_0_arm64.whl.
File metadata
- Download URL: codeanalyzer_typescript-0.3.0-py3-none-macosx_11_0_arm64.whl
- Upload date:
- Size: 28.5 MB
- Tags: Python 3, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b002642bac3b0a7c35933ecc607b7938ec77eac2a460cce87bd02d79bd1835e2
|
|
| MD5 |
f43e6a046f2c2b6c200c265548c4581c
|
|
| BLAKE2b-256 |
384d4ecfce3c0fd6666fa28b8145952db60cfce14921ad56c4b362417318b5f6
|
Provenance
The following attestation bundles were made for codeanalyzer_typescript-0.3.0-py3-none-macosx_11_0_arm64.whl:
Publisher:
release.yml on codellm-devkit/codeanalyzer-ts
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
codeanalyzer_typescript-0.3.0-py3-none-macosx_11_0_arm64.whl -
Subject digest:
b002642bac3b0a7c35933ecc607b7938ec77eac2a460cce87bd02d79bd1835e2 - Sigstore transparency entry: 1864450394
- Sigstore integration time:
-
Permalink:
codellm-devkit/codeanalyzer-ts@d550ac0f378684f1815431e4339fa77da5b0716f -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/codellm-devkit
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@d550ac0f378684f1815431e4339fa77da5b0716f -
Trigger Event:
push
-
Statement type:
File details
Details for the file codeanalyzer_typescript-0.3.0-py3-none-macosx_10_12_x86_64.whl.
File metadata
- Download URL: codeanalyzer_typescript-0.3.0-py3-none-macosx_10_12_x86_64.whl
- Upload date:
- Size: 30.9 MB
- Tags: Python 3, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
38ff3284f6a6ddf56a0a12c29a66bc88f3f33e641dedbfb0c8589687d18fcdbb
|
|
| MD5 |
846d44df2ad86a9b88c27d2446b0aa1d
|
|
| BLAKE2b-256 |
dd31ba0e761c7d507d9bc303a85e342b7bb123b4b043c03716319656db749c10
|
Provenance
The following attestation bundles were made for codeanalyzer_typescript-0.3.0-py3-none-macosx_10_12_x86_64.whl:
Publisher:
release.yml on codellm-devkit/codeanalyzer-ts
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
codeanalyzer_typescript-0.3.0-py3-none-macosx_10_12_x86_64.whl -
Subject digest:
38ff3284f6a6ddf56a0a12c29a66bc88f3f33e641dedbfb0c8589687d18fcdbb - Sigstore transparency entry: 1864449992
- Sigstore integration time:
-
Permalink:
codellm-devkit/codeanalyzer-ts@d550ac0f378684f1815431e4339fa77da5b0716f -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/codellm-devkit
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@d550ac0f378684f1815431e4339fa77da5b0716f -
Trigger Event:
push
-
Statement type: