{"id":50557596,"url":"https://github.com/llbbl/grepwrite","last_synced_at":"2026-06-04T08:30:56.250Z","repository":{"id":361651673,"uuid":"1255242866","full_name":"llbbl/grepwrite","owner":"llbbl","description":"Ripgrep-style search plus safe, transactional, AST-aware rewrites with built-in undo. Designed first for LLM coding agents, useful for humans.","archived":false,"fork":false,"pushed_at":"2026-05-31T18:04:53.000Z","size":184,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-31T18:12:07.295Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/llbbl.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-31T15:33:06.000Z","updated_at":"2026-05-31T18:04:56.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/llbbl/grepwrite","commit_stats":null,"previous_names":["llbbl/grepwrite"],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/llbbl/grepwrite","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/llbbl%2Fgrepwrite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/llbbl%2Fgrepwrite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/llbbl%2Fgrepwrite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/llbbl%2Fgrepwrite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/llbbl","download_url":"https://codeload.github.com/llbbl/grepwrite/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/llbbl%2Fgrepwrite/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33897568,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-04T02:00:06.755Z","response_time":64,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-06-04T08:30:56.178Z","updated_at":"2026-06-04T08:30:56.236Z","avatar_url":"https://github.com/llbbl.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# grepwrite\n\n[![crates.io](https://img.shields.io/crates/v/grepwrite.svg)](https://crates.io/crates/grepwrite)\n[![downloads](https://img.shields.io/crates/d/grepwrite.svg)](https://crates.io/crates/grepwrite)\n[![license](https://img.shields.io/crates/l/grepwrite.svg)](LICENSE)\n\n\u003e Ripgrep-style search plus safe, transactional, AST-aware rewrites with built-in undo. Designed first for LLM coding agents, useful for humans.\n\n**Binary:** `gw`\n\n## Install\n\n```bash\ncargo install grepwrite\n```\n\n(Homebrew formula in progress. Prebuilt binaries: planned.)\n\n## Usage\n\n### `gw find \u003cpattern\u003e [path]`\n\nLocate matches via ripgrep, or via ast-grep with `--in function|class|imports|comments`.\n\n```text\n$ gw find TODO src/\nsrc/lib.rs\n1:4: // TODO: rename foo to bar\n\nsrc/main.rs\n2:8:     // TODO: wire up cli\n```\n\n### `gw rewrite \u003cpattern\u003e \u003creplacement\u003e [path]`\n\nPreview by default; `--apply` writes atomically with a git snapshot.\n\n```text\n$ gw rewrite 'foo' 'bar' src/ -o diff       # preview\n--- a/src/lib.rs\n+++ b/src/lib.rs\n@@ -1,4 +1,4 @@\n-// TODO: rename foo to bar\n-pub fn foo() -\u003e u32 {\n+// TODO: rename bar to bar\n+pub fn bar() -\u003e u32 {\n     42\n }\n...\n\n$ gw rewrite 'foo' 'bar' src/ --apply       # write\n...\napplied (snapshot: 2026-05-31T19-52-42-9ceabf)\n```\n\n### `gw undo [--snapshot \u003cid|name\u003e]`\n\nRestores files exactly, refusing to clobber edits you made on top.\n\n```text\n$ gw undo\nundone: 2026-05-31T19-52-42-9ceabf (2 files restored)\n```\n\n### `gw snapshots`\n\nLists snapshots, newest first.\n\n```text\n$ gw snapshots\n2026-05-31T19-52-42-9ceabf  2026-05-31T19:52:42Z  3 edits  -\n```\n\n### Output formats\n\n`compact` (default — rg-style for `find`, unified diff for `rewrite`), `caveman` (LLM-token-minimal `path:line` per match), `json` (stable schema v1), `diff` (unified, `rewrite` only).\n\n## Why\n\n`gw` wraps two excellent existing tools — [ripgrep](https://github.com/BurntSushi/ripgrep) for regex search and [ast-grep](https://ast-grep.github.io/) for structural search — and adds the missing piece: a safe, transactional rewrite layer with built-in undo.\n\nripgrep deliberately stops at preview: `rg -r` prints what it would write without writing. The conventional workaround is to chain `rg` with `sed -i` and a read-after-write check, which works but is brittle in scripts and especially hostile to LLM coding agents — three tools, three failure modes, tokens spent reconciling each step.\n\n`gw` collapses that chain into one binary: locate, plan, dry-run by default, and atomic per-file writes wrapped in a git-ref snapshot when you commit to `--apply`. The locate layer is unchanged — it's just ripgrep and ast-grep underneath — so search semantics are exactly what you already know.\n\n## Documentation\n\n- [Contributing \u0026 build instructions](docs/CONTRIBUTING.md) — build, test, lint, debug, credits.\n- [Smoke testing in Docker](docs/SMOKE.md) — ephemeral fixtures for manual exploration.\n- [Release procedure](docs/RELEASING.md) — versioning policy and release recipes.\n\n## License\n\nMIT. See [LICENSE](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fllbbl%2Fgrepwrite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fllbbl%2Fgrepwrite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fllbbl%2Fgrepwrite/lists"}