[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-5836":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":17,"stars7d":18,"stars30d":19,"stars90d":16,"forks30d":16,"starsTrendScore":20,"compositeScore":21,"rankGlobal":10,"rankLanguage":10,"license":22,"archived":23,"fork":23,"defaultBranch":24,"hasWiki":23,"hasPages":25,"topics":26,"createdAt":10,"pushedAt":10,"updatedAt":35,"readmeContent":36,"aiSummary":37,"trendingCount":16,"starSnapshotCount":16,"syncStatus":38,"lastSyncTime":39,"discoverSource":40},5836,"gritql","biomejs\u002Fgritql","biomejs","GritQL is a query language for searching, linting, and modifying code.","https:\u002F\u002Fdocs.grit.io\u002F",null,"Rust",4521,122,10,114,0,1,5,27,3,28.27,"MIT License",false,"main",true,[27,28,29,30,31,32,33,34],"ast","codemod","javascript","linter","refactoring","rust","search","tree-sitter","2026-06-12 02:01:15","\u003Cdiv align=\"center\">\n  \u003Cpicture>\n    \u003Csource media=\"(prefers-color-scheme: dark)\" srcset=\"https:\u002F\u002Fraw.githubusercontent.com\u002Fgetgrit\u002Fgritql\u002Fmain\u002Fassets\u002Fgrit-logo-darkmode.png\">\n    \u003Cimg alt=\"Grit logo\" src=\"https:\u002F\u002Fraw.githubusercontent.com\u002Fgetgrit\u002Fgritql\u002Fmain\u002Fassets\u002Fgrit-logo.png\" width=\"40%\">\n  \u003C\u002Fpicture>\n\u003C\u002Fdiv>\n\n\u003Cbr>\n\n\u003Cdiv align=\"center\">\n\n[![CI Status](https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Factions\u002Fworkflow\u002Fstatus\u002Fgetgrit\u002Fgritql\u002Fmain.yaml)](https:\u002F\u002Fgithub.com\u002Fgetgrit\u002Fgritql\u002Factions\u002Fworkflows\u002Fmain.yaml)\n[![MIT License](https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Flicense\u002Fgetgrit\u002Fgritql)](https:\u002F\u002Fgithub.com\u002Fgetgrit\u002Fgritql\u002Fblob\u002Fmain\u002FLICENSE)\n[![Discord](https:\u002F\u002Fimg.shields.io\u002Fdiscord\u002F1063097320771698699?logo=discord&label=discord)](https:\u002F\u002Fdocs.grit.io\u002Fdiscord)\n\n[Playground](https:\u002F\u002Fapp.grit.io\u002Fstudio) |\n[Tutorial](https:\u002F\u002Fdocs.grit.io\u002Ftutorials\u002Fgritql) |\n[Docs](https:\u002F\u002Fdocs.grit.io\u002Flanguage)\n\n\u003C\u002Fdiv>\n\n\u003Chr>\n\nGritQL is a declarative query language for searching and modifying source code.\n\n- 📖 Start simply without learning AST details: any code snippet is a valid GritQL query\n- ⚡️ Use Rust and query optimization to scale up to 10M+ line repositories\n- 📦 Use Grit's built-in module system to reuse 200+ [standard patterns](https:\u002F\u002Fgithub.com\u002Fgetgrit\u002Fstdlib) or [share your own](https:\u002F\u002Fdocs.grit.io\u002Fguides\u002Fsharing#anchor-publishing-patterns)\n- ♻️ Once you learn GritQL, you can use it to rewrite any [target language](https:\u002F\u002Fdocs.grit.io\u002Flanguage\u002Ftarget-languages): JavaScript\u002FTypeScript, Python, JSON, Java, Terraform, Solidity, CSS, Markdown, YAML, Rust, Go, or SQL\n- 🔧 GritQL makes it easy to include auto-fix rules for faster remediation\n\n## Getting started\n\nRead the [documentation](https:\u002F\u002Fdocs.grit.io\u002Flanguage\u002Foverview), [interactive tutorial](https:\u002F\u002Fdocs.grit.io\u002Ftutorials\u002Fgritql), or run `grit --help`.\n\n### Installation\n\nInstall the Grit CLI:\n\n```sh\ncurl -fsSL https:\u002F\u002Fdocs.grit.io\u002Finstall | bash\n```\n\n### Usage\n\nSearch for all your `console.log` calls by putting the desired pattern in backticks:\n\n```sh\ngrit apply '`console.log($_)`'\n```\n\nReplace `console.log` with `winston.log`, using `=>` to create rewrites:\n\n```sh\ngrit apply '`console.log($msg)` => `winston.log($msg)`'\n```\n\nSave the pattern to a [`grit.yaml`](https:\u002F\u002Fdocs.grit.io\u002Fguides\u002Fconfig) file and exclude test cases in a where clause:\n\n```sh\ncat \u003C\u003C 'EOF' > .grit\u002Fgrit.yaml\npatterns:\n  - name: use_winston\n    level: error\n    body: |\n      `console.log($msg)` => `winston.log($msg)` where {\n        $msg \u003C: not within or { `it($_, $_)`, `test($_, $_)`, `describe($_, $_)` }\n      }\nEOF\ngrit apply use_winston\n```\n\nRun `grit check` to enforce your patterns as [custom lints](https:\u002F\u002Fdocs.grit.io\u002Fguides\u002Fci).\n\n```sh\ngrit check\n```\n\n## Examples\n\n### Remove all `console.log` calls, unless they are inside a try-catch block\n\n```grit\n`console.log($log)` => . where {\n  $log \u003C: not within `try { $_ } catch { $_ }`\n}\n```\n\n### Replace a method call with a new method call\n\n```grit\n`$instance.oldMethod($args)` => `$instance.newMethod($args)` where {\n  $program \u003C: contains `$instance = new TargetClass($_)`\n}\n```\n\n### More examples\n\nMany more examples can be found in the [GritQL standard library](https:\u002F\u002Fgithub.com\u002Fgetgrit\u002Fstdlib\u002Fblob\u002Fmain\u002F.grit\u002Fpatterns\u002F).\n\nPatterns can be combined to create complex queries, including [large refactors](https:\u002F\u002Fgithub.com\u002Fgetgrit\u002Fstdlib\u002Fblob\u002Fmain\u002F.grit\u002Fpatterns\u002Fpython\u002Fopenai.md).\n\n## Why GritQL?\n\nGritQL comes from our experiences with conducting large scale refactors and migrations.\n\nUsually, migrations start with exploratory work to figure out the scope of the problem—often using simple grep searches. These are easy to start with, but most migrations end up accumulating additional requirements like ensuring the right packages are imported and excluding cases which don’t have a viable migration path.\n\nEventually, any complex migration ends up being a full codemod program written with a tool like [jscodeshift](https:\u002F\u002Fgithub.com\u002Ffacebook\u002Fjscodeshift). This comes with its own problems:\n\n- Most of the exploratory work has to be abandoned as you figure out how to represent your original regex search as an AST.\n- Reading\u002Fwriting a codemod requires mentally translating from AST names back to what source code actually looks like.\n- Most frameworks are not composable, so you’re stuck copying patterns back and forth.\n- Performance is often an afterthought, so iterating on a large codemod can be painfully slow.\n- Codemod frameworks are language-specific, so if you’re hopping between multiple languages—or trying to migrate a shared API—you have to learn different frameworks.\n\nGritQL is our attempt to develop a powerful middle ground:\n\n- Exploratory analysis is easy: just put a code snippet in backticks and use `$metavariables` for holes you want to represent.\n- Incrementally add complexity by introducing side conditions with where clauses.\n- Reuse named patterns to avoid rebuilding queries, and use shared patterns from our [standard library](https:\u002F\u002Fgithub.com\u002Fgetgrit\u002Fstdlib) for common tasks like ensuring modules are imported.\n- Written in Rust for maximum performance: rewrite millions of lines of code in seconds.\n\n## Acknowledgements\n\nGritQL uses [tree-sitter](https:\u002F\u002Fgithub.com\u002Ftree-sitter\u002Ftree-sitter) for all language parsers and benefits greatly from the Rust ecosystem.\n\nGritQL is released under the MIT license.\n\n## Contributing\n\nContributions are welcome. To get started, check out the [**contributing guidelines**](.\u002FCONTRIBUTING.md).\n\nYou can also join us on [**Discord**](https:\u002F\u002Fdocs.grit.io\u002Fdiscord).\n","GritQL 是一种用于搜索、检查和修改源代码的声明式查询语言。它通过Rust实现，并利用查询优化技术，能够处理超过1000万行代码的大型代码库。GritQL支持多种目标语言，包括JavaScript\u002FTypeScript、Python、Java等，用户无需深入了解抽象语法树（AST）即可开始使用。此外，GritQL内置了模块系统，允许重用或分享标准模式以提高开发效率，并且可以轻松地定义自动修复规则来加速问题解决过程。此工具非常适合需要大规模代码重构、代码质量提升以及自动化代码审查的场景。",2,"2026-06-11 03:05:09","top_language"]