# Ast-grep

Ast-grep is a powerful tool that helps developers find and tidy up specific patterns in their computer code across thousands of files simultaneously. It is open source and self-hosted, installable on Docker Hub.

Canonical page: https://ourlocalhost.com/app/5433/ast-grep

## Description

ast-grep is a powerful tool that helps developers find and tidy up specific patterns in their computer code across thousands of files simultaneously. Unlike basic search tools, it understands the code’s structure, making it easy to fix bugs or update old styles automatically and accurately.

## Platform availability

Available on 0 of 10 platforms.

## Health score

82/100 (Excellent), based on 4 of 5 factors.
- Maintained: 100 (last commit 4 days ago)
- Popular: 84 (16,625 GitHub stars)
- Easy to install: 25 (0 install platforms, install notes, Docker image)
- Security check: 100 (no serious findings, CI, tests)

## Links

- GitHub: https://github.com/ast-grep/ast-grep
- Docker Hub: https://hub.docker.com/r/mcp/ast-grep
- Official website: https://ast-grep.github.io/
- Documentation: https://ast-grep.github.io/en/stable/

## Common questions

### How can I use ast-grep programmatically in a Node.js project?

It provides a Node.js binding for accessing syntax trees programmatically. Install the @ast-grep/napi package to use jQuery-like traversal methods and opt-in type safety.

### Can ast-grep work with custom languages?

Yes, it supports many languages out of the box. It can also register custom tree-sitter parsers by dynamic loading.

### How should I debug an ast-grep rule that behaves unexpectedly?

Simplify the code and the rule step by step to isolate the behavior.

### Does ast-grep provide an interactive way to review code changes?

It provides an interactive editing experience for reviewing code changes and refining patterns.

### Can ast-grep be used to enforce team coding standards?

It can help tech leads enforce code best practices tailored to business needs.

---
Source: Our Local Host (https://ourlocalhost.com/app/5433/ast-grep), the self-hosted and open-source app directory.
