Skip to content

feat: add non-interactive mode for -a flag#7

Open
i-am-fran wants to merge 1 commit intobasilioss:mainfrom
i-am-fran:feature/non-interactive-add
Open

feat: add non-interactive mode for -a flag#7
i-am-fran wants to merge 1 commit intobasilioss:mainfrom
i-am-fran:feature/non-interactive-add

Conversation

@i-am-fran
Copy link
Copy Markdown

Summary

This PR extends the -a/--add-inbox flag to accept an optional task argument, enabling non-interactive task addition from the command line.

Before: -a only triggered interactive mode
After: -a "task text" adds directly, -a alone still opens interactive mode

Motivation

When quickly capturing tasks from the terminal, opening an interactive prompt adds friction. This is especially useful for:

  • Adding tasks from scripts or aliases
  • Quick capture without interrupting workflow
  • Integrating with other CLI tools (e.g., mdt -a "$(pbpaste)")

Usage

# Non-interactive (new)
mdt -a "Buy milk"
# Output: Added: [ ] Buy milk

# Interactive (unchanged)
mdt -a

Works with other flags:

mdt -a "Project task" -i ~/projects/myproject/TODO.md

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

Backward Compatibility

Fully backward compatible. Existing usage of mdt -a (without argument) works exactly as before.

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>
Copilot AI review requested due to automatic review settings January 26, 2026 14:37
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-inbox flag 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants