diff options
| author | diogo464 <[email protected]> | 2025-06-19 08:52:20 +0100 |
|---|---|---|
| committer | diogo464 <[email protected]> | 2025-06-19 08:52:20 +0100 |
| commit | 39b3d9bfd499e131fd8a9bd1bf0021b62ec18c53 (patch) | |
| tree | 9975c7d92f28ed19edc370c7e11473f56334629c /GOAL.md | |
Initial implementation of demon CLI tool
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 <[email protected]>
Diffstat (limited to 'GOAL.md')
| -rw-r--r-- | GOAL.md | 35 |
1 files changed, 35 insertions, 0 deletions
| @@ -0,0 +1,35 @@ | |||
| 1 | # project goals | ||
| 2 | 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. | ||
| 3 | here is an overview of the subcommands the tool should provide and their usage: | ||
| 4 | |||
| 5 | ## demon run | ||
| 6 | ``` | ||
| 7 | # the identifier is a required argument | ||
| 8 | # all remaining arguments will be used to spawn the process with the first one being the executable name | ||
| 9 | # three files should be created `.pid`, `.stdout`, `.stderr` | ||
| 10 | # the cli tool should exit immediatly but the spawned process should be left running the background | ||
| 11 | demon run --id <identifier> <command...> | ||
| 12 | |||
| 13 | # example usage | ||
| 14 | demon run --id npm-dev npm run dev | ||
| 15 | # this should create the files `npm-dev.pid`, `npm-dev.stdout` and `npm-dev.stderr` | ||
| 16 | # if the pid file already exists and the process is still running you should fail with a descriptive error message | ||
| 17 | ``` | ||
| 18 | |||
| 19 | ## demon stop | ||
| 20 | ``` | ||
| 21 | # this should kill the process if it is running, otherwise do nothing | ||
| 22 | demon stop --id <id> | ||
| 23 | ``` | ||
| 24 | |||
| 25 | ## demon tail | ||
| 26 | ``` | ||
| 27 | # this should tail both .stderr and .stdout files by default, or just the selected ones | ||
| 28 | demon tail [--stdout] [--stderr] --id <id> | ||
| 29 | ``` | ||
| 30 | |||
| 31 | ## demon cat | ||
| 32 | ``` | ||
| 33 | # this should cat both files or just the selected ones | ||
| 34 | demon cat [--stdout] [--stderr] --id <id> | ||
| 35 | ``` | ||
