The core engine for t-rush and t-rush-mcp.
Provides the shared scanning, fuzzy search, state persistence, and streak tracking logic used across the t-rush ecosystem.
trush-core contains the extracted logic from the original t-rush CLI. It ensures that both the CLI (for humans) and the MCP server (for AI agents) share the exact same detection engine, file parsing, streak tracking, and local JSON store.
@devds1989/trush-core ← scanning, fuzzy search, streak state, JSON store
├── @devds1989/t-rush (CLI interface, depends on trush-core)
└── @devds1989/t-rush-mcp (MCP server, depends on trush-core)
By relying on this shared core:
- A bug fix in detection fixes both interfaces simultaneously.
- Resolving a TODO via the MCP server updates the same streak state the CLI reads.
- Streak and stats state remains perfectly synchronized locally.
- Smart scanner: Recursively finds
TODO,FIXME,BUG,HACK, andXXXacross all common languages. - Git integration: Automatically runs
git blameon detected comments for author attribution. - Fuzzy Search: Built-in
fuse.jsindex to search across scanned TODOs by intent or file. - Validator: Verifies if a comment was actually resolved or if it's still present in the file.
- Streak & State Management: Handles the local atomic JSON store (
~/.t-rush/data.json), updating stats, runs, and streaks.
npm i @devds1989/trush-coreScans the given directory (ignoring binary files, node_modules, and .gitignore paths) and returns an array of detected items.
import { scanRepo } from "@devds1989/trush-core";
const todos = await scanRepo("/path/to/repo");
console.log(todos[0].author);Performs a fuzzy search across a list of items.
import { searchTodos } from "@devds1989/trush-core";
const results = searchTodos(todos, "auth race condition");Checks whether a specific comment was resolved by checking the file around the specific line.
Methods to interact with the local JSON data store:
loadData()/saveData(data)incrementStreak(type)/resetStreak()getStreak()/getStats()addRun(record)
Detects markers in all common comment styles:
| Style | Languages |
|---|---|
// |
JavaScript, TypeScript, Go, Rust, C, C++, Java, Kotlin, Swift, Dart |
# |
Python, Ruby, Shell, YAML, R, Perl, Elixir, Crystal |
-- |
SQL, Lua, Haskell, Ada |
% |
Erlang, LaTeX |
; |
Lisp, Clojure, Assembly |
* |
Inside /* */ block comments |
Contributions are welcome! If you are improving the scanning logic or state management, make your changes here so both t-rush and t-rush-mcp can benefit.
git clone https://github.com/DevDs1989/trush-core
cd trush-core
npm install
npm run buildMIT © Dev