feat: add non-interactive mode for -a flag#7
Open
i-am-fran wants to merge 1 commit intobasilioss:mainfrom
Open
feat: add non-interactive mode for -a flag#7i-am-fran wants to merge 1 commit intobasilioss:mainfrom
i-am-fran wants to merge 1 commit intobasilioss:mainfrom
Conversation
Extends the -a/--add-inbox flag to accept an optional task argument, enabling non-interactive task addition from the command line. Usage: mdt -a "task text" # adds directly, prints confirmation mdt -a # opens interactive mode (unchanged) Changes: - Modified parse_commandline() to capture optional argument after -a - Added quick_add_todo() function for non-interactive append - Creates TODO.md with header if it doesn't exist - Prints confirmation message on success - Updated help text Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR adds non-interactive task addition capability to the -a/--add-inbox flag, allowing users to add tasks directly from the command line without entering interactive mode. The implementation maintains backward compatibility while enabling quick task capture workflows.
Changes:
- Enhanced
-a/--add-inboxflag to accept an optional task argument for non-interactive addition - Added
quick_add_todo()function that appends tasks directly to the inbox file - Updated help text to document the new optional argument syntax
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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
This PR extends the
-a/--add-inboxflag to accept an optional task argument, enabling non-interactive task addition from the command line.Before:
-aonly triggered interactive modeAfter:
-a "task text"adds directly,-aalone still opens interactive modeMotivation
When quickly capturing tasks from the terminal, opening an interactive prompt adds friction. This is especially useful for:
mdt -a "$(pbpaste)")Usage
Works with other flags:
Changes
parse_commandline()to capture optional argument after-aquick_add_todo()function for non-interactive appendTODO.mdwith header if it doesn't existBackward Compatibility
Fully backward compatible. Existing usage of
mdt -a(without argument) works exactly as before.