Skip to content

snookish/pguard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

pguard

pguard is a simple CLI tool for running commands with optional timeouts and graceful shutdown, similar to Unix timeout.

Installation

go install github.com/iamBelugax/pguard@latest

Or build manually:

go build -o pguard

Usage

pguard [flags] <command> [args...]

Flags

  • --timeout – Maximum runtime (e.g. 10s, 1m). -1 means no timeout.
  • --graceful – Grace period before force kill (default: 5s).

Examples

Run a command with a timeout:

pguard --timeout=10s sleep 30

Gracefully stop a long-running process:

pguard --timeout=1m --graceful=10s my-command --foo bar

Behavior

  1. Starts the specified command.
  2. Waits for completion, timeout, or interrupt (Ctrl+C).
  3. Sends SIGINT for graceful shutdown.
  4. Force kills the process after the grace period if still running.

About

Run commands with timeouts and graceful shutdown, similar to Unix timeout.

Topics

Resources

Stars

Watchers

Forks

Contributors

Languages