{"id":13646462,"url":"https://github.com/piranha/goreplace","last_synced_at":"2025-08-20T08:31:48.121Z","repository":{"id":53381624,"uuid":"2303406","full_name":"piranha/goreplace","owner":"piranha","description":"command line tool for search and replace","archived":false,"fork":false,"pushed_at":"2021-06-07T14:25:44.000Z","size":132,"stargazers_count":187,"open_issues_count":8,"forks_count":14,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-08-14T11:47:43.058Z","etag":null,"topics":["go","grep","replace"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/piranha.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2011-08-31T18:57:34.000Z","updated_at":"2025-07-25T23:29:51.000Z","dependencies_parsed_at":"2022-09-05T01:11:00.296Z","dependency_job_id":null,"html_url":"https://github.com/piranha/goreplace","commit_stats":null,"previous_names":[],"tags_count":38,"template":false,"template_full_name":null,"purl":"pkg:github/piranha/goreplace","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/piranha%2Fgoreplace","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/piranha%2Fgoreplace/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/piranha%2Fgoreplace/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/piranha%2Fgoreplace/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/piranha","download_url":"https://codeload.github.com/piranha/goreplace/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/piranha%2Fgoreplace/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271287619,"owners_count":24733424,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-20T02:00:09.606Z","response_time":69,"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":["go","grep","replace"],"created_at":"2024-08-02T01:02:56.410Z","updated_at":"2025-08-20T08:31:47.874Z","avatar_url":"https://github.com/piranha.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"# Go Replace\n\nGo Replace (gr) is a simple utility which can be used as replacement for grep +\nsed combination in one of most popular cases - find files, which contain\nsomething, possibly replace this with something else. Main points:\n\n - Reads `.hgignore`/`.gitignore` to skip files\n - Skips binaries\n - Familiar PCRE-like regexp syntax\n - Can perform replacements\n - Fast\n\nBonus:\n\n - Can search in file names with `-f` (i.e. a simple alternative to `find`)\n\n[![Build Status](https://travis-ci.org/piranha/goreplace.png)](https://travis-ci.org/piranha/goreplace)\n\n[Releases and changelog](https://github.com/piranha/goreplace/releases)\n\n## Why\n\nWhy do thing which is done by grep, find, and sed? Well, for one - I grew tired\nof typing long commands with pipes and ugly syntax. You want to search? Use\ngrep. Replace? Use find and sed! Different syntax, context switching,\netc. Switching from searching to replacing with gr is 'up one item in\nhistory and add a replacement string', much simpler!\n\nBesides, it's also faster than grep! Hard to believe, and it's a bit of cheating -\nbut gr by default ignores everything you have in your `.hgignore` and\n`.gitignore` files, skipping binary files and compiled bytecodes (which you\nusually don't want to touch anyway).\n\nThis is my reason to use it - less latency doing task I'm doing often.\n\n## Installation\n\nJust download a suitable binary from\n[release page](https://github.com/piranha/goreplace/releases). Put this file in\nyour `$PATH` and rename it to `gr` to have easier access.\n\n### Building from source\n\nYou can also install it from source, if that's your thing:\n\n    go get github.com/piranha/goreplace\n\nAnd you should be done. You have to have `$GOPATH` set for this to work (`go`\nwill put sources and generated binary there). Add `-u` flag there to update your\n`gr`.\n\nI prefer name `gr` to `goreplace`, so I link `gr` somewhere in my path (usually\nin `~/bin`) to `$GOPATH/bin/goreplace`. **NOTE**: if you use `oh-my-zsh`, it\naliases `gr` to `git remote`, so you either should use another name (I propose\n`gor`) or remove `gr` alias:\n\n```\nmkdir -p ~/.oh-my-zsh/custom \u0026\u0026 echo \"unalias gr\" \u003e\u003e ~/.oh-my-zsh/custom/goreplace.zsh\n```\n\n## Usage\n\nUsage is pretty simple, you can just run `gr` to see help on options. Basically\nyou just supply a regexp (or a simple string - it's a regexp always as well) as\nan argument and gr will search for it in all files starting from the\ncurrent directory, just like this:\n\n    gr somestring\n\nSome directories and files can be ignored by default (`gr` is looking for your\n`.hgignore`/`.gitignore` in parent directories), just run `gr` without any\narguments to see help message - it contains information about them.\n\nAnd to replace:\n\n    gr somestring -r replacement\n\nIt's performed in place and no backups are made (not that you need them, right?\nYou're using version control, aren't you?). Regular expression submatches\nsupported via `$1` syntax - see\n[re2 documentation](https://code.google.com/p/re2/wiki/Syntax) for more\ninformation about syntax and capabilities.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpiranha%2Fgoreplace","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpiranha%2Fgoreplace","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpiranha%2Fgoreplace/lists"}