{"id":13582548,"url":"https://github.com/aykamko/tag","last_synced_at":"2026-01-20T21:32:23.757Z","repository":{"id":46278244,"uuid":"46586157","full_name":"aykamko/tag","owner":"aykamko","description":"Instantly jump to your ag or ripgrep matches.","archived":false,"fork":false,"pushed_at":"2023-01-24T00:53:36.000Z","size":11982,"stargazers_count":601,"open_issues_count":13,"forks_count":33,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-04-06T14:36:39.485Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","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/aykamko.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":"2015-11-20T20:51:59.000Z","updated_at":"2025-03-13T14:34:28.000Z","dependencies_parsed_at":"2023-02-13T07:00:35.206Z","dependency_job_id":null,"html_url":"https://github.com/aykamko/tag","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/aykamko/tag","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aykamko%2Ftag","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aykamko%2Ftag/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aykamko%2Ftag/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aykamko%2Ftag/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aykamko","download_url":"https://codeload.github.com/aykamko/tag/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aykamko%2Ftag/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28614581,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-20T18:56:40.769Z","status":"ssl_error","status_checked_at":"2026-01-20T18:54:26.653Z","response_time":117,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":"2024-08-01T15:02:49.492Z","updated_at":"2026-01-20T21:32:23.740Z","avatar_url":"https://github.com/aykamko.png","language":"Go","readme":"tag - Tag your ag and ripgrep matches\n====\n![revolv++](tag.gif)\n\n**tag** is a lightweight wrapper around **[ag](https://github.com/ggreer/the_silver_searcher)** and **[ripgrep](https://github.com/BurntSushi/ripgrep)** that generates shell aliases for your search matches. tag is a very fast Golang reimagining of [sack](https://github.com/sampson-chen/sack).\n\ntag supports `ag` and `ripgrep (rg)`. There are no plans to support ack or grep. If you'd like to add support for more search backends, I encourage you to contribute!\n\n## Why should I use tag?\n\ntag makes it easy to _immediately_ jump to a search match in your favorite editor. It eliminates the tedious task of typing `vim foo/bar/baz.qux +42` to jump to a match by automatically generating these commands for you as shell aliases.\n\nInside vim, [vim-grepper](https://github.com/mhinz/vim-grepper) or [ag.vim](https://github.com/rking/ag.vim) is probably the way to go. Outside vim (or inside a Neovim `:terminal`), tag is your best friend.\n\nFinally, tag is unobtrusive. It should behave exactly like `ag` or `ripgrep` under most circumstances.\n\n## Performance Benchmarks\n\ntag processes ag's output on-the-fly with Golang using pipes so the performance loss is neglible. In other words, **tag is just as fast as ag**!\n\n```\n$ cd ~/github/torvalds/linux\n$ time ( for _ in {1..10}; do  ag EXPORT_SYMBOL_GPL \u003e/dev/null 2\u003e\u00261; done )\n16.66s user 16.54s system 347% cpu 9.562 total\n$ time ( for _ in {1..10}; do tag EXPORT_SYMBOL_GPL \u003e/dev/null 2\u003e\u00261; done )\n16.84s user 16.90s system 356% cpu 9.454 total\n```\n\n# Installation\n\n1. Update to the latest versions of [`ag`](https://github.com/ggreer/the_silver_searcher) or [`ripgrep`](https://github.com/BurntSushi/ripgrep). `ag` in particular must be version `\u003e= 0.25.0`.\n\n1. Install the `tag` binary using one of the following methods.\n    - Homebrew (OSX)\n      ```\n      $ brew tap aykamko/tag-ag\n      $ brew install tag-ag\n      ```\n\n    - AUR (Arch Linux)\n\n      Using your favorite [AUR helper](https://wiki.archlinux.org/index.php/AUR_helpers), install the [tag-ag AUR package](https://aur.archlinux.org/packages/tag-ag/) like this:\n      ```\n      $ aura -A tag-ag\n      ```\n\n    - [Download a compressed binary for your platform](https://github.com/aykamko/tag/releases)\n\n    - Developers and other platforms\n      ```\n      $ go get -u github.com/aykamko/tag/...\n      $ go install github.com/aykamko/tag\n      ```\n\n1. By default, `tag` uses `ag` as its search backend. To use `ripgrep` instead, set the environment variable `TAG_SEARCH_PROG=rg`. (To persist this setting, put it in your `bashrc`/`zshrc`.)\n\n1. Since tag generates a file with command aliases for your shell, you'll have to drop the following in your `bashrc`/`zshrc` to actually pick up those aliases.\n    - `bash`\n      ```bash\n      if hash ag 2\u003e/dev/null; then\n        export TAG_SEARCH_PROG=ag  # replace with rg for ripgrep\n        tag() { command tag \"$@\"; source ${TAG_ALIAS_FILE:-/tmp/tag_aliases} 2\u003e/dev/null; }\n        alias ag=tag  # replace with rg for ripgrep\n      fi\n      ```\n\n    - `zsh`\n      ```zsh\n      if (( $+commands[tag] )); then\n        export TAG_SEARCH_PROG=ag  # replace with rg for ripgrep\n        tag() { command tag \"$@\"; source ${TAG_ALIAS_FILE:-/tmp/tag_aliases} 2\u003e/dev/null }\n        alias ag=tag  # replace with rg for ripgrep\n      fi\n      ```\n\n    - `fish - ~/.config/fish/functions/tag.fish`\n      ```fish\n      function tag\n          set -x TAG_SEARCH_PROG ag  # replace with rg for ripgrep\n          set -q TAG_ALIAS_FILE; or set -l TAG_ALIAS_FILE /tmp/tag_aliases\n          command tag $argv; and source $TAG_ALIAS_FILE ^/dev/null\n          alias ag tag  # replace with rg for ripgrep\n      end\n      ```\n\n# Configuration\n\n`tag` exposes the following configuration options via environment variables:\n\n- `TAG_SEARCH_PROG`\n  - Determines whether to use `ag` or `ripgrep` as the search backend. Must be one of `ag` or `rg`.\n  - Default: `ag`\n- `TAG_ALIAS_FILE`\n  - Path where shortcut alias file will be generated.\n  - Default: `/tmp/tag_aliases`\n- `TAG_ALIAS_PREFIX`\n  - Prefix for alias commands, e.g. the `e` in generated alias `e42`.\n  - Default: `e`\n- `TAG_CMD_FMT_STRING`\n  - Format string for alias commands. Must contain `{{.Filename}}`, `{{.LineNumber}}`, and `{{.ColumnNumber}}` for proper substitution.\n  - Default: `vim -c 'call cursor({{.LineNumber}}, {{.ColumnNumber}})' '{{.Filename}}'`\n\n# License\n\n[MIT](LICENSE)\n\n# Author\n\n[aykamko](https://github.com/aykamko)\n","funding_links":[],"categories":["Go","For Developers"],"sub_categories":["Directory Navigation"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faykamko%2Ftag","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faykamko%2Ftag","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faykamko%2Ftag/lists"}