This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
This is @wilmoore/dev - a development server management tool with process monitoring, health checks, and log management. It's a CLI tool built with TypeScript that helps developers manage multiple development servers in a single project.
# Run the dev tool
npm start
# Format code
npm run format
npm run format:checkThe codebase is a self-contained TypeScript CLI:
dev.ts- Main CLI script (~1200 lines, all-in-one)notify.ts- Native OS notification utility using node-notifier
- Servers are defined in
.dev/servers.jsonwith command, preferredPort, and healthCheck - Template variables:
{PORT}for dynamic port assignment,{ROLE}for server name - Automatic server inference from package.json scripts during
init
- PID tracking in
.dev/pid.jsonwith port, startTime, and status - Automatic port conflict resolution (tries ports sequentially)
- Health checks before marking servers as successfully started
- Process cleanup and stale entry detection
- Centralized logging in
.dev/log/directory - Configurable log viewers via
--log-viewerflag orDEV_LOG_VIEWERenvironment variable
bin/
├── dev.ts # Main CLI script
└── notify.ts # Notification utility
assets/
└── logo-banner.png # Logo for README and notifications
.dev/ # Runtime directory (created in target projects)
├── servers.json # Server configuration (tracked in git)
├── pid.json # Process tracking (gitignored)
└── log/ # Log files (gitignored)
- Built for Node.js >= 18.0.0
- Targets macOS and Linux platforms only
- Uses ES modules (type: "module" in package.json)
- Runs TypeScript directly via
tsx(no compilation step) - Dependencies:
node-notifierfor OS notifications,tsxfor TypeScript execution
- Server commands are executed via shell (
sh -c) to handle redirection - Process detection uses
psandlsofcommands for Unix-like systems - Health checks are HTTP-based with configurable endpoints and exponential backoff
- Port detection attempts to discover actual listening ports from running processes
- Process tree killing ensures all child processes are cleaned up