mf is a cross-platform CLI tool for creating files from the command line — like md for files. It supports clipboard content, encoding detection, content type detection, batch creation, and interactive conflict resolution.
cargo install mfOr build from source:
git clone https://github.com/user/mf.git
cd mf
cargo build --release# Create an empty file
mf config.ini
# Create from clipboard
mf output.txt -c
# Batch create multiple files
mf a.txt b.txt c.txt
# Pipe content from stdin
echo "Hello, World!" | mf hello.txt
# Create with specific encoding
mf script.bat --encoding gbk
# Force overwrite existing file
mf report.md -f
# Create then open in default editor
mf notes.md -o- Create empty files —
mf <path>works liketouchwith extra smarts - Clipboard support —
mf <path> -creads the system clipboard - Batch creation — create any number of files in one command
- Encoding control — automatic per-extension defaults, manual override via
--encoding, auto-detection viachardetng - Content type detection — auto-detects JSON, XML, HTML, Python, JavaScript, SQL, and plain text; warns on extension mismatch
- Conflict resolution — interactive prompts for overwrite/skip/append/rename, plus
--forceand--no-clobber - Pipe support —
echo content | mf <path>reads from stdin - Configuration — TOML config files at project and user level
- Atomic writes — writes to a temp file first, then renames; no data loss on failure
- Cross-platform — Windows, Linux, macOS
mf supports TOML configuration files with three levels of priority:
- Project-level:
.mf/config.tomlin the current directory - User-level:
~/.mfconfig(%USERPROFILE%\.mfconfigon Windows) - Built-in defaults
See the full usage guide for details.
MIT