{"id":29303508,"url":"https://github.com/rangertaha/hxe","last_synced_at":"2025-07-07T01:08:20.648Z","repository":{"id":300563469,"uuid":"1005844676","full_name":"rangertaha/hxe","owner":"rangertaha","description":"Host-based Process Execution Engine","archived":false,"fork":false,"pushed_at":"2025-06-30T18:28:46.000Z","size":7680,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-30T19:31:45.760Z","etag":null,"topics":["execution","proccess"],"latest_commit_sha":null,"homepage":"https://rangertaha.github.io/hxe/","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rangertaha.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-06-20T23:42:42.000Z","updated_at":"2025-06-30T18:28:49.000Z","dependencies_parsed_at":"2025-06-22T12:43:28.698Z","dependency_job_id":null,"html_url":"https://github.com/rangertaha/hxe","commit_stats":null,"previous_names":["rangertaha/hxe"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rangertaha/hxe","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rangertaha%2Fhxe","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rangertaha%2Fhxe/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rangertaha%2Fhxe/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rangertaha%2Fhxe/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rangertaha","download_url":"https://codeload.github.com/rangertaha/hxe/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rangertaha%2Fhxe/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263996085,"owners_count":23541402,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["execution","proccess"],"created_at":"2025-07-07T01:08:20.122Z","updated_at":"2025-07-07T01:08:20.634Z","avatar_url":"https://github.com/rangertaha.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# hxe\n\nHXE - Host eXecution Engine\n\nA host-based process execution and management tool for long lived services and and short lived tasks. \n\n[![Go Version](https://img.shields.io/badge/Go-1.23+-blue.svg)](https://golang.org)\n[![License](https://img.shields.io/badge/License-GPLv3+-green.svg)](LICENSE)\n[![Go Report Card](https://goreportcard.com/badge/github.com/rangertaha/hxe)](https://goreportcard.com/report/github.com/rangertaha/hxe)\n\n## Features\n\n- 🔐 **JWT Authentication**: Secure authentication with token-based access\n- 🚀 **Program Management**: Start, stop, restart, and monitor programs\n- 🖥️ **Desktop App**: Modern web-based UI for program management\n- 💻 **Command Line App**: Full-featured CLI with beautiful table formatting\n- 🔧 **Configuration**: HCL-based configuration files\n- 📊 **Monitoring**: Real-time program status and logs\n- 🔄 **Auto-restart**: Automatic program recovery on failure\n- 🌐 **RESTful API**: Comprehensive API with JWT protection\n- 📝 **Logging**: Comprehensive logging with multiple levels\n- 🎨 **Beautiful UI**: Table formatting with go-pretty library\n- 🔄 **Multi-operations**: Bulk operations for multiple programs\n- 🌍 **Cross-platform**: Works on Linux, Windows, and macOS\n\n## Screenshots\n\n### Desktop Interface\n![Desktop Interface](docs/img/desktop.png)\n\n### Terminal Interface\n![Terminal Interface](docs/img/terminal.png)\n\n## Installation\n\n### Prerequisites\n\n- Go 1.23 or higher\n- Git\n\n### From Source\n\n```bash\n# Clone the repository\ngit clone https://github.com/rangertaha/hxe.git\ncd hxe\n\n# Build the project\ngo build -o bin/hxe ./cmd/hxe\n\n# Install globally (optional)\nsudo cp bin/hxe /usr/local/bin/\n```\n\n### Using GitHub Packages\n\nHXE is available as a Go module from GitHub Packages:\n\n```bash\n# Configure Go to use GitHub Packages\nexport GOPRIVATE=github.com/rangertaha/hxe\nexport GOPROXY=https://proxy.golang.org,direct\n\n# Install HXE\ngo install github.com/rangertaha/hxe/cmd/hxe@latest\n\n# Or add to your project\ngo get github.com/rangertaha/hxe/pkg/client\n```\n\n### Using Make\n\n```bash\n# Build backend server\nmake server\n\n# Build desktop application\nmake desktop\n\n# Clean build artifacts\nmake clean\n```\n\n## Quick Start\n\n### 1. Start the Server\n\n```bash\n# Start the HXE server\nhxe --daemon\n\n# Or with custom configuration\nhxe --config /path/to/config.hcl --daemon\n```\n\n### 2. Using the Go Client\n\n```go\npackage main\n\nimport (\n    \"log\"\n    \"github.com/rangertaha/hxe/pkg/client\"\n)\n\nfunc main() {\n    // Create authenticated client\n    hxeClient := client.NewAuthenticatedClient(\"http://localhost:8080\", \"admin\", \"password\")\n    \n    // Login to get JWT token\n    _, err := hxeClient.Login()\n    if err != nil {\n        log.Fatal(\"Login failed:\", err)\n    }\n    \n    programClient := hxeClient.Program\n    \n    // List all programs\n    programs, err := programClient.ListPrograms()\n    if err != nil {\n        log.Fatal(\"Failed to list programs:\", err)\n    }\n    \n    // Display programs in beautiful table format\n    programClient.PrintList(programs)\n    \n    // Create a new program\n    newProgram := \u0026models.Program{\n        Name:        \"My Program\",\n        Description: \"A test program\",\n        Command:     \"/usr/bin/python3\",\n        Args:        \"script.py\",\n        Directory:   \"/tmp\",\n        User:        \"nobody\",\n        Group:       \"nobody\",\n        Enabled:     true,\n    }\n    \n    created, err := programClient.CreateProgram(newProgram)\n    if err != nil {\n        log.Fatal(\"Failed to create program:\", err)\n    }\n    \n    // Start the program\n    _, err = programClient.StartProgram(created.ID)\n    if err != nil {\n        log.Fatal(\"Failed to start program:\", err)\n    }\n    \n    // Logout when done\n    hxeClient.Logout()\n}\n```\n\n### 3. Command Line Interface\n\n```bash\n# List programs\nhxe list\n\n# Start a program\nhxe start my-program\n\n# Stop a program\nhxe stop my-program\n\n# Get program status\nhxe status my-program\n\n# Run a command directly\nhxe run \"python3 script.py\"\n```\n\n## Configuration\n\nHXE uses HCL (HashiCorp Configuration Language) for configuration files. The default configuration is created at `~/.config/hxe/config.hcl`.\n\n### Basic Configuration\n\n```hcl\n// HXE Configuration\ndebug = false\nversion = \"0.1.0\"\n\napi {\n  addr = \"0.0.0.0\"\n  port = 8080\n  username = \"admin\"\n  password = \"password\"\n}\n\ndatabase {\n  type = \"sqlite\"\n  migrate = true\n}\n\nbroker { \n  name = \"hxe\"\n  addr = \"0.0.0.0\"\n  port = 4222\n}\n```\n\n## API Reference\n\n### Authentication\n\nHXE uses JWT authentication. Default credentials:\n- **Username**: `admin`\n- **Password**: `password`\n\n### REST Endpoints\n\n#### Authentication\n- `POST /api/auth/login` - Login and get JWT token\n- `POST /api/auth/refresh` - Refresh JWT token\n- `POST /api/auth/logout` - Logout\n\n#### Programs\n- `GET /api/program` - List all programs\n- `GET /api/program/{id}` - Get program details\n- `POST /api/program` - Create a new program\n- `PUT /api/program/{id}` - Update a program\n- `DELETE /api/program/{id}` - Delete a program\n- `POST /api/program/{id}/start` - Start a program\n- `POST /api/program/{id}/stop` - Stop a program\n- `POST /api/program/{id}/restart` - Restart a program\n- `POST /api/program/{id}/enable` - Enable a program\n- `POST /api/program/{id}/disable` - Disable a program\n- `POST /api/program/{id}/reload` - Reload program configuration\n- `POST /api/program/{id}/shell` - Open shell for a program\n- `POST /api/program/{id}/tail` - Follow program logs\n\n### Client Library\n\nThe HXE client library provides a comprehensive Go API:\n\n```go\n// Create authenticated client\nclient := client.NewAuthenticatedClient(\"http://localhost:8080\", \"admin\", \"password\")\n\n// Login\n_, err := client.Login()\n\n// Get program client\nprogramClient := client.Program\n\n// CRUD operations\nprograms, _ := programClient.ListPrograms()\nprogram, _ := programClient.GetProgram(\"123\")\ncreated, _ := programClient.CreateProgram(newProgram)\nupdated, _ := programClient.UpdateProgram(\"123\", program)\ndeleted, _ := programClient.DeleteProgram(\"123\")\n\n// Runtime operations\n_, _ = programClient.StartProgram(\"123\")\n_, _ = programClient.StopProgram(\"123\")\n_, _ = programClient.RestartProgram(\"123\")\n_, _ = programClient.EnableAutostart(\"123\")\n_, _ = programClient.DisableAutostart(\"123\")\n\n// Display methods\nprogramClient.PrintList(programs)        // Table view\nprogramClient.PrintDetail(program)       // Detailed view\n```\n\n## Usage\n\n### Command Line Options\n\n```bash\nhxe [OPTIONS] [COMMAND]\n\nOptions:\n  -d, --daemon    Run in daemon mode\n  -c, --config    Configuration file path\n  --debug         Enable debug logging\n  -h, --help      Show help\n  -v, --version   Show version\n\nCommands:\n  run             Run a command or program\n  list            List all programs\n  start           Start a program\n  stop            Stop a program\n  restart         Restart a program\n  status          Show program status\n  tail            Tail program logs\n  reload          Reload configuration\n  enable          Enable a program\n  disable         Disable a program\n  shell           Open shell for a program\n```\n\n### Examples\n\n#### Basic Program Execution\n\n```bash\n# Run a simple command\nhxe run echo \"Hello, World!\"\n\n# Run a Python script\nhxe run python script.py\n\n# Run with arguments\nhxe run node server.js --port 3000\n```\n\n#### Program Management\n\n```bash\n# List all programs\nhxe list\n\n# Start a program\nhxe start my-program\n\n# Stop a program\nhxe stop my-program\n\n# Get program status\nhxe status my-program\n\n# Enable autostart\nhxe enable my-program\n\n# Disable autostart\nhxe disable my-program\n```\n\n#### Daemon Mode\n\n```bash\n# Start HXE in daemon mode\nhxe --daemon\n\n# Start with custom configuration\nhxe --config /etc/hxe/config.hcl --daemon\n```\n\n## Development\n\n### Project Structure\n\n```\nhxe/\n├── cmd/hxe/              # Main application entry point\n├── internal/             # Internal packages\n│   ├── agent/            # Service agent\n│   ├── api/              # API server and handlers\n│   ├── config/           # Configuration management\n│   ├── models/           # Data models\n│   └── log/              # Logging utilities\n├── pkg/client/           # Go client library\n├── desktop/              # Desktop application\n├── examples/             # Example configurations and usage\n└── docs/                 # Documentation\n```\n\n### Building\n\n```bash\n# Build for current platform\ngo build -o bin/hxe ./cmd/hxe\n\n# Build for specific platform\nGOOS=linux GOARCH=amd64 go build -o bin/hxe-linux-amd64 ./cmd/hxe\nGOOS=darwin GOARCH=amd64 go build -o bin/hxe-darwin-amd64 ./cmd/hxe\nGOOS=windows GOARCH=amd64 go build -o bin/hxe-windows-amd64.exe ./cmd/hxe\n```\n\n### Testing\n\n```bash\n# Run all tests\ngo test ./...\n\n# Run tests with coverage\ngo test -cover ./...\n\n# Run specific test\ngo test ./internal/api\n```\n\n## Contributing\n\n1. Fork the repository\n2. Create a feature branch (`git checkout -b feature/amazing-feature`)\n3. Commit your changes (`git commit -m 'Add amazing feature'`)\n4. Push to the branch (`git push origin feature/amazing-feature`)\n5. Open a Pull Request\n\n## License\n\nThis project is licensed under the GNU General Public License v3.0 or later - see the [LICENSE](LICENSE) file for details.\n\n## Acknowledgments\n\n- Inspired by [Supervisord](http://supervisord.org/), [PM2](https://pm2.keymetrics.io/), [Pueue](https://crates.io/crates/pueue) and [Systemd](https://systemd.io/)\n- Server Built with [Go](https://golang.org/), [Echo](https://echo.labstack.com/), [GORM](https://gorm.io/), and [NATS](https://nats.io/)\n- Desktop App Built with [React](https://reactjs.org/), [Typescript](https://www.typescriptlang.org/), [Tauri](https://v2.tauri.app/), and [Rust](https://www.rust-lang.org/)\n\n## Support\n\n- 📧 Email: rangertaha@gmail.com\n- 🐛 Issues: [GitHub Issues](https://github.com/rangertaha/hxe/issues)\n- 📖 Documentation: [GitHub Wiki](https://github.com/rangertaha/hxe/wiki)\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frangertaha%2Fhxe","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frangertaha%2Fhxe","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frangertaha%2Fhxe/lists"}