Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tree-sitter CLI - develop, test, and use Tree-sitter grammars from the command line #871

Open
1 task
ShellLM opened this issue Aug 9, 2024 · 1 comment
Labels
CLI-UX Command Line Interface user experience and best practices Git-Repo Source code repository like gitlab or gh github gh tools like cli, Actions, Issues, Pages source-code Code snippets

Comments

@ShellLM
Copy link
Collaborator

ShellLM commented Aug 9, 2024

Tree-sitter CLI

crates.io badge npmjs.com badge

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.

Suggested labels

None

@ShellLM ShellLM added CLI-UX Command Line Interface user experience and best practices Git-Repo Source code repository like gitlab or gh github gh tools like cli, Actions, Issues, Pages source-code Code snippets labels Aug 9, 2024
@ShellLM
Copy link
Collaborator Author

ShellLM commented Aug 9, 2024

Related content

#771 similarity score: 0.86
#743 similarity score: 0.86
#136 similarity score: 0.84
#762 similarity score: 0.84
#866 similarity score: 0.84
#114 similarity score: 0.84

@irthomasthomas irthomasthomas changed the title tree-sitter/cli/README.md at master · tree-sitter/tree-sitter Tree-sitter CLI - develop, test, and use Tree-sitter grammars from the command line Aug 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLI-UX Command Line Interface user experience and best practices Git-Repo Source code repository like gitlab or gh github gh tools like cli, Actions, Issues, Pages source-code Code snippets
Projects
None yet
Development

No branches or pull requests

1 participant