{"id":48549415,"url":"https://github.com/processwatch/agent","last_synced_at":"2026-04-08T08:00:59.729Z","repository":{"id":323585972,"uuid":"1088407239","full_name":"ProcessWatch/agent","owner":"ProcessWatch","description":"Cross-platform process monitor with auto-restart, TUI dashboard, and headless daemon mode.","archived":false,"fork":false,"pushed_at":"2026-04-08T06:04:54.000Z","size":5838,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-08T08:00:32.576Z","etag":null,"topics":["auto-restart","bubble-tea","cli","cross-platform","go","process-monitor","tui"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ProcessWatch.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-11-02T22:40:33.000Z","updated_at":"2026-04-08T06:01:27.000Z","dependencies_parsed_at":null,"dependency_job_id":"987c9d97-4799-415a-aa5e-d324ace0fd31","html_url":"https://github.com/ProcessWatch/agent","commit_stats":null,"previous_names":["ethan-mdev/service-watch","ethan-mdev/process-watch","processwatch/agent"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/ProcessWatch/agent","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ProcessWatch%2Fagent","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ProcessWatch%2Fagent/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ProcessWatch%2Fagent/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ProcessWatch%2Fagent/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ProcessWatch","download_url":"https://codeload.github.com/ProcessWatch/agent/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ProcessWatch%2Fagent/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31545906,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-07T16:28:08.000Z","status":"online","status_checked_at":"2026-04-08T02:00:06.127Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["auto-restart","bubble-tea","cli","cross-platform","go","process-monitor","tui"],"created_at":"2026-04-08T08:00:29.162Z","updated_at":"2026-04-08T08:00:59.718Z","avatar_url":"https://github.com/ProcessWatch.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ProcessWatch\n![version](https://img.shields.io/badge/version-2.2-blue)\n![go](https://img.shields.io/badge/Go-1.25+-00ADD8?logo=go\u0026logoColor=white)\n![platform](https://img.shields.io/badge/platform-Windows%20|%20Linux%20|%20macOS-lightgrey)\n![license](https://img.shields.io/badge/license-MIT-green)\n\nA cross-platform process monitor with auto-restart capabilities, a terminal UI dashboard, and a headless daemon mode.\n\n![TUI Dashboard](screenshots/dashboard.png)\n\n## Features\n\n- **TUI Dashboard** — Real-time process status with live CPU, memory, and PID tracking\n- **Headless Mode** — Run as a background daemon for unattended monitoring\n- **Auto-Restart** — Automatically restart crashed processes with configurable cooldowns and retry limits\n- **PID Pinning** — Tracks processes by PID with name-based fallback for reliable liveness detection\n- **Process Picker** — Browse and filter all running system processes to add to your watchlist\n- **Event Log Viewer** — Browse and filter structured logs directly within the TUI\n- **Structured Logging** — JSONL event log with automatic rotation (10MB max, 5 backups, 7-day retention)\n- **Cross-Platform** — Works on Windows, Linux, and macOS\n- **Discord Alerts** — Optional Discord webhook alerts on process status change\n\n## Quick Start\n\n### Prerequisites\n\n- Go 1.25+ (to build from source)\n\n### Build \u0026 Run\n\n```bash\ngit clone https://github.com/ethan-mdev/process-watch.git\ncd process-watch\ngo build -o process-watch .\n```\n\nLaunch the TUI:\n\n```bash\n./process-watch\n```\n\nOr run in headless/daemon mode:\n\n```bash\n./process-watch --headless\n```\n\n\u003e **Note:** Headless mode requires an existing watchlist. Run the TUI first to set one up.\n\n## Usage\n\n### TUI Controls\n\n| Key | Action |\n|-----|--------|\n| `a` | Add a process to the watchlist |\n| `d` | Remove selected process (with confirmation) |\n| `r` | Restart selected process (with confirmation) |\n| `v` | Toggle debug info panel |\n| `e` | Open event log viewer |\n| `q` | Quit |\n\nOn startup, the TUI will prompt you to load an existing watchlist or start fresh.\n\n![TUI Welcome](screenshots/welcome.png)\n\n### Adding a Process\n\nPress `a` to open the process picker, which lists all running system processes. Use `/` to filter. Select a process and configure its restart command, max retries, cooldown, and auto-restart setting.\n\n![TUI Add Screen](screenshots/add.png)\n\n### Event Log Viewer\n\nPress `e` from the main dashboard to open the event log viewer. All events from the current log file are loaded on open. Use `/` to filter by event type, process name, or any data field. Press `q` to return to the dashboard.\n\n### Configuration\n\n`config.yaml` is created automatically on first run with sensible defaults:\n\n```yaml\nmetricsPort: 9090\npollIntervalSecs: 5\nrestartVerifyDelaySecs: 3   # seconds to wait after restart before checking health\nlogLevel: info              # info | debug\nalerts:\n  enabled: false\n  discordWebhookURL: \"\"     # ex: https://discord.com/api/webhooks/\u003cid\u003e/\u003ctoken\u003e\n  projectLabel: \"process-watch\"\n```\n\n| Option | Description | Default |\n|--------|-------------|---------|\n| `metricsPort` | Port for metrics endpoint (planned) | `9090` |\n| `pollIntervalSecs` | How often to check process status | `5` |\n| `restartVerifyDelaySecs` | Delay after restart before verifying health | `3` |\n| `logLevel` | Log verbosity (`info` or `debug`) | `info` |\n\n### Discord Alerts\n\nProcessWatch can send real-time alerts to a Discord channel when monitored processes crash, fail to restart, or recover. Alerts are sent asynchronously and do not block the monitoring loop.\n\nTo enable alerts, edit the `alerts` section in `config.yaml`:\n\n```yaml\nalerts:\n  enabled: true\n  discordWebhookURL: \"https://discord.com/api/webhooks/YOUR_WEBHOOK_URL\"\n  projectLabel: \"process-watch\"\n```\n\n| Option | Description | Required |\n|--------|-------------|----------|\n| `enabled` | Enable/disable Discord alerting | Yes |\n| `discordWebhookURL` | Discord webhook URL for alert delivery | Yes (if enabled) |\n| `projectLabel` | Label displayed in alert messages | No (defaults to `process-watch`) |\n\n**Webhook URL:** Create a Discord webhook in your server's channel settings, then copy the full URL.\n\n**Alert Events:**\n- Process crashed and detected as down\n- Restart command failed to execute\n- Max retries exceeded (process permanently stopped)\n- Restart verified successful (process recovered)\n\n![Discord Alert Example](screenshots/discord-alert-example.png)\n\n### Watchlist\n\nThe watchlist is stored in `watchlist.json` next to the executable. Each entry tracks:\n\n- Process name and restart command\n- Auto-restart toggle\n- Max retries and cooldown period\n- Restart/failure counters and last restart timestamp\n\n### Logs\n\nEvents are logged to `logs/events.jsonl` in structured JSON format. Log rotation is automatic.\n\n## Project Structure\n\n```\nprocess-watch/\n├── main.go                        # Entry point, CLI flags, wiring\n├── screenshots/                   # Screenshots for README\n└── internal/\n    ├── config/config.go           # Config loading and validation\n    ├── core/\n    │   ├── types.go               # Core data types\n    │   └── contracts.go           # Interfaces (ProcessManager, WatchlistManager)\n    ├── logger/logger.go           # JSONL logger with rotation\n    ├── monitor/watcher.go         # Polling loop, liveness checks, auto-restart\n    ├── process/manager.go         # OS process operations via gopsutil\n    ├── storage/watchlist.go       # JSON-backed watchlist persistence\n    └── tui/\n        ├── app.go                 # Bubble Tea bootstrap\n        ├── model.go               # Top-level TUI model and routing\n        └── views/\n            ├── welcome.go         # Startup screen\n            ├── list.go            # Main dashboard view\n            ├── picker.go          # Process picker and add form\n            └── logs.go            # Event log viewer\n```\n\n## Roadmap\n\n### v2.3 — Config Hot-Reload\nPick up `config.yaml` changes without restarting the application.\n\n### v2.4 — Multi-stage failure policies, process grouping/tagging\n\n### v3.0 — Remote reporting + web dashboard\n\n## License\n\nMIT License — see [LICENSE](LICENSE) for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprocesswatch%2Fagent","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprocesswatch%2Fagent","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprocesswatch%2Fagent/lists"}