Yet another integration software with file monitoring.
enma is a file-watching tool that monitors specified files or directories and automatically executes commands or rebuilds and restarts daemons.
It's designed to supercharge your development and automation workflows.
- π Realtime monitoring for directories or files
 - π οΈ Execute build or custom commands on file changes
 - π Hot-reload support with build success detection
 - π¦ Flexible daemon process control with customizable signals (SIGTERM, SIGKILL, etc.)
 - π Supports symlinks
 - π§© Flexible configuration using TOML files
 - π Ignore patterns with 
.enmaignore(.gitignorecompatible syntax) - π§ͺ Ideal for CI/CD and local development
 
go install github.com/magicdrive/enma@latestYou can install enma using homebrew:
brew install magicdrive/tap/enmaAlternatively, you can download a pre-built binary from the Releases page.
enma initThis generates Enma.toml and .enmaignore.
You can specify the mode or config file name:
enma init --mode watch --file ./myconfig.enma.toml
Use this when you want to automate build and daemon restarts.
name = "my-app"
daemon = "./my-app"
build = "go build -o my-app main.go"
watch-dir = ["./cmd", "./internal"]enma hotload --daemon ./my-app --build "go build -o my-app main.go"Executes commands on file changes without restarting daemons.
command = "make test"
watch-dir = ["./pkg", "./lib"]enma watch --command "make test file={}"When monitoring file changes, Enma filters target files based on the following order:
- If the file does not match 
--pattern-regex, it is excluded. - If the file matches 
--exclude-diror--exclude-ext, it is excluded. - If the file matches 
--ignore-dir-regexor--ignore-file-regex, it is excluded. - If the file is listed in the 
.enmaignorefile, it is excluded. - If 
--include-extis specified and the file does not match any of the extensions, it is excluded. - Files that pass all the above filters are considered as watch targets.
 
This filtering order is designed to be both efficient and intuitive:
- Early exclusion improves performance by skipping unnecessary processing for files that obviously shouldn't be watched.
 --pattern-regexacts as a top-level filter, giving users full control over what files are even considered.--exclude-*and--ignore-*rules eliminate unwanted files using both simple and flexible patterns.- The 
.enmaignorefile gives users a familiar, Git-style way to exclude files explicitly. - Finally, 
--include-extallows users to narrow down the remaining files by extension, but only if they choose to use it. 
This layered approach ensures clarity in behavior while keeping Enma fast and customizable.
| Option | Description | 
|---|---|
-h, --help | 
Show help message and exit | 
-v, --version | 
Show version | 
-c, --config | 
Specify config file. Default: ./Enma.toml, ./.enma.toml, or ./.enma/enma.toml | 
| Option | Description | 
|---|---|
-h, --help | 
Show help message and exit | 
-m, --mode | 
Mode for config file: hotload,watch or enmaignore (default: hotload) | 
-f, --file <filename> | 
Config filename to create (default: ./Enma.toml) | 
| Option | Description | 
|---|---|
-h, --help | 
Show help message and exit | 
-d, --daemon <command> | 
Daemon command to run (required) | 
-b, --build <command> | 
Command to build the daemon (required) | 
-S, --signal <singal> | 
Define signal to stop the daemon command. (optional. default: SIGTERM) | 
-w, --watch-dir <dir_name> | 
Watch directories (comma-separated, optional. default: $PWD) | 
-p, --pre-build <command> | 
Command to run before build (optional) | 
-P, --post-build <command> | 
Command to run after build (optional) | 
-W, --working-dir <dir_name> | 
Working directory (default: $PWD) | 
-I, --placeholder <placeholder> | 
Placeholder in command for changed file (default: {}) | 
-s, --args-path-style <style> | 
filepath-style where event in command.  (optional. default: dir,base,ext) | 
-B, --build-at-start <on|off> | 
Run a build before starting daemon for the first time.  If there is a placeholder, it will be ignored.  | 
-C, --check-content-diff <on|off> | 
Fires only when the file contents are changed. (optional. default: on) | 
-A, --abs, --absolute-path <on|off> | 
Use absolute path in placeholder (optional. default: on) | 
-t, --timeout <time> | 
Timeout for build command (default: 5sec) | 
-l, --delay <time> | 
Delay after build command (default: 0sec) | 
-r, --retry <number> | 
Retry count (default: 0) | 
-x, --pattern-regex <regex> | 
Regex pattern to watch (optional) | 
-i, --include-ext <ext> | 
File extensions to include (comma-separated, optional) | 
-g, --ignore-dir-regex <regex> | 
Regex to ignore directories (optional) | 
-G, --ignore-file-regex <regex>  | 
Regex to ignore files (optional) | 
-e, --exclude-ext <ext> | 
File extensions to exclude (comma-separated, optional) | 
-E, --exclude-dir <dir_name> | 
Directories to exclude (comma-separated, optional) | 
-D, --default-ignores <max|min|none> | 
Defines defualt loads enmaignore volume. (optional. default: minimal) | 
-n, --enmaignore <filename> | 
enma ignore file(s) (comma-separated, optional. default: ./.enmaignore) | 
--logs <log_file_path> | 
Log file path (optional) | 
--pid <pid_file_path> | 
PID file path (optional) | 
| Option | Description | 
|---|---|
-h, --help | 
Show help message and exit | 
-c, --command, --cmd <command> | 
Command to run on file change (required) | 
-p, --pre-cmd <command> | 
Command to run before main command (optional) | 
-P, --post-cmd <command> | 
Command to run after main command (optional) | 
-w, --watch-dir <dir_name> | 
Watch directories (comma-separated, optional. default: $PWD) | 
-W, --working-dir <dir_name> | 
Working directory (optional. default: $PWD) | 
-I, --placeholder | 
Placeholder in command for changed file (default: {}) | 
-s, --args-path-style <style> | 
filepath-style where event in command.  (optional. default: dir,base,ext) | 
-C, --check-content-diff <on|off> | 
Fires only when the file contents are changed. (optional. default: on) | 
-A, --abs, --absolute-path <on|off> | 
Use absolute path in placeholder (optional. default: on) | 
-t, --timeout <time> | 
Timeout for command (default: 5sec) | 
-l, --delay <time> | 
Delay after command (default: 0sec) | 
-r, --retry <number> | 
Retry count (default: 0) | 
-x, --pattern-regex <regex> | 
Regex pattern to watch (optional) | 
-i, --include-ext <ext> | 
File extensions to include (comma-separated, optional) | 
-g, --ignore-dir-regex <regex> | 
Regex to ignore directories (optional) | 
-G, --ignore-file-regex <regex> | 
Regex to ignore files (optional) | 
-e, --exclude-ext <ext> | 
File extensions to exclude (comma-separated, optional) | 
-E, --exclude-dir <dir_name> | 
Directories to exclude (comma-separated, optional) | 
-D, --default-ignores <max|min|none> | 
Defines defualt loads enmaignore volume. (optional. default: minimal) | 
-n, --enmaignore <filename> | 
enma ignore file(s) (comma-separated, optional. default: ./.enmaignore) | 
--logs <log_file_path> | 
Log file path (optional) | 
--pid <pid_file_path> | 
PID file path (optional) | 
The syntax of .enmaignore is a compatible syntax of .gitignore.
# =============================
# VCS / Version Control
# =============================
.git/
.hg/
.svn/
# =============================
# Editors / IDEs
# =============================
.idea/
.vscode/
*.code-workspace
*.sublime-project
*.sublime-workspace
Copyright (c) 2025 Hiroshi IKEGAMI
This project is licensed under the MIT License