Durai is a command-line utility designed to scan codebases for specific keywords in comments (like TODO and FIXME) and consolidate them into grouped lists.
For Non-Haxe Users (Standalone):
- Download the latest pre-compiled binary (e.g.,
durai.exeordurai.n) from the GitHub Releases page. - Place the file in a directory of your choice.
- (Optional) Add that directory to your system's
PATHto run theduraicommand globally.
For Haxe Users:
haxelib install duraiOnce installed, you can run it from anywhere using:
haxelib run durai. You can view it on Haxelib.
To update Durai to the latest version via haxelib, run:
haxelib update duraiIf you built the project from source, pull the latest changes from the repository and rebuild the executable:
git pull
haxe build.hxmlThe Durai CLI provides several commands to manage your keywords and run scans.
To run the utility and scan the current directory (and its subdirectories) for keywords:
durai(or durai run)
(If you installed via haxelib, use haxelib run durai)
The utility will recursively scan the current directory and its subdirectories, extracting any comments containing the tracked keywords (e.g., TODO, FIXME) and printing them to the console grouped by keyword.
Example Output:
TODO
src/Main.hx:12 refactor this to use the new API
src/utils/Parser.hx:45 add support for edge cases
FIXME
src/Durai.hx:112 memory leak when loading large files
For a web based output you'll notice that a directory called durai/ has been created within
your project. Inside is an index.html file with some simple tables showing your results.
You can dynamically add or remove keywords that Durai tracks for your project without needing to modify the source code. These are saved in a local .durai.json file.
Add a keyword:
durai add <keyword>Example: durai add BUG
Remove a keyword:
durai remove <keyword>Example: durai remove BUG
List current keywords:
durai listDurai is language-agnostic in its approach to parsing comments, but is specifically optimized to target the following languages out of the box:
- Ruby (
.rb) - Python (
.py) - C/C++ (
.c,.cpp,.h,.hpp,.cc,.cxx) - Go (
.go) - Rust (
.rs) - JavaScript / TypeScript (
.js,.ts,.jsx,.tsx) - Haxe (
.hx)
By default, Durai searches your codebase comments for the following keywords:
TODOFIXMENOTEBUG
Any text following these keywords on the same line (including separators like : or -) will be cleanly extracted and included in the final grouped output.
If you want to track additional annotations (such as NOTE, BUG, or HACK), you can easily add them using the CLI:
durai add BUGThis project uses utest for unit testing. To run the test suite, ensure you have the library installed:
haxelib install utestThen, execute the tests using the provided Haxe build file:
haxe test.hxml
