Skip to main content

Documentation 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.

The dump-languages command prints a list of all the languages that the CLI knows about. This is useful for debugging purposes or for scripting.
tree-sitter dump-languages [OPTIONS]
Aliases: langs

Output Format

The command outputs information about each discovered parser, including:
  • Language name
  • Path to the parser
  • Scope information
  • File type associations

Parser Discovery

The CLI searches for parsers in the directories specified by the parser-directories field in your config file. Any folder whose name begins with tree-sitter- in these directories is treated as a Tree-sitter grammar repository.

Options

--config-path
path
The path to the configuration file. By default, the CLI uses the default location as explained in init-config.This flag allows you to explicitly override that default and use a config defined elsewhere.

Examples

List All Languages

tree-sitter dump-languages
Example output:
java: /home/user/code/tree-sitter-java
  scope: source.java
  file-types: java

javascript: /home/user/code/tree-sitter-javascript
  scope: source.js
  file-types: js, jsx, mjs, cjs

python: /home/user/code/tree-sitter-python
  scope: source.python
  file-types: py, pyi

Use Custom Config

tree-sitter dump-languages --config-path ~/.config/tree-sitter/custom-config.json

Pipe to File

tree-sitter dump-languages > languages.txt

Count Languages

tree-sitter dump-languages | grep -c "scope:"

Use Cases

Debugging

Verify that the CLI can find your parser:
tree-sitter dump-languages | grep my-language

Scripting

Extract parser paths for automation:
tree-sitter dump-languages | awk '/^[a-z]/ {print $2}'

Documentation

Generate a list of supported languages:
tree-sitter dump-languages > SUPPORTED_LANGUAGES.txt

Troubleshooting

No Languages Found

If no languages are listed:
  1. Check your config file exists:
    cat ~/.config/tree-sitter/config.json
    
  2. Verify parser directories are set:
    {
      "parser-directories": [
        "/path/to/parsers"
      ]
    }
    
  3. Ensure parser folders start with tree-sitter-:
    ls ~/code/ | grep tree-sitter-
    

Parser Not Showing Up

If a specific parser isn’t listed:
  1. Verify the directory name starts with tree-sitter-
  2. Check that tree-sitter.json exists in the parser directory
  3. Ensure the parser directory is in a configured parser-directories path