kreuzberg / tree-sitter-language-pack
Pre-compiled tree-sitter parsers for 170+ programming languages with PHP extension bindings. Parse, analyze, and chunk source code with a single process() call.
Package info
github.com/kreuzberg-dev/tree-sitter-language-pack
Language:Rust
Type:php-ext
Ext name:ext-ts_pack_php
pkg:composer/kreuzberg/tree-sitter-language-pack
Requires
- php: ^8.4
Requires (Dev)
- phpstan/phpstan: ^2.0
- phpunit/phpunit: ^11.0
Replaces
- ext-ts_pack_php: *
This package is auto-updated.
Last update: 2026-03-19 17:48:28 UTC
README
tree-sitter-language-pack
A comprehensive collection of tree-sitter language parsers with polyglot bindings
Overview
tree-sitter-language-pack bundles 170+ tree-sitter language parsers into a single package with native bindings for multiple programming languages. Ship syntax analysis in your application without managing individual parser dependencies.
Architecture
tree-sitter-language-pack/
├── crates/
│ ├── ts-pack-core/ # Rust core library
│ ├── ts-pack-python/ # Python (maturin/PyO3) bindings
│ ├── ts-pack-node/ # Node.js (NAPI-RS) bindings
│ ├── ts-pack-java/ # Java (Panama FFI) bindings
│ ├── ts-pack-elixir/ # Elixir (Rustler NIF) bindings
│ ├── ts-pack-ffi/ # C-compatible FFI library
│ └── ts-pack-cli/ # CLI tool
├── packages/
│ └── go/v1/ # Go (cgo) bindings
├── grammars/ # Tree-sitter grammar sources
└── scripts/ # Build and maintenance scripts
Quick Start
Rust
cargo add ts-pack-core
See Rust README for full documentation.
Python
pip install tree-sitter-language-pack
uv add tree-sitter-language-pack
See Python README for full documentation.
Node.js
npm install @kreuzberg/tree-sitter-language-pack
pnpm add @kreuzberg/tree-sitter-language-pack
yarn add @kreuzberg/tree-sitter-language-pack
See Node.js README for full documentation.
Go
go get github.com/kreuzberg-dev/tree-sitter-language-pack/packages/go/v1
See Go README for full documentation.
Java
<dependency> <groupId>dev.kreuzberg</groupId> <artifactId>tree-sitter-language-pack</artifactId> <version>1.0.0-rc.1</version> </dependency>
implementation("dev.kreuzberg:tree-sitter-language-pack:1.0.0-rc.1")
See Java README for full documentation.
Elixir
{:tree_sitter_language_pack, "~> 1.0"}
See Elixir README for full documentation.
Ruby
gem install tree_sitter_language_pack
See Ruby README for full documentation.
WebAssembly
npm install @kreuzberg/tree-sitter-language-pack-wasm
pnpm add @kreuzberg/tree-sitter-language-pack-wasm
yarn add @kreuzberg/tree-sitter-language-pack-wasm
See WebAssembly README for full documentation.
PHP
composer require kreuzberg/tree-sitter-language-pack
See PHP README for full documentation.
.NET (C#)
dotnet add package TreeSitterLanguagePack
See .NET (C#) README for full documentation.
C/C++ (FFI)
Build from source as part of this workspace.
See C/C++ (FFI) README for full documentation.
CLI
cargo install ts-pack
See CLI README for full documentation.
Core API
All bindings expose a unified process() function for extracting structured intelligence from source code:
| Language | Function |
|---|---|
| Rust | ts_pack_core::process(source, &config) |
| Python | process(source, ProcessConfig(...)) |
| Node.js | process(source, { language: '...' }) |
| Go | registry.Process(source, config) |
| Java | registry.process(source, configJson) |
| Ruby | TreeSitterLanguagePack.process(source, configJson) |
| Elixir | TreeSitterLanguagePack.process(source, configJson) |
| WASM | process(source, { language: '...' }) |
| C FFI | ts_pack_process(registry, source, len, configJson) |
The process() function returns structured analysis including functions, classes, imports, comments, and optionally chunked source segments.
Features
| Feature | Description |
|---|---|
| 170+ Languages | Pre-compiled parsers for 170+ programming languages |
| On-Demand Downloads | Parsers are downloaded on-demand and cached locally for fast reuse |
| Selective Installation | Download only the languages you need; unused parsers never downloaded |
| Polyglot Bindings | Native bindings for Rust, Python, Node.js, Go, Java, Elixir, and C/C++ |
| Automatic Caching | Downloaded parsers cached in platform-specific directories for offline use |
| Feature Groups | Curated language sets: web, systems, scripting, data, jvm, functional |
Supported Languages
This pack includes 170+ languages. See the Rust core Cargo.toml for the full list of available language features.
Package READMEs
- Rust -- Rust core library providing access to 170+ tree-sitter parsers with on-demand download and caching support.
- Python -- Python bindings for tree-sitter-language-pack, providing access to 170+ pre-compiled tree-sitter parsers with on-demand downloads.
- Node.js -- Node.js NAPI bindings for tree-sitter-language-pack with on-demand parser downloads.
- Go -- Go bindings for tree-sitter-language-pack with on-demand parser caching.
- Java -- Java bindings for tree-sitter-language-pack with on-demand parser downloads (JDK 22+).
- Elixir -- Elixir bindings for tree-sitter-language-pack with on-demand parser downloads.
- Ruby -- Ruby bindings for tree-sitter-language-pack with on-demand parser downloads.
- WebAssembly -- WebAssembly bindings for tree-sitter-language-pack with browser caching support.
- PHP -- PHP extension via ext-php-rs with on-demand parser downloads.
- .NET (C#) -- .NET P/Invoke bindings with on-demand parser downloads.
- C/C++ (FFI) -- C-compatible FFI bindings for tree-sitter-language-pack. Use from any language with C interop.
- CLI -- Command-line tool for managing tree-sitter language parsers with download utilities.
Contributing
Contributions are welcome! See CONTRIBUTING.md for guidelines.
Join our Discord community for questions and discussion.
License
MIT OR Apache-2.0 -- see LICENSE for details.