Languages Overview β
Ctxo ships language support as separate plugin packages. The CLI has no built-in parsers: it discovers plugins at runtime by scanning the consumer project's package.json for names matching @ctxo/lang-* (official) or ctxo-lang-* (community). Each plugin implements the Plugin API v1 contract exported by @ctxo/plugin-api, a stable surface with zero runtime dependencies on @ctxo/cli.
Support matrix β
| Language | Plugin | Parser | Tier | Extensions |
|---|---|---|---|---|
| TypeScript/JavaScript | @ctxo/lang-typescript | ts-morph | full | .ts .tsx .js .jsx |
| Go | @ctxo/lang-go | ctxo-go-analyzer (Go 1.22+) + tree-sitter-go | full | .go |
| C# | @ctxo/lang-csharp | ctxo-roslyn (.NET SDK 8+) + tree-sitter-c-sharp | full | .cs |
Two tiers are defined by the plugin contract:
fullβ the plugin has access to a real semantic analyzer (ts-morph, Roslyn, or the Go analyzer binary). Produces resolved edges (calls,extends,implements,uses) plus rich complexity.syntaxβ tree-sitter or equivalent syntax-level parser. Produces symbols,imports, and approximate edges. Used as a graceful fallback.
The Go and C# plugins advertise tier: 'full' and auto-downgrade to syntax at runtime when the Go toolchain or .NET SDK is missing. You can see the active tier in ctxo doctor --json under the language coverage check.
What gets extracted β
Every plugin returns the same shapes, defined in @ctxo/plugin-api: symbols, edges, and a per-symbol cyclomatic complexity count. See Symbol IDs and Edge kinds for the canonical enums and format.
Detection β
ctxo init and ctxo doctor use detectLanguages() to figure out which plugins a project needs. Detection combines two signals:
- Manifest markers in the project root:
tsconfig.jsonβ typescriptgo.mod/go.workβ go*.csproj/*.slnβ csharppyproject.toml,pom.xml,Cargo.toml,Gemfile, ... (reserved)
- Extension counts from
git ls-files, mapped through a canonical extension table (e.g..tsand.tsxboth map totypescript).
The result drives the auto-install flow.
Auto-install β
ctxo init prompts to install detected plugins. ctxo index --install-missing installs them non-interactively before indexing. Both paths use the detected package manager (pnpm / npm / yarn) and add packages to devDependencies:
pnpm add -D @ctxo/lang-typescript @ctxo/lang-go @ctxo/lang-csharpnpm install --save-dev @ctxo/lang-typescript @ctxo/lang-go @ctxo/lang-csharpyarn add -D @ctxo/lang-typescript @ctxo/lang-go @ctxo/lang-csharpYou can also run ctxo install <id>... directly, or ctxo install --dry-run to preview the plan without touching package.json.