feat: add rtk rgai command for semantic code search#124
Open
heAdz0r wants to merge 1 commit intortk-ai:masterfrom
Open
feat: add rtk rgai command for semantic code search#124heAdz0r wants to merge 1 commit intortk-ai:masterfrom
heAdz0r wants to merge 1 commit intortk-ai:masterfrom
Conversation
Rust-native semantic search that scores files and lines by term relevance, symbol definitions, and path matching. No external dependencies (no grepai/embeddings required). Features: - Natural-language multi-word queries: rtk rgai "auth token refresh" - File scoring with symbol definition boost (+2.5) and comment penalty - Stop word removal + basic stemming for better recall - Compact and JSON output modes - File type filtering (--file-type ts/py/rust/etc.) - gitignore-aware traversal via `ignore` crate - Binary and large file skipping - Backward-compat: trailing path token auto-detection Includes 8 unit tests (5 in rgai_cmd, 3 for arg normalization).
This was referenced Feb 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Extracted from #118 per reviewer feedback. This is the actual feature implementation — the command that #118's docs/hooks referenced but didn't include.
rtk rgaiis a Rust-native semantic search that scores files by term relevance without requiring external embedding services.Usage
How it works
Token savings
Changes
src/rgai_cmd.rs: 789 lines — full search implementation with scoring, ranking, output formattingsrc/main.rs:Commands::Rgaivariant, match arm,normalize_rgai_args()for backward-compat path detectionTest plan
cargo test rgai— 8 tests pass (5 unit + 3 arg normalization)cargo test— 321 total tests passcargo fmt --all --check— cleancargo clippy --all-targets— no new warningsrtk rgai "token tracking" -p .returns ranked results from this repo