| Crates.io | mkfiler |
| lib.rs | mkfiler |
| version | 1.0.3 |
| created_at | 2025-12-01 11:14:13.055625+00 |
| updated_at | 2025-12-09 10:50:40.846052+00 |
| description | Cross-platform file creation utility with GNTP/Growl integration |
| homepage | https://github.com/cumulus13/mkfiler |
| repository | https://github.com/cumulus13/mkfiler |
| max_upload_size | |
| id | 1959649 |
| size | 75,101 |
A powerful command-line utility for creating blank files with support for brace expansion, automatic directory creation, desktop notifications, and clipboard integration.
cargo install mkfiler
mkfile [OPTIONS] FILE [FILE ...]
mkfile test.txt
mkfile file1.txt file2.rs file3.js
mkfile src/main.rs tests/test_main.rs
# Creates: src/ and tests/ directories automatically
mkfile test/{a,b,c}.txt
# Creates: test/a.txt, test/b.txt, test/c.txt
mkfile dotenv{core.rs,utils.rs}
# Creates: dotenv/ dotenv/core.rs, dotenv/utils.rs
mkfile src{main.rs, utils.rs config.rs}
# Creates: src/main.rs, src/utils.rs, src/config.rs
# Note: Handles both comma and space separation inside braces
mkfile src/{main.rs,utils.rs} tests/{test_main.rs} README.md setup.rs requirements.txt
mkfile mypackage/{core.rs,exceptions.rs,utils.rs} tests/{test_core.rs} setup.rs Cargo.toml README.md LICENSE requirements.txt .gitignore
Standard format (recommended):
mkfile dir/{file1,file2,file3}
Directory prefix (no slash):
mkfile dir{file1,file2,file3}
# Automatically adds '/' → dir/file1, dir/file2, dir/file3
With spaces (flexible):
mkfile dir{file1, file2, file3}
mkfile dir{file1 file2 file3}
# Both work! Splits by comma AND spaces
With file extensions:
mkfile src/{main,utils,config}.rs
# Creates: src/main.rs, src/utils.rs, src/config.rs
{} can be separated by:
{a,b,c}{a b c}{a, b, c} or {a, b c}/ or \, it's treated as a directory name--versionShow version information
mkfile --version
--debugEnable detailed error messages and stack traces
mkfile --debug file1.txt file2.txt
--helpShow help message with examples
mkfile --help
✓ File created: "C:\PROJECTS\myproject\src\main.rs"
✓ File created: "C:\PROJECTS\myproject\src\utils.rs"
2/2 file(s) created successfully
✓ File created: "valid.txt"
✗ Error creating file "invalid/path/file.txt": [Errno 13] Permission denied
1/2 file(s) created successfully
The script automatically creates all parent directories:
mkfile deep/nested/path/to/file.txt
# Creates: deep/ → deep/nested/ → deep/nested/path/ → deep/nested/path/to/
After creating each file, its absolute path is automatically copied to your clipboard (requires clipboard module).
If Growl is installed and running, you'll receive desktop notifications for each file created.
Note: The "Could not initialize Growl" warning is normal if Growl is not running. The script continues to work perfectly without it.
This is normal and harmless. It means Growl notification service isn't running. The script works fine without it.
To suppress this warning, you can:
If you get permission errors:
--debug flag for more detailsCheck your brace expansion syntax:
# WRONG - No directory separator
mkfile mydir{file1,file2} # Creates: mydir/file1, mydir/file2 ✓
# If you want nested directories, use /
mkfile mydir/{subdir/file1,file2} # Creates: mydir/subdir/file1, mydir/file2
Use quotes for files with spaces:
mkfile "my file.txt"
Combine with other commands:
mkfile src/{main,utils}.rs && code src/main.rs
Create project templates:
# Save as a shell script
mkfile project/{src,tests,docs}/{__init__.rs} README.md setup.rs
Verify with tree command:
mkfile test/{a,b,c}.txt && tree test/
Free to use and modify.
Feel free to submit issues and enhancement requests!
Quick Reference:
# Single file
mkfile file.txt
# Multiple files
mkfile file1 file2 file3
# With directories
mkfile src/main.rs tests/test.rs
# Brace expansion
mkfile src/{main,utils,config}.rs
# Complex structure
mkfile mypackage/{__init__,core,utils}.rs tests/{__init__,test_core}.rs README.md