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.
tags command runs symbol tagging on an arbitrary file and outputs a list of tags. This is useful for code navigation features.
Input Sources
File Paths
Pass file paths directly:Paths File
Use--paths to provide a file containing paths:
Standard Input
If no paths are provided, input is read from stdin:Output Format
The command outputs tags in a format suitable for code navigation tools. Each tag includes:- Symbol name
- Symbol kind (e.g., function, class, variable)
- Location (file, line, column)
- Scope information
Options
Input Options
The path to a file that contains paths to source files to tag.
The path to the directory containing the grammar. Implies
--rebuild.The language scope to use for symbol tagging. Useful when the language is ambiguous.
Generate tags from the contents of a specific test.
Output Options
Suppress main output.
Print the time taken to generate tags for the file.
Build Options
Force a rebuild of the parser before running tags.
The path to an alternative configuration (
config.json) file. See init-config.Examples
Generate Tags for a File
Generate Tags for Multiple Files
Generate Tags with Performance Measurement
Generate Tags from File List
Generate Tags with Specific Scope
Tag Queries
Tags are generated using thequeries/tags.scm query file in your grammar repository. This file defines patterns for extracting symbols.
Example tag query: