unitup 0.1.5 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.1.5] - 2026-07-31
11
+
12
+ ### Fixed
13
+ - Fixed script argument resolution in all runtime adapters (`node`, `python`, `ruby`, `php`, `bun`, `deno`, `shell`, `go`, `elixir`, `native`) to resolve relative script paths against `opts.cwd` instead of `process.cwd()`.
14
+
10
15
  ## [0.1.4] - 2026-07-31
11
16
 
12
17
  ### Added
@@ -16,9 +21,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
16
21
  - Biome (`@biomejs/biome`) developer tool integration for code linting and formatting (`npm run check`, `npm run format`, `npm run lint`).
17
22
  - `CHANGELOG.md` tracking project release history and changes.
18
23
 
19
- ### Fixed
20
- - Fixed script argument resolution in all runtime adapters (`node`, `python`, `ruby`, `php`, `bun`, `deno`, `shell`, `go`, `elixir`, `native`) to resolve relative script paths against `opts.cwd` instead of `process.cwd()`.
21
-
22
24
  ## [0.1.3] - 2026-07-31
23
25
 
24
26
  ### Added
package/README.md CHANGED
@@ -1,20 +1,101 @@
1
1
  # unitup
2
2
 
3
- > Minimal, zero-dependency CLI & library to run Node.js, Python, Ruby, PHP, Bun, Deno, Go, Elixir, Shell scripts, and native binaries as `systemd` user services.
3
+ > Minimal, zero-dependency cross-platform background service manager for Node.js, Python, Ruby, PHP, Bun, Deno, Go, Elixir, Shell scripts, and native binaries.
4
4
 
5
- `unitup` provides a thin, user-level layer over Linux `systemd`. It does **not** create a custom daemon, manage process trees, or act as a PM2 alternative. Instead, it generates and manages native systemd user units (`~/.config/systemd/user/unitup-<name>.service`), letting systemd handle process supervision, auto-restarts, logging, and OS boot startup without requiring `sudo` privileges.
5
+ ## What is unitup?
6
+
7
+ `unitup` is a lightweight, zero-dependency CLI tool and programmatic library designed to run and manage background applications and services natively across:
8
+ * **Linux** → `systemd` (`~/.config/systemd/user/`)
9
+ * **macOS** → `launchd` (`~/Library/LaunchAgents/` & `/Library/LaunchDaemons/`)
10
+ * **Windows** → `Windows Services` (`sc.exe` + Unitup Service Host)
11
+
12
+ Unlike traditional process managers (such as PM2) that run a persistent master daemon continuously consuming system CPU and RAM, `unitup` operates **without a resident background process**. When you run `unitup install`, `unitup start`, or `unitup status`, it interacts directly with the operating system's native service manager and exits immediately.
13
+
14
+ ---
15
+
16
+ ## Platform Support Table
17
+
18
+ | Feature | Linux | macOS | Windows |
19
+ | :--- | :--- | :--- | :--- |
20
+ | **Install / Uninstall** | `systemd` user/system unit | `launchd` agent/daemon plist | Windows Service (`sc.exe`) |
21
+ | **Start / Stop** | `systemctl start/stop` | `launchctl kickstart/kill` | `sc.exe start/stop` |
22
+ | **Restart** | `systemctl restart` | `launchctl kickstart -k` | SCM restart |
23
+ | **Auto-start on Boot** | `systemctl enable` | `RunAtLoad: true` | Automatic service startup |
24
+ | **Environment Variables** | `Environment=` | `EnvironmentVariables` plist dict | Environment forwarding |
25
+ | **Logs** | `journalctl` | File-based tail streaming | File-based tail streaming |
26
+ | **Crash Recovery** | `Restart=on-failure` | `KeepAlive` dictionary | Host supervisor recovery |
27
+ | **User Services** | `~/.config/systemd/user/` | `~/Library/LaunchAgents/` | Supported |
28
+ | **System Services** | `/etc/systemd/system/` | `/Library/LaunchDaemons/` | Native Windows Service |
29
+ | **Dry-Run Inspection** | `--dry-run` (systemd unit) | `--dry-run` (plist XML) | `--dry-run` (service config) |
30
+ | **Diagnostics** | `unitup doctor` | `unitup doctor` | `unitup doctor` |
31
+
32
+ ---
33
+
34
+ ### Architecture & Workflow
35
+
36
+ ```mermaid
37
+ flowchart TD
38
+ CLI["unitup CLI / API"]
39
+ Manager["ServiceManager"]
40
+ Norm["NormalizedServiceConfig"]
41
+
42
+ CLI --> Manager
43
+ Manager --> Norm
44
+
45
+ subgraph Adapters["Platform Adapters"]
46
+ LinuxAdapt["LinuxAdapter<br/>(systemd)"]
47
+ MacAdapt["MacOSAdapter<br/>(launchd)"]
48
+ WinAdapt["WindowsAdapter<br/>(SCM / Host)"]
49
+ end
50
+
51
+ Norm --> LinuxAdapt
52
+ Norm --> MacAdapt
53
+ Norm --> WinAdapt
54
+
55
+ subgraph LinuxOS["Linux"]
56
+ ServiceFile["systemd Unit<br/>(.service & .timer)"]
57
+ Systemctl["systemctl & journalctl"]
58
+ LinuxAdapt --> ServiceFile --> Systemctl
59
+ end
60
+
61
+ subgraph MacOSOS["macOS"]
62
+ PlistFile["launchd Plist<br/>(.plist)"]
63
+ Launchctl["launchctl (bootstrap / kickstart)"]
64
+ MacAdapt --> PlistFile --> Launchctl
65
+ end
66
+
67
+ subgraph WindowsOS["Windows"]
68
+ SCM["Windows SCM (sc.exe)"]
69
+ WinHost["Unitup Service Host"]
70
+ WinAdapt --> SCM --> WinHost
71
+ end
72
+ ```
73
+
74
+ ---
75
+
76
+ ## Quick Start
6
77
 
7
78
  ```bash
8
- # Quick Start
79
+ # Install globally
9
80
  npm install -g unitup
10
81
 
11
- unitup add server.js --start
12
- unitup status server
13
- unitup logs server --follow
82
+ # Cross-platform installation
83
+ unitup install server.js --name api --start
84
+ unitup status api
85
+ unitup logs api --follow
86
+ unitup restart api
87
+ unitup stop api
88
+ unitup uninstall api
89
+
90
+ # Inspect what would be generated without applying changes
91
+ unitup install server.js --name api --dry-run
92
+
93
+ # Run cross-platform system diagnostics
94
+ unitup doctor
14
95
 
15
96
  # Multi-runtime & Native Executables
16
- unitup add worker.py --runtime python --start
17
- unitup add ./server --runtime native --name api --start
97
+ unitup install worker.py --runtime python --start
98
+ unitup install ./server --runtime native --name api --start
18
99
  ```
19
100
 
20
101
  ---
package/biome.json CHANGED
@@ -23,7 +23,6 @@
23
23
  "rules": {
24
24
  "recommended": true,
25
25
  "style": {
26
- "useConstStruct": "off",
27
26
  "noUnusedTemplateLiteral": "off"
28
27
  },
29
28
  "complexity": {