johnlindquist / johnlindquist/mdflow
Feature Request: Default Command in Configuration
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 604
- Forks
- 43
- PR merge metrics
- No merged PRs in 30d
Description
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:
- CLI flag:
--_commandor-_c - 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
- Improved UX: Users can set their preferred command once and use generic filenames
- Consistency: Aligns with mdflow's configuration-first approach
- Backward Compatible: No breaking changes to existing workflows
- 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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the existing command resolution for the --_command flag and filename patterns, then inspect how the global and project configuration cascade is loaded. Done means defaultCommand is used only when the flag and filename provide no command, while preserving the documented priority and existing behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- cli, tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100