2024-12-24 00:43:07 -05:00
|
|
|
# `tree-sitter playground`
|
|
|
|
|
|
|
|
|
|
The `playground` command allows you to start a local playground to test your parser interactively.
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
tree-sitter playground [OPTIONS] # Aliases: play, pg, web-ui
|
|
|
|
|
```
|
|
|
|
|
|
2025-01-10 02:29:32 -05:00
|
|
|
```admonish note
|
2025-08-19 12:32:46 +03:00
|
|
|
For this to work, you must have already built the parser as a Wasm module. This can be done with the [`build`](./build.md) subcommand
|
2024-12-24 00:43:07 -05:00
|
|
|
(`tree-sitter build --wasm`).
|
2025-01-10 02:29:32 -05:00
|
|
|
```
|
2024-12-24 00:43:07 -05:00
|
|
|
|
|
|
|
|
## Options
|
|
|
|
|
|
|
|
|
|
### `-q/--quiet`
|
|
|
|
|
|
|
|
|
|
Don't automatically open the playground in the default browser.
|
|
|
|
|
|
|
|
|
|
### `--grammar-path <GRAMMAR_PATH>`
|
|
|
|
|
|
|
|
|
|
The path to the directory containing the grammar and wasm files.
|
2025-11-01 05:25:00 -04:00
|
|
|
|
|
|
|
|
### `-e/--export <EXPORT_PATH>`
|
|
|
|
|
|
|
|
|
|
Export static playground files to the specified directory instead of serving them.
|