Supported Languages
GitKB supports 19 languages for code intelligence: 18 tree-sitter language packs (including TLA+) plus Svelte <script> extraction through the TypeScript pack. Packs extract symbols, call sites, and imports. Call resolution and additional language features vary by language and syntax.
Language packs
| Language | File extensions |
|---|---|
| Rust | .rs |
| Python | .py, .pyi, .pyw |
| JavaScript | .js, .jsx, .mjs, .cjs |
| TypeScript | .ts, .tsx, .mts, .cts |
| Go | .go |
| C | .c, .h |
| C++ | .cpp, .cc, .cxx, .hpp, .hh, .hxx |
| C# | .cs |
| Java | .java |
| Ruby | .rb, .rake, .gemspec |
| Elixir | .ex, .exs |
| Kotlin | .kt, .kts |
| Swift | .swift |
| Scala | .scala, .sc |
| PHP | .php |
| Haskell | .hs, .lhs |
| Lua | .lua |
| TLA+ | .tla |
Rust, Python, TypeScript, JavaScript, and Go have the broadest end-to-end coverage. The remaining packs also extract symbols, calls, and imports; this does not imply identical resolution coverage for every language construct.
Symbol forwarding follows public re-exports in Rust, Python package initializers, and JavaScript/TypeScript barrel modules. Other packs do not all model equivalent forwarding forms.
Svelte components
For .svelte files, GitKB creates a component-level module symbol and extracts symbols, calls, imports, and re-exports from <script> blocks using the TypeScript pack. Source locations retain their original component-file offsets. Template and markup expressions are outside this extraction path.
Recognized formats without a language pack
Bash and related shell files (.sh, .bash, .zsh) are recognized by the language registry, but the default build has no registered Bash extraction pack. Recognition alone does not provide the same code graph as the packs above.
These non-code formats are also recognized for file statistics and have no code extraction queries:
| Format | File extensions |
|---|---|
| HTML | .html, .htm |
| CSS | .css, .scss, .less |
| JSON | .json, .jsonl |
| YAML | .yaml, .yml |
| Nix | .nix |
Index and inspect
# Preview or index source files
git-kb code index --dry-run --json
git-kb code index src/ --json
# Filter indexing by language
git-kb code index src/ --language rust --json
# Inspect coverage and unresolved calls
git-kb code stats --json
git-kb code doctor --jsonGitKB detects language from file extensions and respects .gitignore and .gitkbignore. A custom build can enable a smaller set of packs.
After edits, re-run indexing or use a full KB’s daemon for incremental updates. To remove entries for deleted files while indexing:
git-kb code index --prune src/ --jsonCall graphs describe the syntax and relationships the index can resolve. Use index-health output and source inspection when a missing caller or uncertain resolution affects a decision.
Next steps
- Code Intelligence — Query definitions and relationships
- CLI Reference — Code commands and flags
- MCP Tools — Code tools for AI assistants