Installation
Install using the CLI
Section titled “Install using the CLI”The ts-pack CLI allows you to manage parsers and run code analysis directly from your terminal.
You can use it in CI pipelines, automation scripts, or to explore and experiment with 306 supported languages.
brew tap xberg-io/homebrew-tapbrew install xberg-io/homebrew-tap/ts-packcargo install ts-pack-clits-pack --versionts-pack list | wc -l # → 306Run the MCP Server
Section titled “Run the MCP Server”The CLI bundles an MCP server for AI agents:
ts-pack mcpSee the MCP Server guide for integration with Claude Code, Cursor, VS Code, and other tools.
Language Bindings
Section titled “Language Bindings”Tree-sitter-language-pack is available for every major ecosystem. All packages share the same version and API surface.
Python
Section titled “Python”Requires Python 3.10+.
pip install tree-sitter-language-packuv add tree-sitter-language-packpoetry add tree-sitter-language-packVerify:
import tree_sitter_language_pack as tslpprint(tslp.language_count()) # 306Node.js
Section titled “Node.js”Requires Node.js 18+. Pre-built binaries for Linux (x64, arm64), macOS (x64, arm64), and Windows (x64).
npm install @xberg-io/tree-sitter-language-packpnpm add @xberg-io/tree-sitter-language-packyarn add @xberg-io/tree-sitter-language-packVerify:
const tslp = require("@xberg-io/tree-sitter-language-pack");console.log(tslp.languageCount()); // 306Requires Rust 1.85+.
cargo add tree-sitter-language-pack[dependencies]tree-sitter-language-pack = "1"Verify:
fn main() { println!("{}", tree_sitter_language_pack::language_count()); // 306}Requires Go 1.26+. The binding uses cgo and links against the pre-compiled C FFI library.
go get github.com/xberg-io/tree-sitter-language-pack/packages/goimport tslp "github.com/xberg-io/tree-sitter-language-pack/packages/go"
func main() { fmt.Println(tslp.LanguageCount()) // 306}Requires JDK 25+ (uses Panama FFM API).
<dependency> <groupId>io.xberg.treesitterlanguagepack</groupId> <artifactId>tree-sitter-language-pack</artifactId> <version>1.12.5</version></dependency>dependencies { implementation("io.xberg.treesitterlanguagepack:tree-sitter-language-pack:1.12.5")}dependencies { implementation 'io.xberg.treesitterlanguagepack:tree-sitter-language-pack:1.12.5'}Verify:
import io.xberg.treesitterlanguagepack.TreeSitterLanguagePack;
public class Main { public static void main(String[] args) { System.out.println(TreeSitterLanguagePack.languageCount()); // 306 }}Requires .NET 10.
dotnet add package XbergIo.TreeSitterLanguagePack --version 1.12.5Verify:
using TreeSitterLanguagePack;
Console.WriteLine(TreeSitterLanguagePackConverter.LanguageCount()); // 306The NuGet package includes native runtime assets for Windows, Linux, and macOS.
Requires Ruby 3.2+.
gem install tree_sitter_language_packgem "tree_sitter_language_pack", "~> 1.9"bundle installVerify:
require "tree_sitter_language_pack"
puts TreeSitterLanguagePack.language_count # 306Elixir
Section titled “Elixir”Requires Elixir 1.14+ and OTP 25+.
defp deps do [ {:tree_sitter_language_pack, "~> 1.9"} ]endmix deps.getVerify:
IO.puts TreeSitterLanguagePack.language_count() # 306Requires PHP 8.2+. This package is a native PHP extension (type: php-ext). Install
mlocati/php-extension-installer first
so Composer can download and register the compiled .so/.dll:
composer require mlocati/php-extension-installercomposer require xberg-io/tree-sitter-language-pack{ "require": { "mlocati/php-extension-installer": "^2.0", "xberg-io/tree-sitter-language-pack": "^1.9" }}Verify:
<?phpecho \ts_pack_language_count(); // 306Requires Dart 3.11+.
dart pub add tree_sitter_language_packKotlin Android
Section titled “Kotlin Android”Requires Android minSdk 21 and Java 17 bytecode.
implementation("io.xberg.tslp.android:tree-sitter-language-pack-android:1.12.5")This is an Android AAR. Kotlin/JVM users should use the Java artifact.
Requires Swift 6.0+.
.package( url: "https://github.com/xberg-io/tree-sitter-language-pack", exact: "1.12.5")Requires Zig 0.16+.
zig fetch --save <release tarball url>The package name is tree_sitter_language_pack.
Download the shared library and generated C header from GitHub Releases. The C FFI is the stable native contract used by the generated native packages.
WebAssembly
Section titled “WebAssembly”Use from any JavaScript environment — browsers, Deno, and Cloudflare Workers.
npm install @xberg-io/tree-sitter-language-pack-wasm<script type="module"> import { availableLanguages, parseString } from "https://cdn.jsdelivr.net/npm/@xberg-io/tree-sitter-language-pack-wasm/+esm"; console.log(availableLanguages());</script>import { availableLanguages, parseString } from "npm:@xberg-io/tree-sitter-language-pack-wasm";console.log(availableLanguages());The WASM package is a static curated subset of parsers compiled into the module. It does not expose the native download/cache helpers.
Next Steps
Section titled “Next Steps”- Quick Start — parse your first file in 5 minutes
- Download parsers — pre-download grammars for production, CI, or offline use
- Download model — understand how parser caching works
- Languages — full list of 306 supported languages