{"id":15697873,"url":"https://github.com/fleny113/hexus","last_synced_at":"2025-05-09T01:01:08.345Z","repository":{"id":168751449,"uuid":"644506084","full_name":"Fleny113/Hexus","owner":"Fleny113","description":"Hexus is a modern, cross-platform process manager","archived":false,"fork":false,"pushed_at":"2024-04-26T05:23:05.000Z","size":420,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-04-27T00:19:54.638Z","etag":null,"topics":["dotnet","dotnet-core","dotnetcore","process-manager"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Fleny113.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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}},"created_at":"2023-05-23T16:53:43.000Z","updated_at":"2024-04-28T13:27:52.729Z","dependencies_parsed_at":"2023-10-16T13:22:02.168Z","dependency_job_id":"522c2b98-842f-4f76-88b5-bd00e5f3b719","html_url":"https://github.com/Fleny113/Hexus","commit_stats":null,"previous_names":["fleny113/hexus"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fleny113%2FHexus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fleny113%2FHexus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fleny113%2FHexus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fleny113%2FHexus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Fleny113","download_url":"https://codeload.github.com/Fleny113/Hexus/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253171250,"owners_count":21865290,"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":["dotnet","dotnet-core","dotnetcore","process-manager"],"created_at":"2024-10-03T19:21:59.513Z","updated_at":"2025-05-09T01:01:06.513Z","avatar_url":"https://github.com/Fleny113.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Hexus\r\n\r\n[![.NET build status](https://github.com/Fleny113/Hexus/actions/workflows/dotnet.yml/badge.svg?branch=main\u0026event=push)](https://github.com/Fleny113/Hexus/actions/workflows/dotnet.yml)\r\n![](https://img.shields.io/badge/.NET-9.0-purple)\r\n\r\nHexus is a process manager built using .NET 9 designed to work on Linux and Windows seamlessly while being nice and simple to use\r\n\r\n## Features\r\n\r\n- Performant\r\n- Supports sending CTRL + C (SIGINT) signals on both Linux and Windows\r\n- All the logs are in a single place ready to be read with timestamps and type of output\r\n- Keeps track of the complete usage of resources of an application, including child processes\r\n- Has a nice and simple CLI to use to manage all your applications\r\n- Can autogenerate the startup scripts for you to customize based on your needs for Windows (Windows Task Scheduler) and Linux (systemd)\r\n- Exposes both socket and (optional) HTTP port for the requests to the daemon, _under windows sockets are supported_\r\n\r\n## Installation\r\n\r\nDownload the binary from the latest CI release below or compile it using the [`.NET 9`](https://get.dot.net/9) SDK.\r\n\r\n|      OS       |                                                                                                     Self-contained                                                                                                     |                                                                                            Runtime dependent                                                                                             |\r\n|:-------------:|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|\r\n| Windows amd64 |     [Latest Release](https://github.com/fleny113/Hexus/releases/latest/download/win-x64-self-contained.tar.gz) \\| [CI Build](https://github.com/fleny113/Hexus/releases/download/ci/win-x64-self-contained.tar.gz)     |     [Latest Release](https://github.com/fleny113/Hexus/releases/latest/download/win-x64-runtime.tar.gz) \\| [CI Build](https://github.com/fleny113/Hexus/releases/download/ci/win-x64-runtime.tar.gz)     |\r\n|  Linux amd64  |   [Latest Release](https://github.com/fleny113/Hexus/releases/latest/download/linux-x64-self-contained.tar.gz) \\| [CI Build](https://github.com/fleny113/Hexus/releases/download/ci/linux-x64-self-contained.tar.gz)   |   [Latest Release](https://github.com/fleny113/Hexus/releases/latest/download/linux-x64-runtime.tar.gz) \\| [CI build](https://github.com/fleny113/Hexus/releases/download/ci/linux-x64-runtime.tar.gz)   |\r\n| Windows arm64 |   [Latest Release](https://github.com/fleny113/Hexus/releases/latest/download/win-arm64-self-contained.tar.gz) \\| [CI Build](https://github.com/fleny113/Hexus/releases/download/ci/win-arm64-self-contained.tar.gz)   |   [Latest Release](https://github.com/fleny113/Hexus/releases/latest/download/win-arm64-runtime.tar.gz) \\| [CI Build](https://github.com/fleny113/Hexus/releases/download/ci/win-arm64-runtime.tar.gz)   |\r\n|  Linux arm64  | [Latest Release](https://github.com/fleny113/Hexus/releases/latest/download/linux-arm64-self-contained.tar.gz) \\| [CI Build](https://github.com/fleny113/Hexus/releases/download/ci/linux-arm64-self-contained.tar.gz) | [Latest Release](https://github.com/fleny113/Hexus/releases/latest/download/linux-arm64-runtime.tar.gz) \\| [CI Build](https://github.com/fleny113/Hexus/releases/download/ci/linux-arm64-runtime.tar.gz) |\r\n\r\n### Compilation\r\n\r\nIf you want to compile the binary for yourself you need to install:\r\n\r\n- [`.NET 9`](https://get.dot.net/9) SDK\r\n- `ASP.NET Core`, usually bundled with the SDK\r\n\r\nTo create a release build to use run the following command after have cloned the repo and being in the top directory\r\n\r\n```sh\r\ndotnet publish Hexus\r\n```\r\n\r\nOptionally you can add `--self-contained` to remove the need for the .NET Runtime to be installed or with the `--runtime` flag to specify a target runtime like `linux-arm64` or `win-x64`\r\n\r\n## Usage\r\n\r\n#### Start the daemon\r\n\r\nHexus requires you to start the daemon manually before you can start using it. To start the daemon run the command `hexus daemon start` and if you want to stop it without sending a CTRL + C or a kill signal to the process you can use the `hexus daemon stop` command.\r\n\r\nIf you want to add the Hexus daemon to the startup you can use the `hexus startup` command that will detect what platform you are on and give you a powershell script for the windows task scheduler when run under windows and a systemd unit service file when running under Linux to quickly set up the startup process.\r\n\r\n\u003e [!TIP]\r\n\u003e When the command of `hexus startup` is redirected it won't output the decorations around the text to be easier to use the script/service that it creates\r\n\r\n\u003e [!NOTE]\r\n\u003e Hexus only supports Windows task scheduler and systemd unit services as startup scripts so using another platform will require you to set it up manually.\r\n\r\n#### New application\r\n\r\nCreating a new application is really easy: Just give your application a name and then type the command to run it just as normal and optionally add flags\r\n\r\n```sh\r\nhexus new \u003cname\u003e \u003cexecutable\u003e [\u003carguments\u003e] [\u003cflags\u003e]\r\n```\r\n\r\nAll the flags are available in the help for the command, you can use the `--help` or `-h` flag to see it.\r\n\r\n#### List applications\r\n\r\nTo list all the application currently running you can use the list command\r\n\r\n```sh\r\nhexus list\r\n```\r\n\r\nThe list command will provide some basic information on the application, but you can use the `hexus info` command with the name of the application to get some more info on it\r\n\r\n#### Get applications logs\r\n\r\nTo read all the application logs (By default stored under `~/.local/state/hexus/logs/\u003capplication name\u003e.log`) you can use the logs command like in the example:\r\n\r\n```sh\r\nhexus logs \u003capplication name\u003e\r\n```\r\n\r\n##### Flags\r\n\r\n- `--lines` or `-l` to specify the number of log lines to fetch from the log file, specify -1 to get all lines\r\n- `--no-streaming` to disable the streaming of logs to the console while the command is active\r\n- `--no-dates` to disable the Hexus provided timestamp of the log lines\r\n- `--current` or `-c` to show only the logs from the currently running for last execution of the application.\r\n- `--after` or `-a` to select logs that have a timestamp after the one provided (does get affected by `--timezone`)\r\n- `--before` or `-b` to select logs that have a timestamp before the one provided (does get affected by `--timezone`)\r\n- `--timezone` timezone of the Hexus provided timestamps, should be picked from the system-provided timezones. Defaults to the computer current timezone.\r\n\r\nAll the flags are available in the help for the command, you can use the `--help` or `-h` flag to see it.\r\n\r\n##### Log file\r\n\r\nIf you want to manually parse the log files the format is as follows: `[\u003cdate\u003e,\u003ctype\u003e] \u003cmessage\u003e` where\r\n\r\n- `date` is a date in UTC time using the ISO8601 format\r\n- `type` is one of `STDOUT`, `STDERR` or `SYSTEM`, with `SYSTEM` being used for Hexus messages like the application start or stop while `STDOUT` and `STDERR` for the actual logs of the application\r\n- `message` is the actual message the application logged to the console\r\n\r\n#### Start / Stop / Restart / Delete application\r\n\r\nTo start an application you can use the `hexus start \u003cname\u003e` command with the name right after and to stop an application you can use the `hexus stop \u003cname\u003e` command with the name right after, for the stop command you can also specify the `--force` flag what will kill as soon as possible the application without sending a CTRl + C.\r\n\r\nSimilar to the stop command you can also restart an application with the name of it using the `hexus restart \u003cname\u003e` command with, if wanted, the `--force` flag to force the stop of the application\r\n\r\nIf you don't want to have an application you can use the `hexus delete \u003cname\u003e` command to remove it from the applications. This command also supports the `--force` flag to stop the application by force\r\n\r\nAll the flags are available in the help for the command, you can use the `--help` or `-h` flag to see it.\r\n\r\n\u003e [!WARNING]\r\n\u003e When deleting an application the log file will also be deleted\r\n\r\n#### Edit application\r\n\r\nTo edit an application you will first need to stop it using the `hexus stop` command, and then you can change add the different options for it, check the `--help` for all the flags.\r\n\r\n#### Send input to the application\r\n\r\nHexus also allows sending messages in the application `STDIN` by using the `hexus info \u003cname\u003e \u003cmessage\u003e` command where name is the application name and message whatever you need to send to the application.\r\n\r\nKeep in mind Hexus will send the message to the direct child so in a situation where the direct child is not the application you want to send the input to you might have troubles\r\n\r\n## Configuration\r\n\r\nHexus will store the configuration in `$XDG_CONFIG_HOME/hexus.yaml`,\r\nthe daemon socket on `$XDG_RUNTIME_DIR/hexus.sock` for Linux and `$XDG_STATE_HOME/hexus/hexus.sock` for Windows,\r\nthe logs for the daemon in `$XDG_STATE_HOME/hexus/daemon.log` and the logs for the applications in `$XDG_STATE_HOME/hexus/applications/\u003capp name\u003e.log`\r\n\r\nThese locations can be customized with the `XDG_CONFIG_HOME` (defaults to `~/.config`), `XDG_RUNTIME_DIR`[^XDG_RUNTIME_DIR] and `XDG_STATE_HOME` (defaults to `.local/state`) environment variables.\r\nOn Windows setting the `XDG_RUNTIME_DIR` will not be ignored and that path will be used instead of using the `$XDG_STATE_HOME/hexus` folder.\r\n\r\n[^XDG_RUNTIME_DIR]: `XDG_RUNTIME_DIR` does not provide a clear default, however if running on Windows the value \"defaults\" to `$XDG_STATE_HOME/hexus`, on Unix systems a `\u003cUID\u003e-runtime` directory, where `\u003cUID\u003e` is replaced with the user ID that is running hexus, will be created in the temp with the permissions `700` and the current user as the owner according to the XDG basedir specification\r\n\r\nThe config file is a `.yaml` file with the following options:\r\n\r\n- `unixSocket`: Changes where the socket is located. Used for connecting to the daemon.\r\n- `httpPort`: The HTTP port to listen as an addition way to access the daemon to the required socket, useful for interfacing with software that cant use the socket. \\[OPTIONAL\\]\r\n- `cpuRefreshIntervalSeconds`: The interval for the refresh of CPU usage of applications. The lower the value, the more CPU Hexus will use but the more precise it will the CPU usage of applications. Default 2.5 seconds.\r\n- `applications`: Object with the application name as the key as the value the following proprieties.\r\n  - `executable`: The file to execute when spawning the application.\r\n  - `arguments`: The arguments to give the executable, as a string. \\[OPTIONAL\\]\r\n  - `workingDirectory`: The directory where the application should start.\r\n  - `status`: Status of the application. Possible values: `Crashed`, `Exited`, `Running` (Matches the `HexusApplicationStatus` enum)\r\n  - `note`: A note that can be seen in the `info` command. \\[OPTIONAL\\]\r\n  - `environmentVariables`: All the environment variables for the application. Application **WILL NOT** inherit the environment variables from the daemon \\[OPTIONAL\\]\r\n\r\n\u003e [!NOTE]\r\n\u003e The configuration file, the socket and the daemon log will have a `.dev` suffix before the extension to the name when running in development.\r\n\u003e The resulting config file, socket file and log file are respectively `hexus.dev.yaml`, `hexus.dev.sock` and `daemon.dev.log`\r\n\r\n#### PM2 Migration\r\n\r\nHexus allows you to migrate your current pm2 applications saved in the `dump.pm2` file. You can use the `migrate-pm2` command with, optionally, the `--pm2-dump` option in case you are not using the default `$HOME/.pm2/dump.pm2` file, just remember to run `pm2 save` before you run the command.\r\n\r\n\u003e [!WARNING]\r\n\u003e Hexus only supports migrating from pm2 `5.3.0`, using another version might give errors. Migrating apps that are configured as cluster in pm2 will fail and Hexus will skip them as Hexus supports `fork_mode` only.\r\n\u003e\r\n\u003e Hexus uses names to discriminate on what application the operation should be taken, for this reason if there are name conflicts with exiting application Hexus will try to save the application with the same name, if that fails due to an application having the same name Hexus will add the `-pm2` suffix. If even at that point there were conflicts with exiting application, Hexus will log out on what application it failed for you to configure it manually\r\n\r\n## Roadmap\r\n\r\n- Add log rotation support\r\n\r\n## Limitations\r\n\r\n- MacOS is not supported as Hexus needs to get the child processes for an application to calculate the correct RAM and CPU usages, and I don't have anything to test how to get them.\r\n\r\n## License\r\n\r\nHexus is under the [MIT license](./LICENSE.md)\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffleny113%2Fhexus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffleny113%2Fhexus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffleny113%2Fhexus/lists"}