πͺοΈ A fast and simple CLI tool for watching and auto-reloading Go web applications during development.
Wind is inspired by air but focused specifically on web applications with a simpler, streamlined approach.
- β‘ Fast file watching using polling with the Go standard library
- π Automatic rebuild and reload on file changes
- π¨ Colored output using ANSI escape codes
- ποΈ Smart directory exclusion (vendor, .git, node_modules, etc.)
- π Multiple file type support (.go, .html, .css, .js, .json, .yaml, .yml)
- π§ Graceful process management with proper cleanup
- π Zero configuration - works out of the box
- π» Simple CLI interface
- ποΈ Zero dependencies - uses only Go standard library
- π― Smart project detection - automatically detects Go project layouts
go install github.com/rodrigoherera/wind@latest
git clone https://github.com/rodrigoherera/wind.git
cd wind
go build -o wind .
Navigate to your Go web application directory and run:
wind init
This will:
- Watch for file changes in the current directory
- Automatically rebuild your application when files change
- Restart the application with the new binary
- Display colored output showing the build and run status
wind # Start watching current directory (default)
wind init # Start watching current directory
wind help # Show help message
wind version # Show version
- Project Detection: Automatically detects your Go project structure (cmd/api/, cmd/, or root main.go)
- File Watching: Wind monitors your project directory using polling to detect file changes
- Smart Filtering: Only reacts to relevant file types (.go, .html, .css, .js, etc.)
- Debouncing: Groups rapid file changes to avoid unnecessary rebuilds
- Build Process: Uses the appropriate build command based on your project structure
- Process Management: Gracefully stops the previous process and starts the new one
- Cleanup: Handles interrupts and cleans up temporary files
Wind works with zero configuration but uses sensible defaults:
- Auto-detected Build Commands:
cmd/api/main.go
βgo build -o ./tmp/main ./cmd/api
cmd/main.go
βgo build -o ./tmp/main ./cmd
main.go
βgo build -o ./tmp/main .
- Run Command:
./tmp/main
- Excluded Directories:
vendor
,.git
,node_modules
,tmp
,.idea
,.vscode
- Watched Extensions:
.go
,.html
,.css
,.js
,.json
,.yaml
,.yml
- Poll Interval: 500ms (file system polling)
- Debounce Delay: 300ms
Wind automatically detects and works with common Go project layouts:
your-web-app/
βββ cmd/
β βββ api/
β βββ main.go # Main application entry point
βββ internal/ # Private application code
βββ pkg/ # Public library code
βββ configs/ # Configuration files
βββ go.mod
βββ go.sum
βββ tmp/ # Created automatically for builds
βββ main # Compiled binary
your-web-app/
βββ main.go # Main application file
βββ handlers/ # Your HTTP handlers
βββ models/ # Data models
βββ go.mod
βββ go.sum
βββ tmp/ # Created automatically for builds
βββ main # Compiled binary
your-web-app/
βββ cmd/
β βββ main.go # Main application entry point
βββ internal/ # Application code
βββ go.mod
βββ tmp/ # Created automatically for builds
βββ main # Compiled binary
Here's a simple example of a Go web application that works great with Wind:
// main.go
package main
import (
"fmt"
"log"
"net/http"
)
func main() {
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
fmt.Fprintf(w, "Hello from Wind! πͺοΈ")
})
fmt.Println("Server starting on :8080")
log.Fatal(http.ListenAndServe(":8080", nil))
}
Run Wind in the project directory:
wind init
Now edit main.go
and watch Wind automatically rebuild and restart your server!
Wind is inspired by air but with key differences:
Feature | Wind | Air |
---|---|---|
Target Audience | Web applications | General Go apps |
Configuration | Zero-config | Highly configurable |
Setup | Works immediately | Requires config file |
File Types | Web-focused | Customizable |
Dependencies | Zero (stdlib only) | Multiple external |
Size | Lightweight | Full-featured |
Choose Wind if you want:
- Quick setup for web applications
- Zero configuration
- Lightweight tool with no dependencies
- Simple, focused functionality
- Single binary deployment
Choose Air if you need:
- Complex configuration options
- Support for various project types
- Advanced features
- Customizable workflows
Make sure the binary is executable:
chmod +x ./tmp/main
Check if your files are in excluded directories. Wind excludes vendor
, .git
, node_modules
, tmp
, .idea
, and .vscode
by default.
Make sure your Go code compiles successfully:
go build .
Fix any compilation errors before running Wind.
Wind includes a comprehensive test suite to ensure reliability and performance.
Wind comes with a full test suite including unit tests, integration tests, and benchmarks:
# Run all tests (unit + integration)
./test.sh
# Run only unit tests (fast)
./test.sh --unit-only
# Run only integration tests
./test.sh --integration-only
# Run performance benchmarks
./test.sh --benchmarks
# Generate test coverage report
./test.sh --coverage
# Run everything (tests, benchmarks, coverage)
./test.sh --all
# Verbose output
./test.sh --verbose
# Show help
./test.sh --help
The test suite covers:
- Unit Tests: Project structure detection, file filtering, change detection
- Integration Tests: Real file operations, complete workflows, error handling
- Benchmark Tests: Performance testing with various file counts
- Performance Metrics: File scanning ~97Β΅s, change detection ~93Β΅s
# Clone the repository
git clone https://github.com/rodrigoherera/wind.git
cd wind
# Run tests to ensure everything works
./test.sh
# Build the binary
go build -o wind .
# Test with the example app
cd example
../wind init
All test results are saved in test-results/
(ignored by git) for detailed analysis.
Contributions are welcome! Please:
- Run the full test suite:
./test.sh --all
- Ensure all tests pass
- Add tests for new features
- Submit a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Inspired by air
- Built using only the Go standard library
- Uses polling-based file watching and ANSI escape codes for colors