@plogme/cdlog
v0.1.0
Published
Crysnova process supervisor and PM2-style terminal monitor
Maintainers
Readme
cdlog ⚉
Crysnova's lightweight, dependency-free Node.js process supervisor and PM2-style terminal monitor. It is designed for CODY and other Crysnova services without requiring PM2.
Install
npm install -g @plogme/cdlogRun a service
cdlog start --name cody --cwd /opt/cody --health http://127.0.0.1:9000/api/health -- node index.js
cdlog status cody
cdlog monit cody
cdlog logs cody
cdlog restart cody
cdlog stop codycdlog start detaches a supervisor. The supervisor launches the child service, forwards output into .cdlog/logs/, persists state atomically, restarts crashes with bounded exponential backoff, enters crash-loop protection after repeated failures, forwards signals, and can restart a process after repeated health-check failures.
Press q in monit to exit the monitor without stopping the service. Press r to request a graceful restart.
Safety behavior
- Manual
stopprevents automatic restart. - Crash restarts are bounded by
--max-restartswithin a rolling window. - SIGTERM is forwarded first; SIGKILL is used only after the shutdown timeout.
- State is stored under
<service cwd>/.cdlog/. - Logs rotate when they exceed the configured limit in the library API.
- The supervisor is separate from the child process, so a child crash cannot take down the supervisor.
Library
const { Supervisor } = require('@plogme/cdlog');
const supervisor = new Supervisor({
name: 'cody',
cwd: '/opt/cody',
command: process.execPath,
args: ['index.js'],
healthUrl: 'http://127.0.0.1:9000/api/health'
});
await supervisor.start();
await supervisor.monitor();This is an early production-focused release. Test it on a staging CODY instance before using it for an important deployment.
