Install the package globally or per-project via Composer:
composer require johninamillion/todoYou can also link the CLI binary directly:
chmod +x bin/todo- Detects
BUG,FIX,TODO, andTESTannotations in comments. - Filter by:
- keyword (
--keywords) - type (
--bugs,--fixes,--testsand--todos) - user (
--useror--me)
- keyword (
- Git-aware:
- Honors .gitignore by default
- Use your Git username with
--me
- Optional flags:
--fail-on-bugs,--fail-on-fixes--display-time--include-dotfiles,--include-ignored
Scan your current directory for all relevant tags:
./bin/todo| Option | Description |
|---|---|
[path] |
Scan a specific directory (default: current) |
--exclude=DIRS |
Comma-separated list of directories to exclude |
--keywords=... |
Comma-separated list of keywords to match |
--user=USERNAME |
Only show entries assigned to a specific user |
--me |
Use your Git username to filter results |
--bugs |
Only show entries tagged with BUG |
--fixes |
Only show entries tagged with FIX |
--tests |
Only show entries tagged with TEST |
--todos |
Only show entries tagged with TODO |
--display-time |
Show the last modification time for each entry |
--fail-on-bugs |
Return non-zero exit code if any BUGs are found |
--fail-on-fixes |
Return non-zero exit code if any FIXes are found |
--include-dotfiles |
Include hidden files (e.g., .env, .github) |
--include-ignored |
Include files ignored by .gitignore |
Works with line comments:
// BUG @john-doe This is a critical issue.
// FIX @jane-dev Applied hotfix.
// TODO @backend-team Improve validation.
// TEST @qa-user Add coverage for edge case.Also works with block comments:
/**
* BUG @me Something is broken.
* FIX @teammate Refactor needed.
*/Scan with bug-only filter:
./bin/todo --bugsScan with custom keywords and show timestamps:
./bin/todo --keywords=security,performance --display-timeScan only your assigned items (via Git):
./bin/todo --meFail build on any FIX or BUG:
./bin/todo --fail-on-bugs --fail-on-fixesYou may add these scripts for convenience:
{
"scripts": {
"todo": "./bin/todo --display-time",
"todo:me": "./bin/todo --me --display-time"
}
}To analyze your code for potential issues, you can run phpstan:
composer code:analyseTo ensure your code adheres to the coding standards, you can run the php-cs-fixer.
composer code:formatTo run the tests, make sure you have installed phpunit within the dev dependencies and then run:
composer testCheck the Test Coverage:
composer test:coverageThis package is licensed under the MIT License. See the LICENSE file for full details.