Gomon is a nodemon alternative CLI tool specifically designed for Go applications. It monitors your Go files for changes and automatically rebuilds and restarts your application, making development faster and more efficient.
- Monitors your Go application for file changes
- Automatically rebuilds and restarts on changes
- Supports web server applications with custom port configuration
- Works on multiple platforms (Windows, macOS, Linux)
You have two options to install Gomon:
go install github.com/SXsid/gomon/cmd/gomon@latestThis will download and install Gomon to your Go bin directory. Make sure your Go bin directory is in your PATH.
git clone https://github.com/SXsid/gomon.git
cd gomon
go mod tidyAfter cloning, you can:
-
On Unix/Linux/macOS:
make install
-
On Windows:
go build ./cmd/gomon
This will create a
gomon.exefile in your current directory.
If you installed using go install or make install:
gomon --main <path_to_your_main.go>If you built the executable on Windows:
--watch <directory_path>For web applications, you can specify a custom port and watching directory:
gomon --main <path_to_your_main.go> --port <port_number> --watch <directory_path>Example:
gomon --main ./cmd/server/main.go --port 8080 --watch .| Option | Description |
|---|---|
--main |
Path to your main Go file (required) |
--port |
Port number for web applications (optional) |
--watch |
Directory to watch for changes (default: current directory) |
Running a simple Go web server:
gomon --main ./main.go --port 3000- Ensure your Go bin directory is in your PATH
- Make sure you have write permissions to the directory where you're running Gomon
- If changes are not being detected, check if you're monitoring the correct directory
This project is licensed under the MIT License - see the LICENSE file for details.
Contributions are welcome! Please feel free to submit a Pull Request.