Skip to content
@Rust-Anything

Rust Anything

Rewrite your app in Rust, and prove it still behaves the same.

The Rust Anything crab

Rust Anything

crates.io version npm version GitHub stars Discord MIT or Apache-2.0 license
Total downloads, crates.io and npm crates.io downloads npm downloads

Migrate your app to Rust, and prove it still behaves the same.

erkamyaman/rust-anything: #1 Rust repository of the day on Trendshift erkamyaman/rust-anything: #1 Rust repository of the week on Trendshift

Documentation: https://rustanything.ai/
Code: erkamyaman/rust-anything

🌐 Other languages

Moving a codebase to Rust? I offer consulting for Rust migrations: hello@rustanything.ai

Sponsors

Made in Türkiye 🇹🇷 by erKam Yaman
Rust Anything is free and open source. If it helps your work, sponsoring keeps it going.

Your safety comes first: sponsors get a logo and a link here, nothing more. No paid recommendations and no setup guides for third-party AI API resellers, so nothing here steers your code, keys or data somewhere you didn't choose.

Company sponsor: CodeRabbit

Domain sponsor: Atak Domain

Sponsors: Santosh Yadav, Hakan Soytürk, Ali Yilmaz, Ashley Hunter, Fatih Uzuntaş, bugrcvi

Become a sponsor Buy me a coffee

Sponsoring as a company, or anything else? hello@rustanything.ai

Moving a codebase to Rust? I offer consulting for Rust migrations: hello@rustanything.ai

Quick start

Paste this into your coding agent:

Install Rust Anything with npm i -g rust-anything, then run rust-anything setup. Run rust-anything go -- <slow command of this app> and finish the port until rust-anything gate passes.

Or install it yourself:

cargo install rust-anything   # or: npm install -g rust-anything
rust-anything setup           # adds it to Claude Code, Codex, Cursor, Gemini CLI and OpenCode
rust-anything doctor          # checks the runtimes your original needs, with the fix for each

Warning

Recording runs the original's real code. Work on a copy, and point a server at a test database. record --sandbox and app record --sandbox run it with no network, the repository read-only and CPU and memory limits (bubblewrap on Linux, sandbox-exec on macOS; doctor checks for it).

Tip

Agents: read rustanything.ai/llms.txt for the install steps, every command and the porting workflow.

How it works

analyze plans what to port; rust-anything go bridges, records, lets your agent port and gates it, looping until every recorded case matches; enable then switches callers to Rust

What counts as done. Behavior, not your tests. record runs the original on generated and given inputs and saves what each call returns, throws and prints. A port is done when gate passes: every recorded case matches, and fmt, clippy, cargo test, the unsafe check, the stub check and the check for recorded answers pasted into the port all pass. Your own tests run too.

Your tests become cases. record --from-tests -- npx jest (or pytest) runs the original's own suite and records every call it makes to the unit. --pin-clock fixes the clock and random numbers on both sides, so date-dependent code can match.

Porting a whole app: analyze plans it, you settle the decisions, app record captures its real behavior, the front door runs Rust in front of the original, units move over one by one until nothing falls back, then lift leaves a pure Rust app

Whole apps: CLIs and servers. app record records a CLI (exit code, stdout, stderr, files written) or, with --http, a server's answers to every request. app front-door scaffolds rust/app, a Rust binary that owns the entry point and hands everything not ported yet to the original. app wire moves units over one at a time, app replay must stay at 100% while the fallback rate drops to zero, and app lift leaves a pure Rust app.

Side effects count. A port that forgets to send the webhook or the email must fail. app record --effects http,smtp (or --effect-env WEBHOOK_URL=http-url) points the app at local stand-ins that record every outgoing call and mail, and --db-dump "sqlite3 app.db .dump" records the database after each request; replay checks the port does the same.

The original keeps changing? app drift replays the original against its recording and lists what now answers differently, and the GitHub Action runs gate on every push.

