From 39b3d9bfd499e131fd8a9bd1bf0021b62ec18c53 Mon Sep 17 00:00:00 2001 From: diogo464 Date: Thu, 19 Jun 2025 08:52:20 +0100 Subject: Initial implementation of demon CLI tool MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Implement complete daemon process management CLI with the following features: - demon run: spawn background processes with stdout/stderr redirection - demon stop: graceful process termination with SIGTERM/SIGKILL timeout - demon tail: real-time file watching and log tailing - demon cat: display log file contents - demon list: show all managed processes with status - demon status: detailed process information - demon clean: remove orphaned files from dead processes Technical implementation: - Uses clap for CLI with enum-based subcommands - Structured logging with tracing crate - File watching with notify crate for efficient tailing - Process management with proper signal handling - Creates .pid, .stdout, .stderr files in working directory - Comprehensive error handling and edge case coverage 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- GOAL.md | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 GOAL.md (limited to 'GOAL.md') diff --git a/GOAL.md b/GOAL.md new file mode 100644 index 0000000..acee5b2 --- /dev/null +++ b/GOAL.md @@ -0,0 +1,35 @@ +# project goals +the goal of this project is to create a cli tool named `demon` that should be used to spawn background processes and redirect their stdout and stderr to files. +here is an overview of the subcommands the tool should provide and their usage: + +## demon run +``` +# the identifier is a required argument +# all remaining arguments will be used to spawn the process with the first one being the executable name +# three files should be created `.pid`, `.stdout`, `.stderr` +# the cli tool should exit immediatly but the spawned process should be left running the background +demon run --id + +# example usage +demon run --id npm-dev npm run dev +# this should create the files `npm-dev.pid`, `npm-dev.stdout` and `npm-dev.stderr` +# if the pid file already exists and the process is still running you should fail with a descriptive error message +``` + +## demon stop +``` +# this should kill the process if it is running, otherwise do nothing +demon stop --id +``` + +## demon tail +``` +# this should tail both .stderr and .stdout files by default, or just the selected ones +demon tail [--stdout] [--stderr] --id +``` + +## demon cat +``` +# this should cat both files or just the selected ones +demon cat [--stdout] [--stderr] --id +``` -- cgit