Categorygithub.com/mpmcintyre/process-party
repositorypackage
1.0.2
Repository: https://github.com/mpmcintyre/process-party.git
Documentation: pkg.go.dev

# Packages

No description provided by the author
No description provided by the author
No description provided by the author

# README

Process Party 🎉

Air 🤝 meets 🤝 Concurrently

Process Party is a powerful CLI tool that allows you to run and manage multiple processes simultaneously with unified standard output, interactive input capabilities, and file system triggers.

Features

  • Run multiple processes concurrently
  • Unified standard output
  • Interactive process management
  • File system watching and triggers
  • Process-to-process triggers
  • Color-coded output
  • Process status tracking
  • Input piping to specific or all processes

Installation

go install github.com/mpmcintyre/process-party

Usage

Configuration File

Process Party supports configuration files in three formats:

  • YAML (.yaml or .yml)
  • JSON (.json)
  • TOML (.toml)
# Basic usage
process-party ./path/to/config.yaml

# Or with JSON or TOML
process-party ./path/to/config.json
process-party ./path/to/config.toml

Generate a template configuration file

# Basic usage
process-party ./path/to/config-template.yaml -g

or

process-party ./path/to/config-template.yaml --generate

# Or with JSON or TOML
process-party ./path/to/config.json -g
process-party ./path/to/config.toml -g

Inline Commands

# Multiple execute flags are supported
process-party ./path/to/config.yaml -e "npm run start" --execute "cmd echo hello"

Global Configuration Options

OptionTypeDescriptionDefault
show_timestampboolDisplay timestamps for outputfalse

Process Configuration Options

OptionTypeDescriptionPossible Values
namestringUnique name for the processAny string
commandstringCommand to executeAny valid shell command
args[]stringArguments for the commandList of strings
prefixstringPrefix for output linesAny string
colorstringOutput color for the process prefixyellow, blue, green, red, cyan, white, magenta
on_failurestringAction on process failurebuzzkill, wait, restart
on_completestringAction on process completionbuzzkill, wait, restart
show_pidboolDisplay process IDtrue/false
silentboolMute output from commandtrue/false
delayintInitial delay before startingMilliseconds
restart_delayintDelay before restartingMilliseconds
restart_attemptsintNumber of restart attempts before exitingInteger (negative implies always restart)
triggertriger configConfiguration for triggering the processSee trigger config

Actions on process failure/exit

ActionDescription
buzzkillStop all running processes and exit
waitExit quitely and wait for all remaining processes/triggers to complete
restartRestart the process until no restart attempts remain

Trigger config

OptionTypeDescriptionPossible Values
run_on_startboolRuns the process on starting process partytrue/false
restart_processboolEnd old process on new trigger and start againtrue/false
filesystemfilesystem trigger optionsOptions for triggering on a filesystem eventSee FS trigger optons
processstringOptions for triggering on another process's stateSee Process trigger optons

File System Trigger Options

OptionTypeDescriptionPossible Values
non_recursiveboolDo not watch subdirectories when createdtrue/false
watch[]stringDirectories/files to watchList of paths
ignore[]stringDirectories/files to ignoreList of paths
filter_for[]stringFile patterns to include/excludeList of patterns

Process Trigger Options

OptionTypeDescriptionPossible Values
on_start[]stringTrigger when these processes startList of process names
on_complete[]stringTrigger when these processes completeList of process names
on_error[]stringTrigger when these processes errorList of process names

Example Configuration

# Global settings
indicate_every_line: true # Show prefix on every line
no_timestamp: true # Show timestamps in output

processes:
  - name: "web-server" # Process name
    command: "npm" # Command to run
    args: ["start"] # Command arguments
    prefix: "web" # Output prefix
    color: "green" # Prefix color
    show_pid: true # Show process ID in output

    # Process behavior
    delay: 0 # Startup delay in milliseconds
    restart_attempts: 0 # Number of restart attempts (-1 for infinite)
    restart_delay: 0 # Delay before restart
    on_failure: "buzzkill" # Exit behavior on failure (kill all processes)
    on_complete: "wait" # Exit behavior on complete (kill all processes)

    # File system triggers
    trigger:
      run_on_start: false
      restart_process: true
      filesystem:
        watch: ["./src"] # Directories to watch
        ignore: ["node_modules"] # Directories to ignore
        filter_for: [".js", ".jsx"] # File filters
        non_recursive: false # Watch subdirectories

      # Process triggers
      process:
        on_start: ["database"] # Run when these processes start
        on_complete: [] # Run when these processes complete
        on_error: [] # Run when these processes error

  - name: "database"
    command: "mongod"
    prefix: "db"
    color: "blue"
    on_failure: "buzzkill" # Exit behavior on failure (kill all processes)

Interactive CLI Usage

When running Process Party, you can interact with processes using these commands:

  • all:<input>: Send input to all running processes
  • <process-name>:<input> or <process-prefix>:<input>: Send input to a specific process
  • status or s: Display status of all processes
  • exit: Terminate all processes
  • help: Show available commands

Example

# Start Process Party
process-party ./config.yaml

# Send input to all processes
> all:start

# Send input to a specific process
> web-server:reload

# Check process status
> status

# Exit
> exit

Exit Statuses

StatusDescription
runningProcess is active
exitedProcess completed normally
failedProcess encountered an error
restartingProcess is being restarted

License

MIT

Author

Michael