tree-sitter-powershell
A Powershell grammar for tree-sitter
What it is and what it does
tree-sitter-powershell is a language grammar binding that provides PowerShell syntax parsing for the tree-sitter incremental parsing framework. It allows you to parse PowerShell code into an abstract syntax tree that can be traversed and analyzed programmatically, without relying on PowerShell's own parser.
The package is a compiled grammar with no runtime dependencies. It targets PowerShell 7.3 and is maintained by Airbus CERT. It's useful for static analysis tools, linters, code formatters, or any application that needs to understand PowerShell code structure.
Use it for:
- Build a PowerShell linter or static analysis tool that inspects code structure
- Create a code formatter or refactoring tool for PowerShell scripts
- Implement syntax highlighting or IDE features for PowerShell in a custom editor
- Analyze PowerShell scripts for security patterns or compliance violations
- Generate documentation or metrics from PowerShell codebases
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides a tree-sitter grammar for parsing PowerShell code, enabling incremental syntax analysis and tree-based code inspection for PowerShell scripts.
Yes, if you need programmatic PowerShell parsing. The package is actively maintained, has no known vulnerabilities, uses a permissive MIT license, and provides prebuilt wheels for common platforms. Install friction is moderate but acceptable. Verify that the grammar covers your specific PowerShell features before committing to production use.
Install
tree-sitter-powershell on PyPI
pip
pip install tree-sitter-powershelluv
uv add tree-sitter-powershellpoetry
poetry add tree-sitter-powershellInstalling tree-sitter-powershell
Before you install
Medium install friction due to compiled wheels; prebuilt binaries available for common platforms (macOS x86_64/arm64, Linux x86_64/aarch64, Windows x86_64/arm64). Package is actively maintained with recent commits and no runtime dependencies.
License in practice
MIT license is permissive; you can use, modify, and distribute this package freely with minimal restrictions.
Quickstart
pip install tree-sitter-powershell
Requires Python 3.10 or later; tree-sitter framework must be installed separately as a peer dependency.
Verify before relying
- Whether the grammar covers all PowerShell 7.3 language features or has known gaps
- Performance characteristics for parsing large or complex PowerShell files
- Integration examples or documentation beyond the GitHub repository
- How tree-sitter-powershell integrates with the tree-sitter framework in practice
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 102 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,621,708/month — #3,709 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: tree_sitter_powershell-0.26.4-cp310-abi3-macosx_10_9_x86_64.whl; tree_sitter_powershell-0.26.4-cp310-abi3-macosx_11_0_arm64.whl; tree_sitter_powershell-0.26.4-cp310-abi3-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl; tree_sitter_powershell-0.26.4-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; tree_sitter_powershell-0.26.4-cp310-abi3-musllinux_1_2_aarch64.whl; tree_sitter_powershell-0.26.4-cp310-abi3-musllinux_1_2_x86_64.whl; tree_sitter_powershell-0.26.4-cp310-abi3-win_amd64.whl; tree_sitter_powershell-0.26.4-cp310-abi3-win_arm64.whl
Keywords: incremental, parsing, tree-sitter, powershell
Tags
More Linguistic packages
Detects and normalizes text encoding from…
permissive · top 100 on PyPI
tiktokentiktoken is a fast BPE tokenizer that converts…
permissive · top 1,000 on PyPI
chardetDetects character encoding and language in byte…
permissive · top 1,000 on PyPI
text-unidecodeConverts Unicode text to ASCII by…
copyleft · top 1,000 on PyPI
larkLark is a parsing library that builds abstract…
permissive · top 1,000 on PyPI
tree-sitterPython bindings to the tree-sitter parsing…
permissive · top 1,000 on PyPI
tree-sitter-pythonProvides a Python grammar for tree-sitter,…
permissive · top 5,000 on PyPI
tree-sitter-fortranProvides a Fortran language grammar for…
permissive · top 5,000 on PyPI
tree-sitter-javaProvides a Java language grammar for…
permissive · top 5,000 on PyPI
tree-sitter-phpProvides a PHP language grammar for…
permissive · top 5,000 on PyPI
tree-sitter-groovyProvides a Groovy language grammar for…
permissive · top 5,000 on PyPI
tree-sitter-cssProvides a CSS grammar parser for tree-sitter,…
permissive · top 5,000 on PyPI
tree-sitter-goProvides a Go language grammar for tree-sitter,…
permissive · top 5,000 on PyPI
tree-sitter-hclProvides a tree-sitter parser grammar for HCL…
permissive · top 15,000 on PyPI
tree-sitter-zigProvides a tree-sitter grammar for parsing Zig…
permissive · top 5,000 on PyPI
tree-sitter-rubyProvides a Ruby language grammar for…
permissive · top 5,000 on PyPI