go-anything
Health Uyari
- License — License: Apache-2.0
- Description — Repository has a description
- Active repo — Last push 0 days ago
- Low visibility — Only 6 GitHub stars
Code Basarisiz
- rm -rf — Recursive force deletion command in .github/workflows/release.yml
- rm -rf — Recursive force deletion command in demo/c-musl/check.sh
Permissions Gecti
- Permissions — No dangerous permissions requested
Bu listing icin henuz AI raporu yok.
Rewrite your app in Go, piece by piece, checked against the original at every step. Works with TypeScript, JavaScript, Python, Rust, Ruby, Java, C, PHP, C#, Kotlin, PowerShell and Swift.
Go Anything
Migrate your app to Go, and check it still behaves the same.
"You shall not pass... until gate does."
Gondalf the Gopher
Documentation: docs/how-it-works.md
A Go port of rust-anything by Erkam Yaman.
[!TIP]
New: Laravel → Laravel Go. Move a Laravel app to the official Laravel Go
framework route by route, every response checked against the running PHP app. See
Laravel → Laravel Go.
[!NOTE]
Go Anything is being built. This README describes the whole design; docs/STATUS.md says which commands run today.
Quick start
Paste this into your coding agent:
Install Go Anything with go install github.com/boracomet/go-anything/cmd/go-anything@latest, then run go-anything setup. Run go-anything go -- <slow command of this app> and finish the port until go-anything gate passes.
Or install it yourself:
go install github.com/boracomet/go-anything/cmd/go-anything@latest # no version is published yet: see docs/install.md
go-anything setup # adds it to Claude Code, Codex, Cursor, Gemini CLI and OpenCode
go-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 --sandboxruns it with no network, the repository read-only and a CPU limit
(sandbox-exec on macOS, bubblewrap on Linux); without the flag there is no sandbox. What has been run
on which system is in STATUS.
[!TIP]
Agents: read skills/go-anything/SKILL.md for the install steps, every command and the porting workflow.
How it works
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 (an error must have the original's type; its message text is not compared), and gofmt, go vet, go test, the unsafe and cgo 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 the calls it makes to the unit. --pin-clock fixes the clock and random numbers on both sides (TS/JS and Python, through the C shared library), so date-dependent code can match. Calls whose arguments include a function, a symbol, a cycle, a RegExp or an Error are left out of what --from-tests records.
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 go/app, a Go 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 Go 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.
What app lift waits for. go-anything obligations <repo> lists what the original offers (exports, commands, flags, routes, environment variables, the places it fails on purpose), and --evidence links each item to the recorded cases that exercise it. obligations --check says what still blocks app lift: an item no case exercises, a family nobody attested, an expected file with a ... line, a fallback the front door took that no case explains. Only exports can be listed in full; the rest is what the detectors recognise, and a person attests it (obligations attest) or waives an item with a reason (obligations waive); each decision writes an ADR. The MCP server offers obligations, obligations_check and obligations_fallbacks; the first two only read, the third writes only when given write or inputs, and none of them waives, attests or binds a case to an obligation: deciding is left to you. A port made with an earlier release stops at its next app lift until obligations <repo> --check lists nothing.
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 go-anything generates lives in <repo>/go/; enable edits the original's files with one removable block, and setup writes your agents' config.
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. It needs profile, so it runs for TS/JS, Python, Rust, Ruby and Java; it switches on in place for TS/JS and Python (disable switches it back off), and for the others it stops after gate and bench. PowerShell units go through bridge, record, diff, gate and enable by hand: profile does not run PowerShell.
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: go-anything go --agent "claude --model <model>" -- <workload>.
Agents. go-anything setup adds it to Claude Code, Codex, Cursor, Gemini CLI and OpenCode. Any other MCP client can run go-anything mcp. The workflow skill lives in skills/go-anything.
Laravel → Laravel Go
A Laravel (PHP) app moves to the official Laravel Go framework
(go.laravel.com v0.2.0, beta) route by route, each route checked against the running PHP app:
go-anything analyze --whole-app . # every part of the Laravel app and its Laravel Go package, and what Laravel Go lacks
go-anything app record . --http -- php artisan serve --port {port}
go-anything obligations . --write # every route of routes/*.php, artisan command and env() read
go-anything app front-door . --laravel-go # go/app: a Laravel Go app; every unported request goes to PHP
# port a route: a handler in go/app/handlers, a line in go/app/routes/api.go, then
(cd go/app && go build -o bin/artisan .)
go-anything app replay . --build go/app/bin/artisan # 100% must pass; the fallback is listed per route
go-anything app lift . # refused while any case falls back; then pure Laravel Go
The demo does it to a real open-source Laravel 11 app (a
RealWorld/Conduit API, MIT): 58 recorded requests, each with the SQLite database dumped after it,
replayed identically by the ported Laravel Go app at 0% fallback and then lifted, with artisan
hidden for the final replay. On an Apple M2 Pro, Laravel Go answered 2.4x to 12.9x the requests
per second of PHP's built-in server with 8 workers, and its handlers ran 2.8x to 6.4x faster in
process. How it works and what Laravel Go does not have yet: docs/laravel.md.
Real-world ports
Real code someone else wrote, taken through go-anything's loop. Each demo's README says what was run,
on what machine and with what result; speed figures were measured while other work ran on the same
machine, so they are lower bounds.
| Demo | What | Result |
|---|---|---|
| laravel-go | a Laravel 11 RealWorld API moved to Laravel Go | 58/58 requests identical, 0% fallback, lifted; 2.4x to 12.9x the requests per second of PHP |
| prettier-go | Prettier 3.10.1, whole (JS/TS, CSS/SCSS/Less, Markdown, YAML, GraphQL) | 59/59 real files byte for byte, 13.8x one process per file; 4.6% fallback (rust-anything: 7.9%) |
| eslint-go | ESLint 10.15.0 and its 90 rules, whole | 11,149/11,149 runs identical, 3.4% fallback; 19.5x on 441 real files |
| ffmpeg-go | 12 modules of FFmpeg's libavutil (C) | 59,425 calls match, gate passes on each |
| fuse-go | Fuse.js's relevance scoring | 3,422/3,422 cases, 180/180 searches ranked as Fuse ranks them |
| json-server-go | json-server's four pure units | 1,428 and 858 cases match |
Languages
| Language | Status | Checked on |
|---|---|---|
| TypeScript/JavaScript | Tested | this repository's fixtures; ts-textkit (2,379/2,379 cases), npm ms (3,176/3,176) |
| Python | Tested | this repository's fixtures; py-textkit (2,416/2,416 cases), CPython's colorsys (8,048/8,048) |
| Rust | Tested | this repository's fixtures; strsim (944/944 cases) |
| Ruby | Tested | this repository's fixtures; shellwords (671/671 cases) |
| Java | Tested | this repository's fixtures; the JDK's URLEncoder, URLDecoder and Integer (1,666/1,666 cases) |
| C | Tested | this repository's fixtures; four functions of musl (1,310/1,310 cases) |
| C# | Tested | this repository's fixtures; Google.Protobuf's size computations (2,995/2,995 cases) |
| PHP | Tested | this repository's fixtures; XML_Util (2,244/2,244 cases) |
| Kotlin | Tested | this repository's fixtures; string-similarity-kotlin (1,815/1,815 cases) |
| PowerShell | Tested | this repository's fixtures; three dbatools helpers (166/166 cases) |
| Swift | Tested | this repository's fixtures; argparse strings (759/759 cases) |
Verified means ported end to end on real code someone else wrote; Tested means covered by this repository's tests on fixtures. No language is verified yet. Every run, with dates and how it was checked: docs/STATUS.md.
Commands
| Command | What it does |
|---|---|
go-anything go -- <workload> |
Profile, bridge the hottest function, record it, hand the port to your agent, gate it, switch it on |
go-anything analyze <repo> |
Ranked migration plan: units, readiness, risks, dependencies |
go-anything profile <repo> -- <workload> |
What is hot under a real workload, and what to port or batch |
go-anything bridge <repo> <unit> |
Go port module with bindings for one unit, stubs in port/port.go |
go-anything record <module> |
Record what the original returns, throws and prints (--inputs, --from-tests, --pin-clock) |
go-anything diff <module> |
Replay every recorded case against the Go port |
go-anything bench <module> |
Time the original and Go on the recorded cases, bridge included |
go-anything fuzz <module> |
Fresh inputs through both sides: what the recording did not cover |
go-anything gate <module> |
The definition of done |
go-anything selftest |
Plant wrong ports in a scratch folder and check that diff and gate refuse each |
go-anything enable / disable <module> |
Switch callers to Go, or back |
go-anything report <module> |
REPORT.md and a card for a pull request |
go-anything app record / front-door / wire / replay / lift / drift |
Port a whole CLI or server |
go-anything rules <repo> --add "<rule>" |
Behavior you corrected, kept by every later port |
go-anything map <repo> |
Every unit, its port module, cases and last diff |
go-anything log <repo> |
Every switch on or off, wire, lift and gate result, from go/audit.jsonl |
go-anything setup / doctor / mcp |
Install for agents, check runtimes, MCP server |
License
Licensed under either of MIT or Apache-2.0, at your option. go-anything is a Go port of rust-anything, © Erkam Yaman; see NOTICE. The mascot, Gondalf the Gopher, is based on the Go gopher, designed by Renee French, and licensed under CC BY 4.0. Ports and generated code in your repository are yours.
Unless you explicitly state otherwise, any contribution you intentionally submit for inclusion in go-anything, as defined in the Apache-2.0 license, is dual licensed as above, without any additional terms or conditions.
Yorumlar (0)
Yorum birakmak icin giris yap.
Yorum birakSonuc bulunamadi