johnlindquist / johnlindquist/mdflow

Feature Request: Default Command in Configuration

Open
#25 0 comments 0 reactions 0 assignees View on GitHub

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:

  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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.