Skip to content

Latest commit

 

History

History
184 lines (139 loc) · 8.14 KB

File metadata and controls

184 lines (139 loc) · 8.14 KB

Xberg

tree-sitter-language-pack — CLI

Bindings

Command-line tool for managing tree-sitter language parsers with download utilities.

Installation

cargo install ts-pack-cli

Or install via Homebrew:

Homebrew 6.0+ requires explicit trust for third-party taps. Trust once, then install:

brew trust xberg-io/homebrew-tap
brew install xberg-io/homebrew-tap/ts-pack

Quick Start

# Initialize a language-pack.toml config
ts-pack init

# List available languages
ts-pack list

# Download specific languages for offline use
ts-pack download python rust javascript

# Check download status
ts-pack status

# Add languages to your config
ts-pack add python rust javascript

# Clone parser sources
ts-pack clone

API Reference

Commands

  • ts-pack init -- initialize a language-pack.toml config in the current directory
  • ts-pack list -- list all available language names
  • ts-pack download <lang>... -- download specific parsers for offline use
  • ts-pack status -- show download status of all configured languages
  • ts-pack add <lang>... -- add languages to language-pack.toml
  • ts-pack clone -- clone parser source repositories (for development)
  • ts-pack parse <file> -- parse a file and print the syntax tree
  • ts-pack process <file> -- extract code intelligence from a file

Global Flags

  • --config <path> -- path to language-pack.toml (default: current directory)
  • --verbose / -v -- enable verbose output
  • --help -- show help for any command

MCP Server

The CLI includes an MCP server for integration with AI agents and IDEs. Start it with:

ts-pack mcp

The server runs over stdio by default. For HTTP transport (remote agents or team setups):

ts-pack mcp --transport http --host 127.0.0.1 --port 8011

Options

  • --transport <stdio|http> -- transport mode (default: stdio)
  • --host <addr> -- bind address for HTTP transport (default: 127.0.0.1)
  • --port <u16> -- port for HTTP transport (default: 8011)
  • --config <path> -- optional language-pack.toml config file

Tools

The MCP server exposes 8 tools:

  • parse — render syntax tree as S-expression or JSON
  • process — extract code intelligence (structure, imports, exports, symbols, docstrings, comments, diagnostics, chunking)
  • detect_language — identify language from file path or source code
  • list_languages — enumerate available, downloaded, or manifest languages with optional filtering
  • info — get status of a specific language (available, downloaded, etc.)
  • download — fetch parsers (list, groups, all, or fresh)
  • cache_dir — retrieve the local cache directory
  • clean_cache — delete cached parsers

Resources

  • ts-pack://languages — available language catalog
  • ts-pack://languages/downloaded — user-downloaded parsers
  • ts-pack://language/{name} — per-language status (template resource)

Prompt

  • analyze-code — analyze source code with language detection and code intelligence extraction

For detailed setup and IDE configuration, see the MCP Server guide.

For full documentation, see xberg.io.

License

MIT -- see LICENSE for details.


Part of tree-sitter-language-pack -- A comprehensive collection of tree-sitter language parsers with polyglot bindings.

Part of Xberg

  • Xberg — document intelligence: text, tables, metadata from 91+ formats with optional OCR.
  • Xberg Enterprise — managed extraction API with SDKs, dashboards, and observability.
  • crawlberg — web crawling and scraping with HTML→Markdown and headless-Chrome fallback.
  • html-to-markdown — fast, lossless HTML→Markdown engine.
  • liter-llm — universal LLM API client with native bindings for 14 languages and 143 providers.
  • Discord — community, roadmap, announcements.