You make the calls. When you correct the port's behavior, rules --add "<rule>" keeps it, and every later agent prompt includes it. Everything rust-anything writes lives in <repo>/rust/.

Report or migrate, you pick. analyze and profile only report: a ranked plan of what to port, and what is hot under a real workload. They are plain commands, so the report costs no tokens. go migrates one unit: it bridges the hottest function, records it, hands the port to your agent, then builds, diffs and gates it, and switches it on only when everything matches (TS/JS, Python and PowerShell; disable switches it back off).

How long a run takes. One go run ports one unit, with at most --rounds agent turns (3 by default): one for the port, then one per failing diff or gate. A whole app is one run per unit, so you can stop after any of them.

Cheap model for the plan, strong model for the port. The plan needs no model. For the port, pass any agent command: rust-anything go --agent "claude --model <model>" -- <workload>.

Agents. rust-anything setup adds it to Claude Code, Codex, Cursor, Gemini CLI and OpenCode. Any other MCP client can run rust-anything mcp, and the skill also installs on its own with npx skills add erkamyaman/rust-anything (see install).

Languages

Language Status Checked on
TypeScript/JavaScript Verified ESLint, Prettier, json-server, Fuse.js, vercel/ms
Python Verified CPython's colorsys (2,400/2,400 cases)
Go Verified Go's path (2,642/2,642)
Ruby Verified shellwords from Ruby 3.3 (1,617/1,617)
Java Verified JDK 21 behind a facade (4,492/4,492)
C Verified ffmpeg's libavutil, glibc
C# Verified Google.Protobuf (2,941/2,941)
PHP Verified PEAR XML_Util (1,838/1,838)
Kotlin Tested this repository's fixtures, including Android
PowerShell Tested this repository's fixtures
Swift Tested this repository's fixtures

Verified means ported end to end on real code someone else wrote; Tested means covered by this repository's tests on fixtures. Every run, with dates and how it was checked: docs/STATUS.md.

Commands

Command What it does
rust-anything go -- <workload> Profile, bridge the hottest function, record it, hand the port to your agent, gate it, switch it on
rust-anything analyze <repo> Ranked migration plan: units, readiness, risks, dependencies
rust-anything profile <repo> -- <workload> What is hot under a real workload, and what to port or batch
rust-anything bridge <repo> <unit> Rust crate with bindings for one unit, stubs in src/port.rs
rust-anything record <crate> Record what the original returns, throws and prints (--inputs, --from-tests, --pin-clock)
rust-anything diff <crate> Replay every recorded case against the Rust module
rust-anything bench <crate> Time the original and Rust on the recorded cases, bridge included
rust-anything fuzz <crate> Fresh inputs through both sides: what the recording did not cover
rust-anything gate <crate> The definition of done
rust-anything enable / disable <crate> Switch callers to Rust, or back
rust-anything report <crate> REPORT.md and a card for a pull request
rust-anything app record / front-door / wire / replay / lift / drift Port a whole CLI or server
rust-anything rules <repo> --add "<rule>" Behavior you corrected, kept by every later port
rust-anything map <repo> Every unit, its crate, cases and last diff
rust-anything log <repo> Every switch on or off, wire, lift and gate result, from rust/audit.jsonl
rust-anything setup / doctor / mcp Install for agents, check runtimes, MCP server

License

Licensed under either of MIT or Apache-2.0, at your option. © Erkam Yaman. Ports and generated code in your repository are yours.

Unless you explicitly state otherwise, any contribution you intentionally submit for inclusion in rust-anything, as defined in the Apache-2.0 license, is dual licensed as above, without any additional terms or conditions.

Popular repositories Loading

  1. .github .github Public

    Rust Anything organization profile

    1

Repositories

Showing 1 of 1 repositories
  • .github Public

    Rust Anything organization profile

    Rust-Anything/.github's past year of commit activity
    1 0 0 0 Updated Nov 28, 2026

Top languages

Loading…

Most used topics

Loading…