[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-5457":3},{"id":4,"name":5,"fullName":6,"owner":5,"repo":5,"description":7,"homepage":8,"htmlUrl":9,"language":10,"languages":9,"totalLinesOfCode":9,"stars":11,"forks":12,"watchers":13,"openIssues":14,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":16,"stars7d":17,"stars30d":18,"stars90d":15,"forks30d":15,"starsTrendScore":19,"compositeScore":20,"rankGlobal":9,"rankLanguage":9,"license":21,"archived":22,"fork":22,"defaultBranch":23,"hasWiki":24,"hasPages":24,"topics":25,"createdAt":9,"pushedAt":9,"updatedAt":41,"readmeContent":42,"aiSummary":43,"trendingCount":15,"starSnapshotCount":15,"syncStatus":44,"lastSyncTime":45,"discoverSource":46},5457,"ast-grep","ast-grep\u002Fast-grep","⚡A CLI tool for code structural search, lint and rewriting. Written in Rust","https:\u002F\u002Fast-grep.github.io\u002F",null,"Rust",14461,394,37,35,0,6,147,696,51,42.79,"MIT License",false,"main",true,[26,27,28,29,30,31,32,33,34,35,36,37,38,39,40],"ast","babel","codemod","codereview","command-line","command-line-tool","grep","linter","refactoring","rust","search","static-analysis","structural-search","tree-sitter","typescript","2026-06-12 02:01:10","\u003Cp align=center>\n  \u003Cimg src=\"https:\u002F\u002Fast-grep.github.io\u002Flogo.svg\" alt=\"ast-grep\"\u002F>\n\u003C\u002Fp>\n\n\u003Cp align=\"center\">\n   \u003Cimg src=\"https:\u002F\u002Fgithub.com\u002Fast-grep\u002Fast-grep\u002Factions\u002Fworkflows\u002Fcoverage.yaml\u002Fbadge.svg\" alt=\"coverage badge\"\u002F>\n   \u003Ca href=\"https:\u002F\u002Fapp.codecov.io\u002Fgh\u002Fast-grep\u002Fast-grep\">\u003Cimg src=\"https:\u002F\u002Fcodecov.io\u002Fgh\u002Fast-grep\u002Fast-grep\u002Fbranch\u002Fmain\u002Fgraph\u002Fbadge.svg?token=37VX8H2EWV\"\u002F>\u003C\u002Fa>\n   \u003Ca href=\"https:\u002F\u002Fdiscord.gg\u002F4YZjf6htSQ\" target=\"_blank\">\u003Cimg alt=\"Discord\" src=\"https:\u002F\u002Fimg.shields.io\u002Fdiscord\u002F1107749847722889217?label=Discord\">\u003C\u002Fa>\n   \u003Ca href=\"https:\u002F\u002Frepology.org\u002Fproject\u002Fast-grep\u002Fversions\" target=\"_blank\">\u003Cimg alt=\"Repology\" src=\"https:\u002F\u002Frepology.org\u002Fbadge\u002Ftiny-repos\u002Fast-grep.svg\">\u003C\u002Fa>\n   \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fast-grep\u002Fast-grep\u002Fstargazers\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Fstars\u002Fast-grep\u002Fast-grep?style=social\" alt=\"Badge\">\u003C\u002Fa>\n   \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fast-grep\u002Fast-grep\u002Fnetwork\u002Fmembers\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Fforks\u002Fast-grep\u002Fast-grep?style=social\" alt=\"Badge\">\u003C\u002Fa>\n   \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fsponsors\u002FHerringtonDarkholme\">\u003Cimg alt=\"GitHub Sponsors\" src=\"https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Fsponsors\u002FHerringtonDarkholme?style=social\">\u003C\u002Fa>\n   \u003Ca href=\"https:\u002F\u002Fgurubase.io\u002Fg\u002Fast-grep\">\u003Cimg alt=\"Gurubase\" src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FGurubase-Ask%20ast--grep%20Guru-006BFF\">\u003C\u002Fa>\n\u003C\u002Fp>\n\n\n## ast-grep(sg)\n\nast-grep(sg) is a CLI tool for code structural search, lint, and rewriting.\n\n## Introduction\nast-grep is an [abstract syntax tree](https:\u002F\u002Fdev.to\u002Fbalapriya\u002Fabstract-syntax-tree-ast-explained-in-plain-english-1h38) based tool to search code by pattern code. Think of it as your old-friend [`grep`](https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FGrep#:~:text=grep%20is%20a%20command%2Dline,which%20has%20the%20same%20effect.), but matching AST nodes instead of text.\nYou can write patterns as if you are writing ordinary code. It will match all code that has the same syntactical structure.\nYou can use `$` sign + upper case letters as a [wildcard](https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FWildcard_character), e.g. `$MATCH`, to match any single AST node. Think of it as [regular expression dot](https:\u002F\u002Fregexone.com\u002Flesson\u002Fwildcards_dot) `.`, except it is not textual.\n\nTry the [online playground](https:\u002F\u002Fast-grep.github.io\u002Fplayground.html) for a taste!\n\n## Screenshot\n![demo](https:\u002F\u002Fast-grep.github.io\u002Fimage\u002Fsearch-replace.png)\n\nSee more screenshots on the [website](https:\u002F\u002Fast-grep.github.io\u002F).\n\n## Installation\nYou can install it from [npm](https:\u002F\u002Fdocs.npmjs.com\u002Fdownloading-and-installing-node-js-and-npm), [pip](https:\u002F\u002Fpypi.org\u002F), [cargo](https:\u002F\u002Fdoc.rust-lang.org\u002Fcargo\u002Fgetting-started\u002Finstallation.html),  [cargo-binstall](https:\u002F\u002Fgithub.com\u002Fcargo-bins\u002Fcargo-binstall), [homebrew](https:\u002F\u002Fbrew.sh\u002F), [scoop](https:\u002F\u002Fscoop.sh\u002F), [mise](https:\u002F\u002Fgithub.com\u002Fjdx\u002Fmise) or [MacPorts](https:\u002F\u002Fwww.macports.org)!\n\n```bash\nnpm install --global @ast-grep\u002Fcli\n# `pnpm approve-builds` may be needed\npip install ast-grep-cli\nbrew install ast-grep\n```\n\n\n\u003Cdetails>\n\u003Csummary>Click for more installation methods\u003C\u002Fsummary>\n\n```bash\ncargo install ast-grep --locked\ncargo binstall ast-grep\n\n# install via scoop, thank @brian6932\nscoop install main\u002Fast-grep\n\n# install via MacPorts\nsudo port install ast-grep\n\n# try ast-grep in nix-shell\nnix-shell -p ast-grep\n\n# try ast-grep with mise\nmise use -g ast-grep\n```\n\u003C\u002Fdetails>\n\nOr you can build ast-grep from source. You need to install rustup, clone the repository and then\n```bash\ncargo install --path .\u002Fcrates\u002Fcli --locked\n```\n[Packages](https:\u002F\u002Frepology.org\u002Fproject\u002Fast-grep\u002Fversions) are available on other platforms too.\n\n\n## Command line usage example\n\nast-grep has following form.\n```\nast-grep --pattern 'var code = $PATTERN' --rewrite 'let code = new $PATTERN' --lang ts\n```\n\n### Example\n\n* [Rewrite code in null coalescing operator](https:\u002F\u002Ftwitter.com\u002FHchan_mgn\u002Fstatus\u002F1547061516993699841?s=20&t=ldDoj4U2nq-FRKQkU5GWXA)\n\n```bash\nast-grep -p '$A && $A()' -l ts -r '$A?.()'\n```\n\n* [Rewrite](https:\u002F\u002Ftwitter.com\u002FHchan_mgn\u002Fstatus\u002F1561802312846278657) [Zodios](https:\u002F\u002Fgithub.com\u002Fecyrbe\u002Fzodios#migrate-to-v8)\n```bash\nast-grep -p 'new Zodios($URL,  $CONF as const,)' -l ts -r 'new Zodios($URL, $CONF)' -i\n```\n\n* [Implement eslint rule using YAML.](https:\u002F\u002Ftwitter.com\u002FHchan_mgn\u002Fstatus\u002F1560108625460355073)\n\n\n## Sponsor\n![Sponsors](https:\u002F\u002Fraw.githubusercontent.com\u002FHerringtonDarkholme\u002Fsponsors\u002Fmain\u002Fsponsorkit\u002Fsponsors.svg)\n\nIf you find ast-grep interesting and useful for your work, please [buy me a coffee](https:\u002F\u002Fgithub.com\u002Fsponsors\u002FHerringtonDarkholme)\nso I can spend more time on the project!\n\n## Feature Highlight\n\nast-grep's core is an algorithm to search and replace code based on abstract syntax tree produced by tree-sitter.\nIt can help you to do lightweight static analysis and massive scale code manipulation in an intuitive way.\n\nKey highlights:\n\n* An intuitive pattern to find and replace AST.\nast-grep's pattern looks like ordinary code you would write every day (you could say the pattern is isomorphic to code).\n\n* jQuery like API for AST traversal and manipulation.\n\n* YAML configuration to write new linting rules or code modification.\n\n* Written in compiled language, with tree-sitter based parsing and utilizing multiple cores.\n\n* Beautiful command line interface :)\n\nast-grep's vision is to democratize abstract syntax tree magic and to liberate one from cumbersome AST programming!\n\n* If you are an open-source library author, ast-grep can help your library users adopt breaking changes more easily.\n* if you are a tech lead in your team, ast-grep can help you enforce code best practice tailored to your business need.\n* If you are a security researcher, ast-grep can help you write rules much faster.\n","ast-grep 是一个基于抽象语法树（AST）的命令行工具，用于代码结构搜索、检查和重写。它通过匹配代码的语法结构而非纯文本内容来实现功能，支持使用类似于正则表达式的通配符进行模式匹配。该工具利用 Rust 语言编写，具备高性能和跨平台特性，适用于多种编程语言。ast-grep 特别适合需要对大型代码库进行自动化重构、代码审查或静态分析的场景，帮助开发者快速定位并修改具有特定结构的代码片段。",2,"2026-06-11 03:03:26","top_language"]