Parse any language without wiring up grammars
One install covers 306 languages — Python, Rust, Go, Java, TypeScript, C++, Kotlin, Swift, Zig, Elixir, Haskell, Julia, R, and hundreds more. Nothing to compile, nothing to fetch by hand.
Parse any language without wiring up grammars
One install covers 306 languages — Python, Rust, Go, Java, TypeScript, C++, Kotlin, Swift, Zig, Elixir, Haskell, Julia, R, and hundreds more. Nothing to compile, nothing to fetch by hand.
Fast enough for real-time tooling
Parsing keeps up with editor keystrokes and large-repo scans, so you can build linters, formatters, and analysis that respond instantly.
Only download the parsers you use
The base install stays small. Each parser is fetched and cached the first time you touch its language, so you never ship 305 grammars you don’t need.
Find functions, classes, and imports in one call
Go past raw syntax trees: pull functions, classes, imports, exports, symbols, comments, and docstrings out of any file with a single call.
Chunk code your LLM can actually use
Split source at real boundaries — functions, classes, blocks — so each chunk stays whole for embeddings and prompt windows instead of cutting mid-statement.
Use your language's own parser types
In Python, Node.js, Go, Java, C#, Kotlin, Swift, Zig, and C, get_language() hands back your
ecosystem’s native Language object, ready to pass to your existing parser.
| Language | Install | Docs |
|---|---|---|
| Python | pip install tree-sitter-language-pack |
API Reference |
| TypeScript / Node.js | npm install @xberg-io/tree-sitter-language-pack |
API Reference |
| Rust | cargo add tree-sitter-language-pack |
API Reference |
| Go | go get github.com/xberg-io/tree-sitter-language-pack/packages/go |
API Reference |
| Java | Maven Central io.xberg.treesitterlanguagepack |
API Reference |
| Kotlin (Android) | Maven io.xberg.tslp.android:tree-sitter-language-pack-android |
API Reference |
| C# | dotnet add package XbergIo.TreeSitterLanguagePack |
API Reference |
| Ruby | gem install tree_sitter_language_pack |
API Reference |
| PHP | composer require xberg-io/tree-sitter-language-pack |
API Reference |
| Elixir | {:tree_sitter_language_pack, "~> 1.9"} |
API Reference |
| Dart / Flutter | dart pub add tree_sitter_language_pack |
API Reference |
| Swift | Swift Package Manager | API Reference |
| Zig | zig fetch --save from GitHub |
API Reference |
| WebAssembly | npm install @xberg-io/tree-sitter-language-pack-wasm |
API Reference |
| C (FFI) | Shared library + header | API Reference |
| CLI | brew install xberg-io/homebrew-tap/ts-pack |
CLI Guide |
See all 306 supported languages →
import tree_sitter_language_pack as tslp
# Parsers download automatically on first useresult = tslp.process( "def hello():\n print('world')\n", tslp.ProcessConfig(language="python", structure=True, imports=True),)
print(f"Language: {result.language}")print(f"Functions: {len(result.structure)}")import { process } from "@xberg-io/tree-sitter-language-pack";
const result = process("function hello() { console.log('world'); }", { language: "javascript", structure: true, imports: true,});
console.log(`Language: ${result.language}`);console.log(`Functions: ${result.structure?.length ?? 0}`);use tree_sitter_language_pack::{ProcessConfig, process};
fn main() -> anyhow::Result<()> { let config = ProcessConfig::new("rust").all(); let result = process("fn main() { println!(\"hello\"); }", &config)?;
println!("Language: {}", result.language); println!("Functions: {}", result.structure.len()); Ok(())}