13 releases

0.20.8 Apr 5, 2023
0.20.7 Sep 2, 2022
0.20.6 Mar 3, 2022
0.20.4 Jan 23, 2022
0.14.5 Feb 25, 2019

#111 in Command line utilities

Download history 1539/week @ 2023-02-08 1540/week @ 2023-02-15 2172/week @ 2023-02-22 2019/week @ 2023-03-01 2903/week @ 2023-03-08 2623/week @ 2023-03-15 2408/week @ 2023-03-22 2280/week @ 2023-03-29 3259/week @ 2023-04-05 2999/week @ 2023-04-12 2486/week @ 2023-04-19 1922/week @ 2023-04-26 2489/week @ 2023-05-03 2018/week @ 2023-05-10 2927/week @ 2023-05-17 2630/week @ 2023-05-24

10,370 downloads per month
Used in 2 crates

MIT license

3MB
39K SLoC

Rust 30K SLoC // 0.0% comments C 9K SLoC // 0.1% comments JavaScript 461 SLoC // 0.0% comments TypeScript 116 SLoC // 0.7% comments C++ 19 SLoC

Tree-sitter CLI

Crates.io

The Tree-sitter CLI allows you to develop, test, and use Tree-sitter grammars from the command line. It works on MacOS, Linux, and Windows.

Installation

You can install the tree-sitter-cli with cargo:

cargo install tree-sitter-cli

or with npm:

npm install tree-sitter-cli

You can also download a pre-built binary for your platform from the releases page.

Dependencies

The tree-sitter binary itself has no dependencies, but specific commands have dependencies that must be present at runtime:

  • To generate a parser from a grammar, you must have node on your PATH.
  • To run and test parsers, you must have a C and C++ compiler on your system.

Commands

  • generate - The tree-sitter generate command will generate a Tree-sitter parser based on the grammar in the current working directory. See the documentation for more information.

  • test - The tree-sitter test command will run the unit tests for the Tree-sitter parser in the current working directory. See the documentation for more information.

  • parse - The tree-sitter parse command will parse a file (or list of files) using Tree-sitter parsers.

Dependencies

~6–14MB
~285K SLoC