Crates.io | shell-compose |
lib.rs | shell-compose |
version | 0.3.0 |
source | src |
created_at | 2024-10-03 07:49:55.433034 |
updated_at | 2024-10-13 21:24:14.093167 |
description | Lightweight background process runner for long-running or scheduled jobs |
homepage | https://pka.github.io/shell-compose/ |
repository | https://github.com/pka/shell-compose |
max_upload_size | |
id | 1394955 |
size | 3,302,472 |
Shell Compose is a lightweight background process runner for long-running or scheduled jobs.
* Scheduling - [x] Run background jobs from the command line - [x] Run multiple jobs in parallel - [x] Schedule commands to run like a cron job - [x] Start `just` recipes - [ ] Configure commands and cron jobs in a YAML file - [x] Support task dependencies (via Justfile) - [ ] Attach console to running job - [x] Restarting failed jobs - [ ] Trigger execution by file changes - [ ] Trigger execution by calling HTTP endpoint * Observability - [x] Show process status - [x] Show process resource usage - [x] Show logs of all running jobs - [x] Show logs of selected jobs - [ ] Metrics endpoint * Cross Platform - [x] Linux - [x] MacOS - [x] Windows
just
just is a command runner with syntax inspired by make
.
It supports shell commands but also other languages like Python or NodeJS.
Tasks can have dependencies and variables loaded from .env
files.
Example:
# Simulate data processing
[group('autostart')]
processing:
#!/usr/bin/env bash
echo Start processing
for i in {1..20}; do
echo processing step $i
sleep 1
done
echo Processing finished
# Serve current directory on port 8000
[group('autostart')]
serve:
#!/usr/bin/env python3
import http.server
server_address = ('localhost', 8000)
Handler = http.server.SimpleHTTPRequestHandler
with http.server.HTTPServer(server_address, Handler) as httpd:
print("Server started at http://%s:%s" % server_address, flush=True)
httpd.serve_forever()
Running a just
recipe:
shell-compose start processing
Running all recipes in a group:
shell-compose up autostart
We provide several options to access pre-built binaries for a variety of platforms. If you would like to manually download a pre-built binary, checkout the latest release on GitHub.
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/pka/shell-compose/releases/latest/download/shell-compose-installer.sh | sh
powershell -ExecutionPolicy ByPass -c "irm https://github.com/pka/shell-compose/releases/latest/download/shell-compose-installer.ps1 | iex"
cargo binstall shell-compose
For users who need to install shell-compose on platforms that we do not yet provide pre-built binaries for, you will need to build from source.
shell-compose
is written in Rust and uses cargo to build. Once you've installed the Rust toolchain (rustup
), run:
cargo install shell-compose --locked