https://github.com/vonr/tsfind
Extract code using tree-sitter queries
https://github.com/vonr/tsfind
Last synced: 3 months ago
JSON representation
Extract code using tree-sitter queries
- Host: GitHub
- URL: https://github.com/vonr/tsfind
- Owner: Vonr
- License: mit
- Created: 2024-08-13T09:59:20.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2024-09-14T11:28:59.000Z (10 months ago)
- Last Synced: 2025-02-21T09:45:28.463Z (4 months ago)
- Language: Rust
- Size: 35.2 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# tsfind

Extract code using [tree-sitter](https://tree-sitter.github.io/tree-sitter/) queries.
Inspired by [helixbass/tree-sitter-grep](https://github.com/helixbass/tree-sitter-grep) which reports entire lines instead of just the captures.
Quite WIP, command line interface should be considered unstable - use at your own risk.
# Usage
```
Extract code using tree-sitter queriesUsage: tsfind [OPTIONS] [PATHS]...
Arguments:
[possible values: rust, go, js, ts, tsx, php, php-only]
[PATHS]...Options:
-q, --query The query to find matches for
-Q, --query-file The file containing the query to find matches for
-H, --hidden Recurse into hidden files and directories
-C, --hidden-captures Show captures starting with '_'
-t, --only-text Only report captured text
-l, --list Only report files with matches
-s, --separator Separator for matches. Only useful with --only-text/-t or --list/-l [default: "\n"]
-h, --help Print help
-V, --version Print version
```