Lightweight process manager for local development
Dependencies
moon install tiye/redstart --path ./cmd/redstart# Initialize config in your project root
redstart init
# Add process definitions
redstart add server "yarn dev"
redstart add worker "yarn worker" --cwd ./packages/worker
redstart add api "python -m uvicorn main:app" --env "PORT=8000,DEBUG=1"
# Start everything
redstart start
# Watch status
redstart list
# Stream recent logs
redstart logs server
redstart logs server --stderr -n 100
# Stop everything
redstart stop| Command | Description |
|---|---|
| redstart init | Initialize redstart.json5 in current directory |
| redstart add <alias> <command> | Add a process definition (--cwd, --env KEY=VAL,...) |
| redstart remove <alias\|id> | Remove a stopped process |
| redstart start [alias\|id] | Start one or all stopped processes |
| redstart stop [alias\|id] | Stop one or all running processes |
| redstart restart <alias\|id> | Restart a process |
| redstart list [--json] | List all processes and their status |
| redstart status [alias\|id] [--json] | Show status (all or specific) |
| redstart logs <alias\|id> [-n N] [--stdout\|--stderr] | Show recent log output |
| redstart inspect <alias\|id> | Dump full process state as JSON |
| redstart wait <alias\|id> [-t seconds] | Block until process is running (useful in scripts/agents) |
| redstart doc [topic] | Show documentation overview or per-command reference |
{
version: "1",
processes: [
{
id: "abc123",
proc_name: "server",
command: "yarn dev",
cwd: "./packages/server",
env: { PORT: "3000" },
status: "stopped",
},
],
}# JSON list of all processes
redstart list --json
# Full state of one process as JSON
redstart inspect server
# Wait up to 60 seconds for a process to start, then proceed
redstart wait server -t 60 && curl http://localhost:3000/healthimport "tiye/redstart"
let config = @redstart.load_config()!
let entry = @redstart.find_process(config, "server")pub suberror RedstartError {
RedstartError(String)
}impl Show for RedstartErrorpub struct Config {
version : String
processes : Array[ProcessEntry]
} derive(ToJson, Debug, FromJson)impl Show for ProcessEntrypub struct ProcessInspectSnapshot {
process : ProcessEntry
process_group_members : Array[ProcessGroupMember]
child_processes : Array[ProcessGroupMember]
} derive(ToJson, Debug)fn config_file_exists() -> Boolfn generate_id(now_ts : Int64, seed : String) -> Stringfn is_process_alive(pid : Int) -> Boolfn list_process_group_members(proc : String, pgid : Int) -> Array[ProcessGroupMember] raise RedstartErrorfn new_process_entry(id : String, proc_name : String, command : String, cwd : String?, env : Map[String, String], created_at : String) -> ProcessEntryfn new_process_group_member(pid : Int, ppid : Int, pgid : Int, command : String) -> ProcessGroupMemberfn spawn_process(command : String, cwd : String, stdout_path : String, stderr_path : String) -> Int?fn stop_gracefully(pid : Int) -> UnitInstall
Download zipLightweight process manager for local development
Dependencies