{"id":19302467,"url":"https://github.com/bitlytwiser/apprunner","last_synced_at":"2025-04-22T10:33:53.040Z","repository":{"id":257436535,"uuid":"857159975","full_name":"BitlyTwiser/apprunner","owner":"BitlyTwiser","description":"Run apps from yaml config","archived":false,"fork":false,"pushed_at":"2025-01-16T16:52:20.000Z","size":607,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-01T22:46:44.078Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Zig","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BitlyTwiser.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2024-09-13T23:49:54.000Z","updated_at":"2025-01-16T16:50:55.000Z","dependencies_parsed_at":null,"dependency_job_id":"2baa67a3-1fa9-45fd-89a1-4d7ea1cb6c43","html_url":"https://github.com/BitlyTwiser/apprunner","commit_stats":null,"previous_names":["bitlytwiser/apprunner"],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BitlyTwiser%2Fapprunner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BitlyTwiser%2Fapprunner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BitlyTwiser%2Fapprunner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BitlyTwiser%2Fapprunner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BitlyTwiser","download_url":"https://codeload.github.com/BitlyTwiser/apprunner/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250221416,"owners_count":21394700,"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":[],"created_at":"2024-11-09T23:22:18.693Z","updated_at":"2025-04-22T10:33:52.993Z","avatar_url":"https://github.com/BitlyTwiser.png","language":"Zig","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e \n\n# Apprunner\n\u003cimg src=\"/assets/apprunner.jpg\" width=\"450\" height=\"500\"\u003e\n\u003c/div\u003e\n\nThe premise is simple: add commands to the yml file,run the program, get windows running your stuff! \n\nApprunner will build N number of named Tmux windows running the commands you provide. If given a path (and not standalone), the window will be opened at that directory location running the given command.\n\n# Prerequisites/Setup:\n1. You DO need Tmux for this: https://github.com/tmux/tmux/wiki\n2. Download the release for your system: https://github.com/BitlyTwiser/apprunner/releases\n3. Fill out the yaml\nexample:\n```\napps:\n  - name: test1\n    command: ping google.com\n    standalone: true\n    start_location: ./var/thing\n  - name: test2\n    command: ls -la\n    standalone: false \n    start_location: /var/log\n```\n3. run `./apprunner -config_path=\u003cpath_to_yaml_config\u003e`\n4. Terminal with your set commands will appear:\n![Screenshot](/assets/screenshot1.png)\n![Screenshot](/assets/screenshot2.png)\n\n# How it works:\n- This program executes tmux hooks to spawn a session, then add N number of windows to the session passing the keys to the given window. I.e. command -\u003e window -\u003e execute.\nExample from the CLI:\n```\ntmux new-session -s test_sesh \\; rename-window -t test_sesh:0 inner_window \\; send-keys -t test_sesh:inner_window 'echo \"hi\" |base64' enter\n```\nThis will spawn a new tmux session, create \u0026 rename the window, and run the command echoing hi to base64 encode.\n\n# Usage Examples:\nAside from the above example, here are some examples \n\nStandard configuration path\n```\n./zig-out/bin/apprunner -config_path=\"test_config.yml\"\n```\nrestore from Resurrect config file:\n``` \n./zig-out/bin/apprunner -restore=true\n```\nNote: restore will *ony* work if you have been running the application and you are using a Tmux version \u003e 1.9! The tmux commands that are necessary to dump the sessions do not exist prior to version 1.9.\n\n# Environment Variables\nIf you desire to insert a specific set of environment variables to the tmux session at runtime you can add the `env_path` to the yaml file.\nThe env will be loaded *per session*. For each app that is inserted, the values will be injected for that session.\nTHis is done using the `-e` flag from the tmux api.\n\nExample:\n```\napps:\n  - name: test1\n    command: ping google.com\n    standalone: true\n    start_location: ./var/thing\n  - name: test2\n    command: ls -la\n    standalone: false \n    start_location: /var/log\n    env_path: .env\n```\nNote the `env_path` value. This specifies that the .env file should be co-located next to the binary.\n\nYou can also use relative paths:\n```\napps:\n  - name: test1\n    command: ping google.com\n    standalone: true\n    start_location: ./var/thing\n  - name: test2\n    command: ls -la\n    standalone: false \n    start_location: /var/log\n    env_path: ../../.env\n```\n\nOr full absolute paths:\n```\napps:\n  - name: test1\n    command: ping google.com\n    standalone: true\n    start_location: ./var/thing\n  - name: test2\n    command: ls -la\n    standalone: false \n    start_location: /var/log\n    env_path: /home/place/.env\n```\n\n\n### Tmux Resurrect\nResurrect runs automatically unless disabled with the `-disabled=true` flag.\n\nexample:\n```\n./apprunner -config_path=\"\u003cfile_path\u003e\" -disabled=true\n```\n\nThis will print a warning that disabled is set and resurrect will not run.\n\nTo restore your session, just run:\n\n```\n./zig-out/bin/apprunner -restore=true\n```\n\n#### Config file storage:\nResurrect stores a config file at `$HOME/.tmux/resurrect/config.json`\n\nIf the $HOME env var is not set for some reason, then its stored at `/home/.tmux/resurrect/config.json`\n\nThe folder and file are created automatically at application runtime.\n\n#### Important Notes:\nApprunner will track user sessions that have been created within the apprunner session. It is important to note that this does *not* aply to *all* sessions that might be running!\n\nApprunner *only* tracks the sessions that was spawned with Apprunner (i.e. by running the program you spawn the session). If you make windows and panes *within* your apprunner sessions, those will also be captured. \n\nIf you create a new shell and start a *new* tmux sessions outside of app runner this would *not* be captured! Only the Apprunner sessions will be caught by the resurrect code :)\n\nIf the config.json file is removed, a new file will be created at runtime.\n\n\n## Roadmap:\n- [ ] Multi-pane per window support. Instead of windows only, allow for user to select a split pane layout (i.e. split pane horizontal/vertical etc..) in the Yaml file (Note - Resurrect will capture panes by default if they are created manually in the sessions)\n- [X] Save/Store runtime progress (like tmux resurrect)\n- [X] Env file loading (provide an .env and have the values loaded into the application)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitlytwiser%2Fapprunner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbitlytwiser%2Fapprunner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitlytwiser%2Fapprunner/lists"}