skillfed

tree-sitter-powershell

A Powershell grammar for tree-sitter

tree-sitter-powershell v0.26.4 1.6M downloads/30d#3,709 on PyPI83
Permissive license MIT Active released

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-powershell

uv

uv add tree-sitter-powershell

poetry

poetry add tree-sitter-powershell

Installing 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

Intended Audience :: DevelopersTopic :: Software Development :: CompilersTopic :: Text Processing :: LinguisticTyping :: Typed

Tags

powershell parsertree-sitter grammarincremental parsingpowershell syntax analysiscode parsing librarypowershell astlanguage grammar
parsingpowershellstatic-analysis

More Linguistic packages