{"id":16587515,"url":"https://github.com/alexpasmantier/grip-grab","last_synced_at":"2025-05-16T18:07:53.027Z","repository":{"id":249455714,"uuid":"831564249","full_name":"alexpasmantier/grip-grab","owner":"alexpasmantier","description":"Hold on tight","archived":false,"fork":false,"pushed_at":"2024-11-09T19:06:49.000Z","size":226,"stargazers_count":119,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-03T19:12:50.289Z","etag":null,"topics":["ag","cli","grep","json","regex","ripgrep","rust","search","speed","terminal"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/grip-grab","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alexpasmantier.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-20T23:59:04.000Z","updated_at":"2025-03-19T12:45:36.000Z","dependencies_parsed_at":"2024-08-04T14:58:53.696Z","dependency_job_id":"f26f06aa-ce8c-47dc-bb20-a08e0712f14a","html_url":"https://github.com/alexpasmantier/grip-grab","commit_stats":{"total_commits":98,"total_committers":2,"mean_commits":49.0,"dds":"0.29591836734693877","last_synced_commit":"831a5646dd030785b6ea32c1c3ceb0f33b989779"},"previous_names":["alexpasmantier/grab","alexpasmantier/grip-grab","alexpasmantier/grip-grep"],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexpasmantier%2Fgrip-grab","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexpasmantier%2Fgrip-grab/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexpasmantier%2Fgrip-grab/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexpasmantier%2Fgrip-grab/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alexpasmantier","download_url":"https://codeload.github.com/alexpasmantier/grip-grab/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248600960,"owners_count":21131581,"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","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":["ag","cli","grep","json","regex","ripgrep","rust","search","speed","terminal"],"created_at":"2024-10-11T22:54:24.511Z","updated_at":"2025-04-12T16:47:01.953Z","avatar_url":"https://github.com/alexpasmantier.png","language":"Rust","funding_links":[],"categories":["Rust"],"sub_categories":[],"readme":"![Crates.io Total Downloads](https://img.shields.io/crates/d/grip-grab) ![Crates.io Version](https://img.shields.io/crates/v/grip-grab) ![GitHub License](https://img.shields.io/github/license/alexpasmantier/grip-grab)\n\n\n# grip-grab (`gg`) 🧤\n\nA fast, more lightweight ripgrep alternative for daily use cases.\n\n```sh\n❯ gg \"\\b(Read|Write)Half[^\u003c]\" tokio/src\n```\n\n\n\nhttps://github.com/user-attachments/assets/13406bea-b6f2-4629-b814-366713a8d90d\n\n\n\n\n\n## Installation\n### Using Cargo\n```bash\ncargo install grip-grab\n```\n\n**NOTE:** if using zsh with the `git` plugin, you might need to unalias `gg` in order for grip-grab's `gg` to work:\n```sh\necho 'unalias gg' \u003e\u003e ~/.zshrc\nsource ~/.zshrc\n```\n\n\n## Benchmarks\n\n### The general idea\n_With default settings for both tools, `gg` will typically be faster than `rg` on small to moderatly sized codebases (\u003c= a couple milion lines) running on everyday machines because of its default thread heuristic. `rg` will typically be faster out of the box on larger corpora (think a checkout of the linux kernel) and machines with more logical cpus. Note that you still can tweak `gg` with the `-T` argument to achieve similar performance in those cases._\n\n_[The following discussion with ripgrep's author on HackerNews](https://news.ycombinator.com/item?id=41380065) might also provide more insights regarding this tool's performance (including more benchmarks across different machines and corpora)._\n\n*NOTE*: _The following benchmarks were run on an M3 Macbook Pro with 16GB of RAM and 8 logical CPUs._\n\n### The `curl` codebase (approx. half a milion lines)\nhttps://github.com/curl/curl\n\n```sh\nhyperfine -m 200 \"gg '[A-Z]+_NOBODY' .\" \"rg '[A-Z]+_NOBODY' .\" \"ggrep -rE '[A-Z]+_NOBODY' .\"\n```\n```\nBenchmark 1: gg '[A-Z]+_NOBODY' .\n  Time (mean ± σ):      18.5 ms ±   0.7 ms    [User: 10.5 ms, System: 47.9 ms]\n  Range (min … max):    17.0 ms …  19.9 ms    200 runs\n\nBenchmark 2: rg '[A-Z]+_NOBODY' .\n  Time (mean ± σ):      37.0 ms ±   4.6 ms    [User: 15.1 ms, System: 201.0 ms]\n  Range (min … max):    23.3 ms …  60.5 ms    200 runs\n\nBenchmark 3: ggrep -rE '[A-Z]+_NOBODY' .\n  Time (mean ± σ):      68.5 ms ±   0.6 ms    [User: 27.2 ms, System: 40.4 ms]\n  Range (min … max):    64.6 ms …  70.4 ms    200 runs\n\nSummary\n  gg '[A-Z]+_NOBODY' . ran\n    2.00 ± 0.26 times faster than rg '[A-Z]+_NOBODY' .\n    3.71 ± 0.14 times faster than ggrep -rE '[A-Z]+_NOBODY' .\n```\n\n**Plaintext searches**\n```sh\nhyperfine -m 100 \"gg 'test'\" \"rg 'test'\" \"ggrep -rE 'test'\"\n```\n```\nBenchmark 1: gg 'test'\n  Time (mean ± σ):      22.3 ms ±   1.1 ms    [User: 16.5 ms, System: 51.0 ms]\n  Range (min … max):    20.4 ms …  27.7 ms    100 runs\n\nBenchmark 2: rg 'test'\n  Time (mean ± σ):      49.7 ms ±   2.7 ms    [User: 23.4 ms, System: 298.3 ms]\n  Range (min … max):    42.0 ms …  55.5 ms    100 runs\n\nBenchmark 3: ggrep -rE 'test'\n  Time (mean ± σ):      52.3 ms ±   0.9 ms    [User: 14.6 ms, System: 37.0 ms]\n  Range (min … max):    50.1 ms …  56.9 ms    100 runs\n\nSummary\n  gg 'test' ran\n    2.23 ± 0.16 times faster than rg 'test'\n    2.34 ± 0.12 times faster than ggrep -rE 'test'\n```\n\n\n### The `tokio` codebase (approx. 160k lines)\nhttps://github.com/tokio-rs/tokio\n\n```sh\nhyperfine -m 200 \"gg 'in\u003c\\w, W\u003e'\" \"rg 'in\u003c\\w, W\u003e'\" \"ggrep -r 'in\u003c[[:alnum:]], W\u003e'\"\n```\n```\nBenchmark 1: gg 'in\u003c\\w, W\u003e'\n  Time (mean ± σ):       7.4 ms ±   0.7 ms    [User: 4.5 ms, System: 6.8 ms]\n  Range (min … max):     6.0 ms …  10.3 ms    208 runs\n\nBenchmark 2: rg 'in\u003c\\w, W\u003e'\n  Time (mean ± σ):       8.8 ms ±   0.8 ms    [User: 5.9 ms, System: 16.5 ms]\n  Range (min … max):     6.7 ms …  10.7 ms    200 runs\n\nBenchmark 3: ggrep -r 'in\u003c[[:alnum:]], W\u003e'\n  Time (mean ± σ):     118.3 ms ±   2.1 ms    [User: 100.8 ms, System: 16.5 ms]\n  Range (min … max):   114.3 ms … 127.4 ms    200 runs\n\nSummary\n  gg 'in\u003c\\w, W\u003e' ran\n    1.19 ± 0.15 times faster than rg 'in\u003c\\w, W\u003e'\n   15.92 ± 1.54 times faster than ggrep -r 'in\u003c[[:alnum:]], W\u003e'\n```\n\n**Plaintext searches**\nThese typically take \u003c5ms on the tokio repository which is too low to benchmark with a tool like hyperfine.\n\n### The `neovim` codebase (approx. 1.3 milion lines)\nhttps://github.com/neovim/neovim\n\n```sh\nhyperfine --warmup 100 \"gg '[a-z]+_buf\\b'\" \"rg '[a-z]+_buf\\b'\" \"ggrep -rE '[a-z]+_buf\\b'\"\n```\n```\nBenchmark 1: gg '[a-z]+_buf\\b'\n  Time (mean ± σ):      19.0 ms ±   1.2 ms    [User: 12.4 ms, System: 54.4 ms]\n  Range (min … max):    16.8 ms …  22.6 ms    113 runs\n\nBenchmark 2: rg '[a-z]+_buf\\b'\n  Time (mean ± σ):      36.0 ms ±   4.9 ms    [User: 14.8 ms, System: 200.5 ms]\n  Range (min … max):    23.9 ms …  46.2 ms    75 runs\n\nBenchmark 3: ggrep -rE '[a-z]+_buf\\b'\n  Time (mean ± σ):      75.7 ms ±   0.9 ms    [User: 36.3 ms, System: 39.4 ms]\n  Range (min … max):    74.1 ms …  78.1 ms    36 runs\n\nSummary\n  gg '[a-z]+_buf\\b' ran\n    1.89 ± 0.29 times faster than rg '[a-z]+_buf\\b'\n    3.99 ± 0.26 times faster than ggrep -rE '[a-z]+_buf\\b'\n```\n\n**Plaintext searches**\n```sh\nhyperfine --warmup 100 -m 100 \"gg 'test'\" \"rg 'test'\" \"ggrep -rE 'test'\"\n```\n```\nBenchmark 1: gg 'test'\n  Time (mean ± σ):      21.0 ms ±   0.8 ms    [User: 15.3 ms, System: 48.1 ms]\n  Range (min … max):    18.9 ms …  23.2 ms    114 runs\n\nBenchmark 2: rg 'test'\n  Time (mean ± σ):      42.4 ms ±   3.6 ms    [User: 19.5 ms, System: 253.3 ms]\n  Range (min … max):    34.9 ms …  63.4 ms    100 runs\n\nBenchmark 3: ggrep -rE 'test'\n  Time (mean ± σ):      65.3 ms ±   1.6 ms    [User: 27.8 ms, System: 36.7 ms]\n  Range (min … max):    63.2 ms …  78.4 ms    100 runs\n\nSummary\n  gg 'test' ran\n    2.02 ± 0.19 times faster than rg 'test'\n    3.11 ± 0.15 times faster than ggrep -rE 'test'\n```\n\n## Usage\n```sh\n❯ gg --help\n```\n\n```plaintext\nA faster, more lightweight ripgrep alternative for day to day usecases.\n\nUsage: gg [OPTIONS] [PATTERN] [PATHS]... [COMMAND]\n\nCommands:\n  upgrade  Upgrade the crate to its latest version\n  help     Print this message or the help of the given subcommand(s)\n\nArguments:\n  [PATTERN]   a regex pattern to search for\n  [PATHS]...  path in which to search recursively\n\nOptions:\n  -e, --patterns \u003cPATTERNS\u003e\n          you can specify multiple patterns using -e \"pattern1\" -e \"pattern2\" etc\n  -I, --ignore-paths \u003cIGNORE_PATHS\u003e\n          paths to ignore when recursively walking target directory\n  -G, --disregard-gitignore\n          disregard .gitignore rules when recursively walking directory (defaults to false)\n  -T, --n-threads \u003cN_THREADS\u003e\n          number of threads to use [default: 4]\n  -U, --multiline\n          enable multiline matching\n      --json\n          output in JSON format\n  -f, --file-paths-only\n          output file paths only\n  -A, --absolute-paths\n          output absolute paths (defaults to relative)\n  -C, --disable-colored-output\n          disable colored output (colored by default)\n  -t, --filter-filetypes \u003cFILTER_FILETYPES\u003e\n          filter on filetype (defaults to all filetypes)\n  -H, --disable-hyperlinks\n          disable hyperlinks in output (defaults to false)\n  -D, --disable-devicons\n          disable devicons in output (defaults to false)\n  -h, --help\n          Print help\n  -V, --version\n          Print version\n```\n\n## Upgrading `gg`\nYou may upgrade `gg` to its latest version by running:\n```sh\ngg upgrade\n```\n```\nUpgrade the crate to its latest version\n\nUsage: gg upgrade [OPTIONS]\n\nOptions:\n  -f, --force  Optional flag for force upgrade\n  -h, --help   Print help\n```\n\n\nhttps://github.com/user-attachments/assets/8620a805-4b2a-498e-a0a0-e8b6835bc9cd\n\n\n\n## Examples\n### Basic usage\n```sh\n❯ gg \"\\b(Read|Write)Half[^\u003c]\" tokio/src\n```\n\u003cimg width=\"1838\" alt=\"Screenshot 2024-10-04 at 14 48 44\" src=\"https://github.com/user-attachments/assets/7ef9fecf-4a00-4be1-90bc-8579e49bced2\"\u003e\n\n\n### JSON output\n```sh\n❯ gg --json unsplit tokio/src | jq\n```\n\u003cimg width=\"1696\" alt=\"Screenshot 2024-07-24 at 13 25 29\" src=\"https://github.com/user-attachments/assets/67d4e90a-9bd1-4808-a260-226007339a55\"\u003e\n\n\n\n### Filenames only\n```sh\n❯ gg -f \"\\b(Read|Write)Half[^\u003c]\" tokio/src\n```\n\u003cimg width=\"684\" alt=\"Screenshot 2024-10-04 at 14 49 44\" src=\"https://github.com/user-attachments/assets/150006c9-7ba9-42a9-8d6c-ef46fde39ede\"\u003e\n\n\n## Notes\nThis lightweight utility is largely based on a couple of crates from the extraordinary [ripgrep](https://github.com/BurntSushi/ripgrep) tool.\nIts aim is to provide a minimal and lightweight version that can be easily integrated in other programs for search-related purproses.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexpasmantier%2Fgrip-grab","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falexpasmantier%2Fgrip-grab","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexpasmantier%2Fgrip-grab/lists"}