mf is a cross-platform CLI tool for creating files from the command line — like touch but with clipboard, 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
# Write clipboard content to file
mf output.txt
# Save clipboard image to file
mf screenshot.png -c
# Read file content into clipboard
mf -i source.txt
# Preview clipboard content
mf -p
# Create multiple files at once
mf a.txt b.txt c.txt
# Create with specific encoding
mf script.bat --encoding gbk
# Force overwrite (creates .bak backup)
mf report.md -f
# Don't overwrite existing files
mf notes.md --no-clobber
# Rename new file on conflict
mf data.csv --conflict rename
# Set max size limit (MB)
mf large.txt --max-size 10
# Set language
mf --lang zh-CN output.txt
# Quiet mode (no output)
mf -q output.txt
# Verbose mode
mf -v output.txtmf --help # General help
mf --help-encoding # Encoding reference
mf --examples # Usage examples
mf --help-config # Config file reference- Create empty files —
mf <path>works liketouch - Clipboard write — writes clipboard text/image to file (default action)
- Clipboard image save —
-csaves clipboard images as PNG/JPEG/BMP/GIF/ICO/WEBP - Clipboard preview —
-ppreviews clipboard content with type detection - File to clipboard —
-i/--from-filereads file content into clipboard - Batch creation — create any number of files in one command
- Encoding control — automatic per-extension defaults, manual
--encoding, auto-detection viachardetng - Encoding conversion — supports utf-8, utf-8-bom, utf-16le, gbk with full round-trip conversion
- Content type detection — auto-detects 20+ types (JSON, XML, HTML, Python, Rust, etc.), warns on extension mismatch
- Interactive confirmation — prompts to adjust extension when type doesn't match
- Conflict resolution —
--conflictwith skip/rename/append/overwrite, interactive prompt by default - Force overwrite —
-f/--forceoverwrites existing file with.bakbackup - No-clobber —
--no-clobberskips existing files silently - Append mode —
--appendappends clipboard content to existing file - Max size limit —
--max-size <MB>rejects content exceeding the limit - Quiet mode —
-q/--quietsuppresses all output - Verbose mode —
-v/--verboseshows encoding and action details - Signal handling — graceful exit on Ctrl+C with cleanup
- Atomic writes — writes to temp file first, then renames; no data loss on failure
- Cross-platform — Windows, Linux, macOS
mf auto-detects your system language and supports 6 locales:
| Code | Language |
|---|---|
en |
English (default fallback) |
zh-CN |
Simplified Chinese |
zh-TW |
Traditional Chinese |
de |
German |
ja |
Japanese |
ko |
Korean |
Override with --lang:
mf --lang de output.txt
mf --lang ja --help-encodingMIT