Ephemeral File Overlay with FUSE
Mirage allows you to dynamically overlay file content at runtime using FUSE, without modifying the original file.
- Static Content Replacement: Replace file content with a fixed string.
- Dynamic Content Execution: Generate file content by running a shell command.
- Pattern Replacement: Replace patterns in the original content.
- Command-based Replacement: Replace patterns using command output.
- Rust (for building Mirage)
- FUSE (Filesystem in Userspace)
- Linux:
- Ubuntu/Debian:
sudo apt-get install fuse - Arch Linux:
sudo pacman -S fuse - Fedora:
sudo dnf install fuse
- Ubuntu/Debian:
- macOS:
brew install macfuse
- Linux:
cargo install --path .mirage <file_path> [OPTIONS]-
--content <STRING>
Replace the file's content with the provided string.Example:
mirage /path/to/file --content "This is fake content!" -
--exec <COMMAND>
Use the output of a command as the file content.Example:
mirage /path/to/file --exec "tr a-z A-Z" -
--replace-regex <PATTERN=REPLACEMENT>
Replace all occurrences ofPATTERNwithREPLACEMENTin the file content. Can be used multiple times.Example:
mirage /path/to/file --replace-regex "foo=bar" --replace-regex "baz=qux"
-
--replace-exec <PATTERN=COMMAND>
Replace occurrences ofPATTERNby runningCOMMAND. Can be used multiple times.Example:
mirage /path/to/file --replace-exec "DATE=date +%Y-%m-%d"