@andrewshell/todomd is a CLI tool designed to help you manage @TODO comments in your codebase. It scans your project for @TODO comments, aggregates them into a Markdown file, and provides an optional web interface for viewing and managing them.
Install todomd globally using npm:
npm install -g @andrewshell/todomdThe todomd CLI supports the following commands:
todomd [options] [command] [dir]-V, --versionOutput the version number-h, --helpDisplay help for command
scan [dir]Scan a directory for@TODOcomments and generate aTODO.mdfileserve [dir]Start a web interface to view and manage todos
PORT: Specify the port for theservecommand (default:3000)TODOMD_FILENAME: Change the default file name fromTODO.mdTODOMD_TITLE: Customize the top level heading in the Markdown file (default:TODOs)
@TODO comments can be written in various formats. The tool identifies comments containing @TODO or @TODO: (case-insensitive) and groups lines with matching prefixes.
// @TODO This is a single-line TODO// @TODO Multiple lines
// are no problem./**
* @TODO This also works
* with multiple lines
*/# @TODO This is a single-line TODO in Python
# This line continues the TODO blockIf your project uses a nodemon.json configuration file, todomd will respect the specified watch, ext, and ignore settings to determine which folders and file extensions to scan. For example:
nodemon.json
{
"watch": ["src"],
"ext": "js,jsx",
"ignore": ["data"]
}This configuration instructs todomd to:
- Watch the
srcdirectory - Scan files with the extensions
jsandjsx - Ignore the
datadirectory
- The tool uses the prefix of the
@TODOcomment (e.g.,//,/*) to determine which lines belong to the same comment block. - Lines starting with the same prefix and followed by two spaces are included in the comment block.
Example:
// @TODO This comment has a prefix of two slashes
// This line is part of the same TODO block
// But this one is not included because of a single spaceScans the specified directory (or the current directory if none is specified) for @TODO comments. It generates or updates a TODO.md file in the same directory, listing all identified @TODO comments.
The generated TODO.md includes:
- A bulleted list of
@TODOcomments - Links to the relevant file and lines (formatted for GitHub compatibility)
Starts a local web server to view and manage your @TODO list via a web interface. The TODO.md file is updated automatically as you manage items through the interface.
- Use the
PORTenvironment variable to specify a custom port:PORT=5000 todomd serve
- Use the
TODOMD_FILENAMEenvironment variable to specify a custom filename:TODOMD_FILENAME=MY_TODOS.md todomd serve
# TODOs
- Review user feedback on UI design (added manually without link)
- Fix bug in authentication module [auth.js:45](auth.js#L45)
- Improve error handling in payment gateway [payment.js:88](payment.js#L88)This project is licensed under the MIT License.
Feel free to contribute, report issues, or suggest features on GitHub.
Happy coding!