Rewrite your app in Rust, piece by piece, checked against the original at every step. Works with TypeScript, JavaScript, Python, Go, Ruby, Java, C, PHP, C#, Kotlin, PowerShell and Swift.
Port your app to Rust with your coding agent, and prove the port still behaves the same. Free and open source, runs on your machine, no account.
13.8K GitHub stars · 1.1K forks · 86 contributors (read 2026-12-04) · #1 Rust repository of the day and the week on Trendshift · live on Product Hunt today
Rust Anything has no translator inside. Your coding agent writes the Rust. Rust Anything records what the original code does, replays every recorded case against the port, and only calls the port done when every case matches. Docs
Contents: Why · Install · Try it · Results · How it works · Languages · Commands · Security and privacy · Consulting · Sponsors · License · Community
Coding agents made rewriting cheap. The hard part is the question after: is the Rust version the same? Same output, same errors, same edge cases.
gate passes only when every recorded case matches, and cargo fmt, clippy, cargo test, an unsafe check and a stub check pass.disable switches back.analyze) needs no model and costs no tokens.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
Or with a package manager (the .deb is attached to each release; more in install):
brew install erkamyaman/tap/rust-anything # macOS, Linux
scoop bucket add erkamyaman https://github.com/erkamyaman/scoop-bucket # Windows
scoop install erkamyaman/rust-anything
sudo apt install ./rust-anything_*_amd64.deb # Debian, Ubuntu
nix run github:erkamyaman/rust-anything # Nix
Agents: read rustanything.ai/llms.txt for the install steps, every command and the porting workflow.
Paste this into your agent after the install, with the command that is slow in your app:
Run rust-anything go -- <slow command of this app> and finish the port until rust-anything
new writes an unusable scaffold for Cargo-reserved binary names
https://github.com/erkamyaman/rust-anything/issues/1537
Labels: None
Thanks for helping. Bug reports, fixes, new language support and write-ups of real ports are all welcome, and you don't need to ask before opening a pull request for a bug fix.
rust-anything --version). A tiny repro project helps most.You need Rust (stable, 1.97 or newer). The tests also run the language each part handles, and skip a part whose runtime is missing, so install the ones you touch:
| For | Install |
|---|---|
| TypeScript/JavaScript | Node 24 (22.6+ works except for profile) |
| Python | Python 3.9+ |
| C | a C compiler (cc) and Python 3.9+ (the recorder calls the library through ctypes) |
| Go | Go 1.22+ |
| Ruby | Ruby 3.x |
| Java | a JDK (17+) |
| Kotlin | the Kotlin compiler (kotlinc) and a JDK 17+ |
| PHP | PHP 8 |
| C# | the .NET SDK |
| PowerShell | PowerShell 7.4+ (pwsh) |
| Swift | Xcode or a Swift 5.9+ toolchain (swiftc) |
| wasm bridges | rustup target add wasm32-unknown-unknown and the matching wasm-bindgen-cli |
git clone https://github.com/erkamyaman/rust-anything
cd rust-anything
git config core.hooksPath .githooks
cargo test
With mise, mise install gets the same Rust, Node, Python, Go, Ruby and
Java versions CI uses, and installs the hk hooks in hk.pkl (the secrets
check above, plus cargo fmt and cargo clippy before each commit). Use it instead of the
core.hooksPath line.
cargo run -- doctor lists which of these runtimes you have, their versions, and the command
that installs or updates each one. To make a missing runtime fail its tests instead of skipping
them (CI does this), name it in RUST_ANYTHING_REQUIRE, e.g.
RUST_ANYTHING_REQUIRE=node,python3,go,ruby,java cargo test.
The hook runs scripts/check-secrets.sh, which refuses keys, tokens and personal home-folder
paths in what you commit. CI runs it on every file.
tests/analyze.rs: language detection, units, risks, dependencies, --whole-app.tests/loop.rs: bridge, record, diff and shadow per language, with stand-ins instead of builds.tests/native.rs: bridges built for real, then loaded and replayed.tests/end_state.rs: bridge --end-state kept in the manifest, and no end state without the
flag.tests/state_through_calls.rs: a function that reaches app state through another stays in the
original, while the pure rest is bridged.tests/app.rs and tests/http.rs: whole-app record, replay, front door and lift, for CLIs and
servers.tests/app_fresh.rs: app record --fresh, where each case starts from a snapshot of a project
folder.tests/app_stale.rs: re-recording replaces the case set; a hand-written case is kept and
named.tests/library.rs: whole-library ports.tests/effects.rs: side effects (mail sent, rows written) that make a replay fail even when
the output matches.tests/mime.rs: mail headers and parts decoded for recording, in windows-1252, Latin-1 and
the common charsets, with an unknown label kept as its bytes.tests/fuzz.rs: fuzz and record --pin-clock.tests/audit.rs: the audit log (rust/audit.jsonl) that enable/disable append to, and
what log and the MCP log tool read back from it.tests/sandbox.rs: record --sandbox and app record --sandbox (no network, read-only
source tree); skipped where bubblewrap or sandbox-exec cannot run.tests/profile.rs: profile on real Python (cProfile) and Node (--cpu-prof) workloads, and
the hints go and profile give for a workload they cannot run.tests/switch.rs: enable and disable on real source files.tests/package.rs: package layouts and an installed napi port.tests/doctor.rs: doctor --json and its exit code.tests/report.rs: what the plan says about units you cannot start with.tests/card.rs: report (card::report) end to end on a built N-API crate.tests/port_map.rs: the port map, upstream changes and unreadable manifests.tests/overloads.rs: Java, C# and Kotlin overloads kept in the original while the rest is
bridged.tests/error_resolution.rs: C# and PHP exception class resolution (qualified, nested,
fallback).tests/tools.rs: the MCP tools and the CLI expose the same options, and docs/tools.md
matches the tool list.tests/cli_help.rs: website/content/cli-help.json (the site's CLI reference) matches every
command's --help. UPDATE_CLI_HELP=1 cargo test --test cli_help rewrites it.tests/types_doc.rs: every row of docs/types.md matches what the type mappings give. Update
the table there when a mapping changes.tests/plugin.rs: the plugin ships the same skill and MCP server, at the crate version.tests/skill.rs: every command the skill names exists in the CLI, and this guide names every
file in tests/.tests/rules.rs: rules --add appends to rust/RULES.md once per rule, a crate folder stands
for its original's repository, and the agent prompt go writes carries the rules.tests/recording.rs, tests/record_cwd.rs and tests/record_timeout.rs: record flags a
stale recording, leaves the working directory alone, and stops a case that never