⚡ Eletrize

Eletrize is a live reload tool for Go and other languages. It watches for file changes in your project and automatically runs commands, speeding up development and testing workflows.
🚀 Installation
Requirements:
To install Eletrize, run:
go install github.com/lasfh/eletrize@latest
⚙️ Basic Usage
Run a simple command with file watching:
eletrize run ./server "go build" --ext=.go --label="API" --env=.env
This command:
- Watches the directory for changes in
.go files.
- Runs
go build and .server when changes are detected.
- Loads environment variables from the
.env file.
📁 Configuration Files
Eletrize can automatically detect configuration files named:
eletrize.yml
eletrize.yaml
.eletrize.yml
.eletrize.yaml
eletrize.json
.eletrize.json
.eletrize (JSON format)
To run Eletrize with a config file:
eletrize
Or specify the path manually:
eletrize path/eletrize.yml
🧪 Running a Specific Schema
If your config file contains multiple schemas, you can specify one using:
eletrize eletrize.yml --schema=1
Replace 1 with the desired schema index.
📝 Configuration Example
schema:
- label: API
workdir: ""
envs:
key: "value"
env_file: ".env"
watcher:
path: "."
recursive: true
excluded_paths:
- "frontend"
extensions:
- ".go"
commands:
build:
method: "go"
args:
- "build"
envs:
key: "value"
env_file: ""
run:
- method: "./server"
envs:
PORT: "8080"
env_file: ""
🧰 Additional Features
- Multi-directory watching: Define multiple schemas to monitor different parts of your project.
- Language-agnostic support: While optimized for Go, Eletrize can be configured for other languages.
- Advanced customization: Combine extensions, commands, and environment variables to tailor Eletrize to your project.
📄 License
This project is licensed under the MIT License.