FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

lht1969/mf: **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. · GitHub

/ mf Public

Repository files navigation

mf — Make File

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.

Quick Install

cargo install mf

Or build from source:

git clone https://github.com/user/mf.git
cd mf
cargo build --release

Quick Usage

# 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.txt

Help Flags

mf --help              # General help
mf --help-encoding     # Encoding reference
mf --examples          # Usage examples
mf --help-config       # Config file reference

Features

  • Create empty files — mf <path> works like touch
  • Clipboard write — writes clipboard text/image to file (default action)
  • Clipboard image save — -c saves clipboard images as PNG/JPEG/BMP/GIF/ICO/WEBP
  • Clipboard preview — -p previews clipboard content with type detection
  • File to clipboard — -i/--from-file reads file content into clipboard
  • Batch creation — create any number of files in one command
  • Encoding control — automatic per-extension defaults, manual --encoding, auto-detection via chardetng
  • 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 — --conflict with skip/rename/append/overwrite, interactive prompt by default
  • Force overwrite — -f/--force overwrites existing file with .bak backup
  • No-clobber — --no-clobber skips existing files silently
  • Append mode — --append appends clipboard content to existing file
  • Max size limit — --max-size <MB> rejects content exceeding the limit
  • Quiet mode — -q/--quiet suppresses all output
  • Verbose mode — -v/--verbose shows 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

Internationalization

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-encoding

License

MIT

About

**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.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages


Back | FazBrowse Home | New Git URL