Tool for interactively exploring the AST of Hack programs

Installs: 64 600

Dependents: 0

Suggesters: 0

Security: 0

Stars: 2

Watchers: 16

Forks: 4

Open Issues: 0



v1.0.1 2021-01-26 18:13 UTC

This package is auto-updated.

Last update: 2023-01-13 02:03:09 UTC


HHAST-Inspect is a tool to generate an interactive view of a Hack program's concrete syntax tree, built using HHAST. It was previously included with HHAST, and is primarily used as a developer tool when working with HHAST, such as when working on linters or migrations (a.k.a. codemods).


  1. Clone this repository: git clone https://github.com/hhvm/hhast-inspect
  2. Install dependencies: cd hhast-inspect; composer install


  1. Run bin/hhast-inspect /path/to/source/file; this will produce an HTML file and show the path
  2. Open the output file in a web browser. On most systems, passing --open to hhast-inspect will make it open the file automatically in your default web web browser
  3. Click on Hack source code to select the syntax tre node, and to show information on the node and its' ancestors
  4. Click on one of the ancestors to highlight the ancestor - the original node remains highlighted in a different color


% bin/hhast-inspect src/InspectorCLI.hack --open

A new HHAST-inspected generated web page A single selected node A selected ancestor, highlighting the original node


HHAST-Inspect is MIT-licensed.