HXE - Host eXecution Engine
A host-based process execution and management tool for long lived services and and short lived tasks.
- 🔐 JWT Authentication: Secure authentication with token-based access
- 🚀 Program Management: Start, stop, restart, and monitor programs
- 🖥️ Desktop App: Modern web-based UI for program management
- 💻 Command Line App: Full-featured CLI with beautiful table formatting
- 🔧 Configuration: HCL-based configuration files
- 📊 Monitoring: Real-time program status and logs
- 🔄 Auto-restart: Automatic program recovery on failure
- 🌐 RESTful API: Comprehensive API with JWT protection
- 📝 Logging: Comprehensive logging with multiple levels
- 🎨 Beautiful UI: Table formatting with go-pretty library
- 🔄 Multi-operations: Bulk operations for multiple programs
- 🌍 Cross-platform: Works on Linux, Windows, and macOS
- Go 1.23 or higher
- Git
# Clone the repository
git clone https://github.com/rangertaha/hxe.git
cd hxe
# Build the project
go build -o bin/hxe ./cmd/hxe
# Install globally (optional)
sudo cp bin/hxe /usr/local/bin/HXE is available as a Go module from GitHub Packages:
# Configure Go to use GitHub Packages
export GOPRIVATE=github.com/rangertaha/hxe
export GOPROXY=https://proxy.golang.org,direct
# Install HXE
go install github.com/rangertaha/hxe/cmd/hxe@latest
# Or add to your project
go get github.com/rangertaha/hxe/pkg/client# Build backend server
make server
# Build desktop application
make desktop
# Clean build artifacts
make clean# Start the HXE server
hxe --daemon
# Or with custom configuration
hxe --config /path/to/config.hcl --daemonpackage main
import (
"log"
"github.com/rangertaha/hxe/pkg/client"
)
func main() {
// Create authenticated client
hxeClient := client.NewAuthenticatedClient("http://localhost:8080", "admin", "password")
// Login to get JWT token
_, err := hxeClient.Login()
if err != nil {
log.Fatal("Login failed:", err)
}
programClient := hxeClient.Program
// List all programs
programs, err := programClient.ListPrograms()
if err != nil {
log.Fatal("Failed to list programs:", err)
}
// Display programs in beautiful table format
programClient.PrintList(programs)
// Create a new program
newProgram := &models.Program{
Name: "My Program",
Description: "A test program",
Command: "/usr/bin/python3",
Args: "script.py",
Directory: "/tmp",
User: "nobody",
Group: "nobody",
Enabled: true,
}
created, err := programClient.CreateProgram(newProgram)
if err != nil {
log.Fatal("Failed to create program:", err)
}
// Start the program
_, err = programClient.StartProgram(created.ID)
if err != nil {
log.Fatal("Failed to start program:", err)
}
// Logout when done
hxeClient.Logout()
}# List programs
hxe list
# Start a program
hxe start my-program
# Stop a program
hxe stop my-program
# Get program status
hxe status my-program
# Run a command directly
hxe run "python3 script.py"HXE uses HCL (HashiCorp Configuration Language) for configuration files. The default configuration is created at ~/.config/hxe/config.hcl.
// HXE Configuration
debug = false
version = "0.1.0"
api {
addr = "0.0.0.0"
port = 8080
username = "admin"
password = "password"
}
database {
type = "sqlite"
migrate = true
}
broker {
name = "hxe"
addr = "0.0.0.0"
port = 4222
}HXE uses JWT authentication. Default credentials:
- Username:
admin - Password:
password
POST /api/auth/login- Login and get JWT tokenPOST /api/auth/refresh- Refresh JWT tokenPOST /api/auth/logout- Logout
GET /api/program- List all programsGET /api/program/{id}- Get program detailsPOST /api/program- Create a new programPUT /api/program/{id}- Update a programDELETE /api/program/{id}- Delete a programPOST /api/program/{id}/start- Start a programPOST /api/program/{id}/stop- Stop a programPOST /api/program/{id}/restart- Restart a programPOST /api/program/{id}/enable- Enable a programPOST /api/program/{id}/disable- Disable a programPOST /api/program/{id}/reload- Reload program configurationPOST /api/program/{id}/shell- Open shell for a programPOST /api/program/{id}/tail- Follow program logs
The HXE client library provides a comprehensive Go API:
// Create authenticated client
client := client.NewAuthenticatedClient("http://localhost:8080", "admin", "password")
// Login
_, err := client.Login()
// Get program client
programClient := client.Program
// CRUD operations
programs, _ := programClient.ListPrograms()
program, _ := programClient.GetProgram("123")
created, _ := programClient.CreateProgram(newProgram)
updated, _ := programClient.UpdateProgram("123", program)
deleted, _ := programClient.DeleteProgram("123")
// Runtime operations
_, _ = programClient.StartProgram("123")
_, _ = programClient.StopProgram("123")
_, _ = programClient.RestartProgram("123")
_, _ = programClient.EnableAutostart("123")
_, _ = programClient.DisableAutostart("123")
// Display methods
programClient.PrintList(programs) // Table view
programClient.PrintDetail(program) // Detailed viewhxe [OPTIONS] [COMMAND]
Options:
-d, --daemon Run in daemon mode
-c, --config Configuration file path
--debug Enable debug logging
-h, --help Show help
-v, --version Show version
Commands:
run Run a command or program
list List all programs
start Start a program
stop Stop a program
restart Restart a program
status Show program status
tail Tail program logs
reload Reload configuration
enable Enable a program
disable Disable a program
shell Open shell for a program# Run a simple command
hxe run echo "Hello, World!"
# Run a Python script
hxe run python script.py
# Run with arguments
hxe run node server.js --port 3000# List all programs
hxe list
# Start a program
hxe start my-program
# Stop a program
hxe stop my-program
# Get program status
hxe status my-program
# Enable autostart
hxe enable my-program
# Disable autostart
hxe disable my-program# Start HXE in daemon mode
hxe --daemon
# Start with custom configuration
hxe --config /etc/hxe/config.hcl --daemonhxe/
├── cmd/hxe/ # Main application entry point
├── internal/ # Internal packages
│ ├── agent/ # Service agent
│ ├── api/ # API server and handlers
│ ├── config/ # Configuration management
│ ├── models/ # Data models
│ └── log/ # Logging utilities
├── pkg/client/ # Go client library
├── desktop/ # Desktop application
├── examples/ # Example configurations and usage
└── docs/ # Documentation
# Build for current platform
go build -o bin/hxe ./cmd/hxe
# Build for specific platform
GOOS=linux GOARCH=amd64 go build -o bin/hxe-linux-amd64 ./cmd/hxe
GOOS=darwin GOARCH=amd64 go build -o bin/hxe-darwin-amd64 ./cmd/hxe
GOOS=windows GOARCH=amd64 go build -o bin/hxe-windows-amd64.exe ./cmd/hxe# Run all tests
go test ./...
# Run tests with coverage
go test -cover ./...
# Run specific test
go test ./internal/api- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the GNU General Public License v3.0 or later - see the LICENSE file for details.
- Inspired by Supervisord, PM2, Pueue and Systemd
- Server Built with Go, Echo, GORM, and NATS
- Desktop App Built with React, Typescript, Tauri, and Rust
- 📧 Email: rangertaha@gmail.com
- 🐛 Issues: GitHub Issues
- 📖 Documentation: GitHub Wiki

