# Greph > Greph is a pure PHP search and refactoring engine for source trees: grep-compatible text search, structural AST search and format-preserving AST rewrites. ## Pages - [Home](https://greph.inline0.dev/) ## Documentation - [Introduction](https://greph.inline0.dev/docs.md): Greph searches and refactors PHP source trees in pure PHP: grep-compatible text search, AST search with metavariables and format-preserving rewrites. - [Getting Started](https://greph.inline0.dev/docs/getting-started.md): Install Greph and run your first text, AST, and rewrite searches. - [Text Search](https://greph.inline0.dev/docs/modes/text.md): Fixed-string and regex text search with grep-compatible output and ripgrep-style ergonomics. - [AST Search](https://greph.inline0.dev/docs/modes/ast.md): Structural PHP search with metavariables, repeated captures, and variadic patterns. - [AST Rewrite](https://greph.inline0.dev/docs/modes/rewrite.md): Format-preserving structural rewrites with dry-run, interactive, and write modes. - [Indexed Text Search](https://greph.inline0.dev/docs/indexed/text.md): Warmed trigram and identifier postings index for repeated text-search workloads. - [Indexed AST Search](https://greph.inline0.dev/docs/indexed/ast.md): Warmed AST fact index for repeated structural queries. - [Cached AST Search](https://greph.inline0.dev/docs/indexed/cache.md): Cached parsed-tree store that skips the PHP-Parser pipeline on repeated queries. - [rg Compatibility](https://greph.inline0.dev/docs/compatibility/rg.md): Drop-in ripgrep wrapper backed by the Greph engine. - [sg Compatibility](https://greph.inline0.dev/docs/compatibility/sg.md): Drop-in ast-grep wrapper backed by the Greph engine. - [File Walker](https://greph.inline0.dev/docs/advanced/walker.md): Recursive directory traversal with gitignore, .grephignore, glob, and binary detection. - [Parallel Workers](https://greph.inline0.dev/docs/advanced/parallel.md): pcntl-based worker pool with single-process fallback for parallel text and AST scans. - [Process-Restricted Hosts](https://greph.inline0.dev/docs/advanced/process-restricted-hosts.md): Run Greph where proc_open(), shell_exec() or pcntl_fork() are disabled, and build the comparison helpers in a process-disabled mode. - [Feature Matrix](https://greph.inline0.dev/docs/advanced/feature-matrix.md): Probe-driven compatibility report for the rg and sg wrappers and the native greph surface. - [Testing](https://greph.inline0.dev/docs/advanced/testing.md): Unit tests, oracle regression corpus, and verification commands. - [Benchmarks](https://greph.inline0.dev/docs/advanced/benchmarks.md): Repo-local benchmark harness, real-world corpora, and CI-published numbers. - [CLI](https://greph.inline0.dev/docs/cli.md): Complete command reference for the greph, greph-index, rg, and sg executables. - [API](https://greph.inline0.dev/docs/api.md): The GrephGreph facade and the supporting option, result, and walker classes form the public PHP API. ## Optional - [Full documentation](https://greph.inline0.dev/llms-full.txt): Markdown source of every documentation page in one file, 136 KB, about 35,000 tokens