You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs(ts): document pip/Homebrew install and the cants command
- codeanalyzer-ts backend page: lead with an Install section (pip install
codeanalyzer-typescript / brew) that yields the `cants` CLI; rename binary
references from codeanalyzer-typescript to cants; note the package-vs-command
naming; correct the -a row (level 2 = call graph, not CodeQL).
- installing.mdx: add a TypeScript Analysis dependency tab covering the same
pip/brew install and the cants command.
Copy file name to clipboardExpand all lines: src/content/docs/backends/codeanalyzer-ts.mdx
+31-9Lines changed: 31 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,38 +34,60 @@ Walks the ts-morph AST and indexes all declarations (classes, methods, interface
34
34
35
35
Both maintain the no-dangling-edges invariant: every call-graph edge endpoint is a real `Callable.signature`.
36
36
37
-
## Building and running
37
+
## Installing
38
38
39
-
### Prerequisites
40
-
-**bun** ≥ 1.3, or **Node** ≥ 20
41
-
-**npm** on PATH (to materialize dependencies)
39
+
The fastest way to get the `cants` CLI is from **PyPI** or **Homebrew**. Both ship a prebuilt, self-contained binary for your platform — no Bun or Node is needed to *run* it:
The PyPI package `codeanalyzer-typescript` is also what the CLDK Python SDK depends on to locate this backend — it exposes `bin_path()` to point at the bundled binary.
57
+
58
+
<Asidetype="note">
59
+
The distributable is named **`codeanalyzer-typescript`** (the PyPI package and the Homebrew formula), but the command it installs on your `PATH` is **`cants`** — the analyzer's short binary name. Run `cants`, not `codeanalyzer-typescript`.
60
+
</Aside>
61
+
62
+
### Building from source
63
+
64
+
To hack on the analyzer, build it with **bun** ≥ 1.3 (Node ≥ 20 also works to run from source). **npm** must be on PATH to materialize dependencies:
42
65
43
-
### Install and build
44
66
```bash
45
67
cd codeanalyzer-ts
46
68
bun install
47
-
bun run build # → dist/codeanalyzer-typescript (standalone binary)
69
+
bun run build # → dist/cants (standalone binary)
48
70
```
49
71
50
72
Or run from source without compilation:
51
73
```bash
52
-
bun run src/index.ts -i <project> -a 2
74
+
bun run src/index.ts -i <project>
53
75
```
54
76
55
77
## CLI
56
78
57
79
The analyzer accepts these command-line options:
58
80
59
81
```bash
60
-
codeanalyzer-typescript -i <path> [options]
82
+
cants -i <path> [options]
61
83
```
62
84
63
85
| Option | Description |
64
86
|--------|-------------|
65
87
|`-i, --input <path>`| Project root to analyze **(required)**|
66
88
|`-o, --output <dir>`| Write `analysis.json` to this directory; omit to emit compact JSON to stdout (used by the SDK) |
Copy file name to clipboardExpand all lines: src/content/docs/installing.mdx
+23Lines changed: 23 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -128,6 +128,29 @@ The Python SDK can be installed directly from
128
128
```
129
129
This should output the version of the installed Maven.
130
130
</TabItem>
131
+
<TabItemlabel="TypeScript Analysis">
132
+
For TypeScript and JavaScript analysis, CLDK relies on a companion backend, [`codeanalyzer-ts`](/backends/codeanalyzer-ts/). It ships as a prebuilt, self-contained binary, so you do **not** need Bun or Node installed to run it — just install the `codeanalyzer-typescript` package, which puts a `cants` command on your `PATH`.
The package is named `codeanalyzer-typescript`, but the installed command is **`cants`**. To analyze a project's *dependencies* (so library call targets resolve), keep `npm` on your `PATH`; the analyzer materializes `node_modules` automatically (skip with `--no-build`). See the [codeanalyzer-ts backend reference](/backends/codeanalyzer-ts/) for full CLI options.
153
+
</TabItem>
131
154
<TabItemlabel="Rust Installation">
132
155
Rustup is the recommended tool for installing Rust and managing its toolchains. It simplifies the process of keeping Rust up to date and allows switching between different Rust versions and toolchains seamlessly.
0 commit comments