Skip to content

Feature Request: Default Command in Configuration #25

Description

@sanathusk

Feature Request: Default Command in Configuration

Summary

Add support for specifying a default command in the mdflow configuration file that would be used when neither the --_command flag nor filename pattern provides a command.

Current Behavior

Command resolution currently only supports two methods:

  1. CLI flag: --_command or -_c
  2. Filename pattern: task.COMMAND.md

If neither provides a command, mdflow throws an error.

Proposed Changes

1. Configuration Schema Update

Add a new defaultCommand field to the global configuration:

# ~/.mdflow/config.yaml
defaultCommand: opencode  # New field
commands:
  claude:
    model: sonnet
  copilot:
    silent: true

2. Command Resolution Priority Update

Update command resolution to three levels:

Command resolution:
  1. --_command flag (e.g., md task.md --_command claude)
  2. Filename pattern (e.g., task.claude.md → claude)
  3. Default command from config (e.g., defaultCommand: opencode)

Benefits

  1. Improved UX: Users can set their preferred command once and use generic filenames
  2. Consistency: Aligns with mdflow's configuration-first approach
  3. Backward Compatible: No breaking changes to existing workflows
  4. Flexible: Can be overridden per-project or per-file

Usage Examples

# With defaultCommand: opencode in config
md task.md              # Uses opencode
md review.md            # Uses opencode
md task.claude.md       # Still uses claude (filename takes priority)
md task.md --_command gemini  # Still uses gemini (flag takes priority)

Notes

The default command would be loaded from the global config (~/.mdflow/config.yaml) and could be overridden by project-level configs, maintaining the existing precedence cascade.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions