# Tree sitter Seminar ## Prerequisites ```bash $ python3 -m venv .venv $ source .venv/bin/activate $ pip install -e . ``` The `-e` flag installs the package in editable mode, so edits under `src/` are picked up without reinstalling. The install also creates a `ts-example` command on your PATH (see `pyproject.toml` -> `[project.scripts]`). ## Launch Once installed, run the package via its console script: ```bash $ ts-example minimal --file path/to/file.py ``` or equivalently as a module: ```bash $ python3 -m ts_example minimal --file path/to/file.py ``` ## TUI usage Start the TUI (the required `--file` argument can be the file you intend to inspect). Global options such as `--tui` must come *before* the subcommand: ```bash $ ts-example --tui minimal --file path/to/file.py ``` At the prompt, load a file and then inspect grammar fields: ```text > read_file path/to/file.py > find_field_values function_definition name ``` `find_field_values ` walks every matching node and prints the named field and its location. Node and field names are language-grammar-specific. For example, C++ class names can be found with: ```text > find_field_values class_specifier name ``` Other available commands include `dump_tree` and `get_usages `.