Skip to content
aicoolies logo
Mago logo

Mago

Blazing-fast PHP linter, formatter, and static analyzer in Rust

Mago is a comprehensive PHP toolchain written in Rust that unifies linting, formatting, and static analysis into a single binary. It enforces PER-CS formatting standards, catches code smells with 100+ lint rules, and performs deep type inference for semantic analysis. Inspired by Clippy and OXC from the Rust ecosystem, it delivers performance orders of magnitude faster than PHPStan and Psalm while requiring no PHP runtime to execute.

About Mago

Mago reimagines PHP development tooling by combining three traditionally separate tools into a single Rust-powered binary. The formatter takes a parse-and-reprint approach inspired by Prettier and rustfmt, parsing PHP code into an AST, discarding original formatting entirely, and reprinting according to PER-CS compliant rules. This guarantees 100 percent consistent output regardless of input style, ending code formatting debates across teams with a single command that never alters runtime behavior.

The linter operates at the structural level with over 100 rules for identifying code smells, redundant patterns, and outdated syntax. It sits between the parser and the analyzer in the processing pipeline, catching issues that relate to how code is written rather than what it does. The semantic checker validates PHP version compatibility and catches syntax that the tolerant parser accepts but the PHP runtime would reject, making it a faster and more capable replacement for php -l validation in CI pipelines.

The static analyzer goes deeper by building a semantic understanding of the entire codebase with type inference, property initialization checking, and exception flow analysis. It identifies logical impossibilities like calling methods that do not exist on inferred types, accessing properties before initialization, and unchecked exception propagation. An architectural guard component validates module boundaries and coding standards at the project structure level, preventing dependency violations that accumulate over time in large PHP codebases.

Pricing & Platform Specs

Pricing Summary

100% free and open source dual-licensed under Apache-2.0 and MIT. Mago has no licensing or subscription fees, operating as a standalone, ultra-fast Rust binary locally and in CI/CD pipelines.

full pricing breakdown →

Supported Platforms

CLI on macOS, Linux, Windows — no PHP required

Explore categories, tags & use cases

Categories

Alternatives

All Mago alternatives →

Find unused files, dependencies, and exports in JavaScript and TypeScript projects

Knip is an open-source CLI tool that detects unused files, dependencies, devDependencies, and exports in JavaScript and TypeScript codebases. It analyzes the full dependency graph to identify dead code that accumulates over time — especially relevant for AI-generated codebases where unused artifacts pile up faster than manual cleanup can handle. With over 10,800 GitHub stars, it has become a standard code hygiene tool in the JS/TS ecosystem.

Open Source

Free open-source local AWS emulator as a drop-in LocalStack replacement

Floci is a free open-source AWS emulator designed as a lightweight drop-in replacement for LocalStack Community Edition. It runs on port 4566 with the same endpoint conventions, supporting S3, SQS, DynamoDB, RDS, ElastiCache, API Gateway, Cognito, IAM, and twenty-plus other services. The Docker image is ninety megabytes versus LocalStack's one gigabyte and starts in twenty-four milliseconds.

Open Source

Benchmark for evaluating AI coding agents on real GitHub issues

SWE-bench is a benchmark from Princeton NLP that evaluates AI coding agents by testing their ability to resolve real GitHub issues from popular open-source projects. Each task provides an issue description and repository state, and the agent must produce a working patch that passes the project's test suite. With 4,600+ GitHub stars, it has become the standard yardstick for comparing autonomous coding tools like Devin, Claude Code, and OpenHands.

Open Source

Community experience

Sources & verification

Sources checked
Content verified

Verification dates are editorial checks. Routine CMS saves and automatic updatedAt timestamps do not advance them.

FAQ

What is Mago?

Mago is a comprehensive PHP toolchain written in Rust that unifies linting, formatting, and static analysis into a single binary. It enforces PER-CS formatting standards, catches code smells with 100+ lint rules, and performs deep type inference for semantic analysis. Inspired by Clippy and OXC from the Rust ecosystem, it delivers performance orders of magnitude faster than PHPStan and Psalm while requiring no PHP runtime to execute.

Is Mago free?

Yes — Mago is open source and free to use. 100% free and open source dual-licensed under Apache-2.0 and MIT. Mago has no licensing or subscription fees, operating as a standalone, ultra-fast Rust binary locally and in CI/CD pipelines.

Is Mago open source?

Yes — Mago is open source.

Is Mago still maintained?

Yes — Mago is active. Its listing was last verified on September 6, 2026.

What are the best Mago alternatives?

The first editor-selected Mago alternatives are Knip, Floci, SWE-bench.