TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/tree-sitter/tree-sitter/llms.txt
Use this file to discover all available pages before exploring further.
tree-sitter command-line interface is used to create, manage, test, and build Tree-sitter parsers. It provides a comprehensive set of tools for grammar development, testing, and deployment.
Configuration
The CLI is controlled by two configuration files:- A personal
tree-sitter/config.jsonconfig file generated bytree-sitter init-config - A parser
tree-sitter.jsonconfig file generated bytree-sitter init
Command Categories
Grammar Development
init- Initialize a grammar repositoryinit-config- Generate a default config filegenerate- Generate a parser from grammarbuild- Compile a parser
Testing and Debugging
Query and Analysis
query- Search files using a syntax tree queryhighlight- Highlight a filetags- Generate a list of tags
Tools
playground- Start local playground in the browserversion- Display or increment the version of a grammardump-languages- Print info about all known language parserscomplete- Generate shell completions
Getting Help
To see all available commands:Environment Variables
TREE_SITTER_JS_RUNTIME- JavaScript runtime to use for parser generation (default:node)TREE_SITTER_ABI_VERSION- Language ABI version to generateTREE_SITTER_WASI_SDK_PATH- Path to Wasi SDK for Wasm compilationTREE_SITTER_EDITS- Maximum number of edits for fuzzingTREE_SITTER_ITERATIONS- Number of iterations for fuzzingNO_COLOR- Set to1to disable colored outputCC- C compiler to use for buildingCFLAGS- Additional flags for C compiler