3 Commits
Author SHA1 Message Date
valknar 90d68f2510 Fix prettier formatting
CI / Publish to npm registry (push) Successful in 49s
CI / Checks (push) Successful in 47s
CI caught this on the v1.1.0 tag push - format:check wasn't run locally before committing.
2026-08-19 18:10:28 +02:00
valknar 1fa8c5ba66 Bump version to 1.1.0
CI / Checks (push) Failing after 45s
CI / Publish to npm registry (push) Skipped
2026-08-19 18:07:35 +02:00
valknar b291a119d5 Emit raw JSON from service logs via journalctl -o cat
Strips journalctl's own prefix so each line is pino's raw JSON payload, pipeable into jq for pretty-printing without pulling pino-pretty into runtime dependencies.
2026-08-19 18:06:06 +02:00
5 changed files with 10 additions and 8 deletions
+1 -1
View File
@@ -113,7 +113,7 @@ the script — always as a discrete argv element or env var, never interpolated
| `triggershell service install [--system]` | Install a systemd unit that runs `triggershell start` (per-user by default, Linux only) |
| `triggershell service uninstall [--system]` | Stop, disable, and remove the systemd unit |
| `triggershell service status [--system]` | Show the systemd unit's status |
| `triggershell service logs [-n LINES] [--no-follow] [--system]` | Tail the systemd unit's logs (wraps `journalctl`) |
| `triggershell service logs [-n LINES] [--no-follow] [--system]` | Tail the systemd unit's logs (wraps `journalctl -o cat`, so each line is raw JSON - pipe through `jq` for pretty-printing) |
### Running scripts from the CLI
+3 -1
View File
@@ -76,7 +76,9 @@ targets `/etc/systemd/system/` instead and prints the `sudo` commands to run if
explicit `systemctl --user enable --now triggershell`, since it's the point where the service
actually starts listening and running scripts. `triggershell service status`/`uninstall`/`logs` are
thin wrappers around `systemctl`/`journalctl` respectively - no unit-file parsing or log storage of
our own, journald already does that.
our own, journald already does that. `logs` passes `-o cat` so each line is the raw pino JSON
payload rather than journalctl's own timestamp/hostname/unit prefix - pipeable straight into `jq`
for pretty-printing without pulling `pino-pretty` into the CLI's runtime dependencies.
## Cross-module-graph state
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "triggershell",
"version": "1.0.4",
"version": "1.1.0",
"license": "MIT",
"type": "module",
"repository": {
+3 -1
View File
@@ -137,7 +137,9 @@ export async function serviceLogsCommand(
): Promise<void> {
const scope = scopeOf(opts);
const args = scope === "user" ? ["--user"] : [];
args.push("-u", SERVICE_NAME);
// -o cat strips journalctl's own prefix (timestamp/hostname/unit) so each line is the raw pino
// JSON payload - pipeable straight into `jq` or similar without journalctl's wrapper in the way.
args.push("-u", SERVICE_NAME, "-o", "cat");
if (opts.follow !== false) args.push("-f");
if (opts.lines !== undefined) args.push("-n", String(opts.lines));
+2 -4
View File
@@ -184,10 +184,8 @@ service
service
.command("logs")
.description("Tail the systemd unit's logs (journalctl).")
.option(
"-n, --lines <n>",
"Number of recent log lines to show.",
(v) => Number(v),
.option("-n, --lines <n>", "Number of recent log lines to show.", (v) =>
Number(v),
)
.option(
"--no-follow",