### Install Process Compose with Custom Directory Source: https://f1bonacc1.github.io/process-compose/installation Installs Process Compose using the provided script, specifying a custom installation directory. Examples include '~/.local/bin' for user-specific installs or '/usr/local/bin' for system-wide installs. ```shell sh -c "$(curl --location https://raw.githubusercontent.com/F1bonacc1/process-compose/main/scripts/get-pc.sh)" -- -d -b ~/.local/bin ``` -------------------------------- ### Install Process Compose with Go Source: https://f1bonacc1.github.io/process-compose/installation Installs Process Compose using the Go programming language's build tools. This method requires Go to be installed on the system and compiles the binary locally. ```go go install github.com/f1bonacc1/process-compose@latest ``` -------------------------------- ### Start Processes Serially with Dependencies Source: https://f1bonacc1.github.io/process-compose/launcher Configure processes to start in a specific order using `depends_on`. This example shows process1 depending on process2, and process2 depending on process3, with success conditions. ```yaml processes: process1: command: "sleep 3" depends_on: process2: condition: process_completed_successfully # or "process_completed" if you don't care about errors process2: command: "sleep 3" depends_on: process3: condition: process_completed_successfully # or "process_completed" if you don't care about errors ``` -------------------------------- ### Install Go Dependencies Source: https://f1bonacc1.github.io/process-compose/contributing After cloning the repository and navigating into the directory, run this command to install or update Go module dependencies. ```bash go mod tidy ``` -------------------------------- ### Start Namespaces Command Source: https://f1bonacc1.github.io/process-compose/cli/process-compose_namespace Starts all processes within a specified namespace. ```bash process-compose namespace start ``` -------------------------------- ### Run Example Configuration Source: https://f1bonacc1.github.io/process-compose/mcp-server Execute a process-compose configuration file to see an example of multiple tool types, resource endpoints, and process integrations. ```bash process-compose -f examples/mcp-example.yaml ``` -------------------------------- ### Example Environment Command Configuration Source: https://f1bonacc1.github.io/process-compose/configuration Example configuration for env_cmds, mapping variable names to shell commands. ```yaml env_cmds: DATE: "date" OS_NAME: "awk -F= '/PRETTY/ {print $2}' /etc/os-release" UPTIME: "uptime -p" ``` -------------------------------- ### Database Backup Example Source: https://f1bonacc1.github.io/process-compose/scheduled-processes A complete example of a scheduled database backup process, including command, schedule, timezone, and working directory. ```yaml processes: db-backup: command: "pg_dump -U postgres mydb > /backups/mydb-$(date +%Y%m%d).sql" schedule: cron: "0 3 * * *" # Daily at 3 AM timezone: "UTC" working_dir: "/app" ``` -------------------------------- ### Start Namespace CLI Source: https://f1bonacc1.github.io/process-compose/configuration Command to start a specific namespace by its name. ```bash process-compose namespace start ``` -------------------------------- ### Install Process Compose with Default Directory Source: https://f1bonacc1.github.io/process-compose/installation Installs Process Compose using the provided script. By default, it installs to the './bin' directory relative to the current working directory. ```shell sh -c "$(curl --location https://raw.githubusercontent.com/F1bonacc1/process-compose/main/scripts/get-pc.sh)" -- -d ``` -------------------------------- ### Process Compose CLI Help Option Source: https://f1bonacc1.github.io/process-compose/cli/process-compose_process_start Displays help information for the 'start' command. ```bash -h, --help help for start ``` -------------------------------- ### Start a Process with process-compose CLI Source: https://f1bonacc1.github.io/process-compose/cli/process-compose_process_start Use this command to initiate a process managed by process-compose. Specify the process name to start. ```bash process-compose process start [PROCESS] [flags] ``` -------------------------------- ### Help Flag for Start Command Source: https://f1bonacc1.github.io/process-compose/cli/process-compose_namespace_start Use this flag to display help information specific to the 'start' command within the namespace context. ```bash -h, --help help for start ``` -------------------------------- ### Process Compose Process Get Command Options Source: https://f1bonacc1.github.io/process-compose/cli/process-compose_process_get These are the specific options for the 'get' command, including help and output formatting. ```bash -h, --help help for get -o, --output string Output format. One of: (json, wide (default)) ``` -------------------------------- ### Example process-compose.yaml configuration Source: https://f1bonacc1.github.io/process-compose/launcher Defines three processes with dependencies and commands. This serves as a base for demonstrating various run commands. ```yaml processes: process1: command: "echo 'Hi from Process1'" depends_on: process2: condition: process_completed_successfully process2: command: "echo 'Hi from Process2'" process3: command: "echo 'Hi from Process3'" ``` -------------------------------- ### Start Processes in Parallel Source: https://f1bonacc1.github.io/process-compose/launcher Define multiple processes that will start concurrently. Each process has a description and a command to execute. ```yaml processes: process1: description: This process will sleep for 2 seconds command: "sleep 2" process2: description: This process will sleep for 3 seconds command: "sleep 3" ``` -------------------------------- ### Start Subset of Namespaces Source: https://f1bonacc1.github.io/process-compose/configuration Specify which namespaces to start using the -n flag. Only the listed namespaces will run and be visible. ```bash process-compose -n ns1 -n ns3 # will start only ns1 and ns3. ns2 namespace won't run and won't be visible in the TUI ``` -------------------------------- ### Process Compose Namespace Start Command Source: https://f1bonacc1.github.io/process-compose/cli/process-compose_namespace_start This is the basic command to start all processes in a given namespace. Replace '[namespace]' with the actual namespace name. ```bash process-compose namespace start [namespace] [flags] ``` -------------------------------- ### Multi-Value Configuration Merge Example (Environment) Source: https://f1bonacc1.github.io/process-compose/merge Illustrates how multi-value options like 'environment' are merged, with locally-defined values taking precedence. ```yaml processes: myprocess: # ... environment: - "A=3" - "C=8" ``` ```yaml processes: myprocess: # ... environment: - "A=4" - "B=5" ``` ```yaml processes: myprocess: # ... environment: - "A=4" - "B=5" - "C=8" ``` -------------------------------- ### Configure Readiness Probe with HTTP Get Source: https://f1bonacc1.github.io/process-compose/health This snippet shows how to set up a readiness probe for a process using an 'http_get' request. It checks the health of a web server by sending an HTTP GET request to a specific port and path. This is suitable for processes that expose an HTTP interface. ```yaml processes: nginx: command: "docker run -d --rm -p80:80 --name nginx_test nginx" is_daemon: true shutdown: command: "docker stop nginx_test" readiness_probe: http_get: host: 127.0.0.1 scheme: http path: "/" port: 80 initial_delay_seconds: 5 period_seconds: 10 timeout_seconds: 5 success_threshold: 1 failure_threshold: 3 ``` -------------------------------- ### Run on Startup Configuration Source: https://f1bonacc1.github.io/process-compose/scheduled-processes Enable a scheduled process to run immediately when process-compose starts, in addition to its regular schedule. ```yaml processes: health-check: command: "./check-health.sh" schedule: interval: "5m" run_on_start: true # Run immediately, then every 5 minutes ``` -------------------------------- ### Example of process-compose command with multiple configuration files Source: https://f1bonacc1.github.io/process-compose/merge Demonstrates how to use multiple configuration files with process-compose, including the use of 'extends'. The shorter command allows for a more concise way to achieve the same result as loading multiple files. ```bash $ process-compose -f ./some/dir/process-compose.yaml -f ./some/dir/process-compose.prod.yaml ``` ```bash $ process-compose -f ./some/dir/process-compose.prod.yaml ``` -------------------------------- ### Running process-compose Source: https://f1bonacc1.github.io/process-compose/intro Execute the process-compose command to start your defined services. You can run it from the directory containing your configuration file or specify the file path directly. ```bash process-compose -f /path/to/process-compose.yaml ``` -------------------------------- ### Process Compose Recipe List Command Synopsis Source: https://f1bonacc1.github.io/process-compose/cli/process-compose_recipe_list This is the basic command to list all locally installed recipes. ```bash process-compose recipe list [flags] ``` -------------------------------- ### Synopsis of process-compose up Source: https://f1bonacc1.github.io/process-compose/cli/process-compose_up This is the basic command structure for running all processes managed by process-compose. You can optionally specify individual process names to start only those and their dependencies. ```bash process-compose up [PROCESS...] [flags] ``` -------------------------------- ### Claude Desktop Client Configuration Source: https://f1bonacc1.github.io/process-compose/mcp-server Example configuration for Claude Desktop to run process-compose via stdio transport. ```json { "mcpServers": { "process-compose": { "command": "process-compose", "args": ["-f", "/path/to/your/process-compose.yaml"] } } } ``` -------------------------------- ### Get Help Information Source: https://f1bonacc1.github.io/process-compose/client Display the help message for the process-compose command, showing available options and subcommands. ```bash process-compose --help ``` -------------------------------- ### Restart a Process Source: https://f1bonacc1.github.io/process-compose/client Stop and then start a specified process. A default backoff of 1 second is used between stop and start. ```bash process-compose process restart [PROCESS] #restarts one of the available processes ``` -------------------------------- ### Run specific processes with dependencies Source: https://f1bonacc1.github.io/process-compose/launcher Starts specified processes along with all their required dependencies. Dependencies are resolved and executed in order. ```bash process-compose up process1 process3 # will run 'process1', 'process3' and all of their dependencies - 'process2' ``` -------------------------------- ### Single-Value Configuration Override Example Source: https://f1bonacc1.github.io/process-compose/merge Demonstrates how a single-value configuration option like 'command' is replaced when defined in both original and local processes. ```yaml processes: myprocess: # ... command: python app.py ``` ```yaml processes: myprocess: # ... command: python otherapp.py ``` ```yaml processes: myprocess: # ... command: python otherapp.py ``` -------------------------------- ### Install Process Compose with Homebrew Source: https://f1bonacc1.github.io/process-compose/installation Installs Process Compose on macOS and Linux systems using the Homebrew package manager. This is a convenient method for users who already utilize Homebrew. ```shell brew install f1bonacc1/tap/process-compose ``` -------------------------------- ### Start a Specific Process Source: https://f1bonacc1.github.io/process-compose/client Initiate the execution of a single non-running process by specifying its name. ```bash process-compose process start [PROCESS] #starts one of the available non running processes ``` -------------------------------- ### Install Bash Completions for macOS Source: https://f1bonacc1.github.io/process-compose/cli/process-compose_completion_bash For macOS users, install bash autocompletions for all new sessions by redirecting the output to the appropriate directory using 'brew --prefix'. ```bash process-compose completion bash > $(brew --prefix)/etc/bash_completion.d/process-compose ``` -------------------------------- ### Install Zsh Completions on Linux Source: https://f1bonacc1.github.io/process-compose/cli/process-compose_completion_zsh Generate the autocompletion script and save it to the zsh site-functions directory for permanent availability on Linux. ```zsh process-compose completion zsh > "${fpath[1]}/_process-compose" ``` -------------------------------- ### Run specific processes without dependencies Source: https://f1bonacc1.github.io/process-compose/launcher Starts specified processes directly, ignoring any defined dependencies. This is useful for isolated testing. ```bash process-compose up process1 process3 --no-deps # will run 'process1', 'process3' without any dependencies ``` -------------------------------- ### Define Environment Commands Source: https://f1bonacc1.github.io/process-compose/configuration Configure environment commands in 'env_cmds' to dynamically populate environment variables before processes start. ```yaml env_cmds: ENV_VAR_NAME: "command to execute" ``` -------------------------------- ### Process Compose Process Get Command Syntax Source: https://f1bonacc1.github.io/process-compose/cli/process-compose_process_get This is the basic syntax for the 'process-compose process get' command. Replace [PROCESS] with the target process name. ```bash process-compose process get [PROCESS] [flags] ``` -------------------------------- ### ASCII Dependency Graph Output Source: https://f1bonacc1.github.io/process-compose/graph Example of the default ASCII tree output for the process dependency graph. ```text Dependency Graph └── frontend [Pending] └── api-server [Running] ├── postgres [Running] └── redis [Running] ``` -------------------------------- ### CLI Graph Command Examples Source: https://f1bonacc1.github.io/process-compose/graph Use the 'graph' command to display the dependency tree in various formats. Default is ASCII, but Mermaid, JSON, and YAML are also supported. ```bash # Display a beautiful ASCII tree (default) process-compose graph ``` ```bash # Export to Mermaid flowchart format process-compose graph --format mermaid ``` ```bash # Get the raw graph data in JSON or YAML process-compose graph --format json process-compose graph --format yaml ``` -------------------------------- ### Process Log Ready Example Source: https://f1bonacc1.github.io/process-compose/launcher Wait for a specific log line from a dependency process to determine readiness. The `ready_log_line` parameter defines the target log message. ```yaml processes: world: command: "echo Connected" depends_on: hello: condition: process_log_ready hello: command: | echo 'Preparing...' sleep 1 echo 'I am ready to accept connections now' ready_log_line: "ready to accept connections" # equal to *.ready to accept connections.* regex ``` -------------------------------- ### process-compose up Command Options Source: https://f1bonacc1.github.io/process-compose/cli/process-compose_up These options control how processes are started, configured, and displayed when using the 'up' command. They include configuration file paths, detachment modes, environment variable loading, and TUI settings. ```bash -f, --config stringArray path to config files to load (env: PC_CONFIG_FILES) --detach-on-success detach the process-compose TUI after successful startup. Requires --detached-with-tui -D, --detached run process-compose in detached mode --detached-with-tui run process-compose in detached mode with TUI --disable-dotenv disable .env file loading (env: PC_DISABLE_DOTENV=1) --dry-run validate the config and exit -e, --env stringArray path to env files to load (default [.env]) -h, --help help for up -d, --hide-disabled hide disabled processes (env: PC_HIDE_DISABLED_PROC) --keep-project keep the project running even after all processes exit --logs-truncate truncate process logs buffer on startup -n, --namespace stringArray run only specified namespaces (default all, env: PC_NAMESPACES) --no-deps don't start dependent processes --recursive-metrics collect metrics recursively (env: PC_RECURSIVE_METRICS) -r, --ref-rate duration TUI refresh interval in seconds or as a Go duration string (e.g. 1s) (default 1) -R, --reverse sort in reverse order --shortcuts stringArray paths to shortcut config files to load (env: PC_SHORTCUTS_FILES) (default [/home//.config/process-compose/shortcuts.yml]) --slow-ref-rate duration Slow(er) refresh interval for resources (CPU, RAM) in seconds or as a Go duration string (e.g. 1s). The value should be higher than --ref-rate (default 1) -S, --sort string sort column name. legal values (case insensitive): [AGE, CPU, EXIT, HEALTH, MEM, NAME, NAMESPACE, PID, RESTARTS, STATUS] (default "NAME") --theme string select process compose theme (default "Default") -t, --tui enable TUI (disable with -t=false) (env: PC_DISABLE_TUI) (default true) ``` -------------------------------- ### Install Zsh Completions on macOS Source: https://f1bonacc1.github.io/process-compose/cli/process-compose_completion_zsh Generate the autocompletion script and save it to the zsh site-functions directory using brew prefix for permanent availability on macOS. ```zsh process-compose completion zsh > $(brew --prefix)/share/zsh/site-functions/_process-compose ``` -------------------------------- ### Install Bash Completions for Linux Source: https://f1bonacc1.github.io/process-compose/cli/process-compose_completion_bash To make bash autocompletions available for all new sessions on Linux, redirect the output of 'process-compose completion bash' to a file in '/etc/bash_completion.d/'. ```bash process-compose completion bash > /etc/bash_completion.d/process-compose ``` -------------------------------- ### Custom TUI Shortcuts Configuration Source: https://f1bonacc1.github.io/process-compose/tui Example of a custom `shortcuts.yaml` file where only specific shortcuts and descriptions are overridden. Default values are used for unspecified shortcuts. ```yaml # $XDG_CONFIG_HOME/process-compose/shortcuts.yaml shortcuts: process_stop: description: Terminate quit: shortcut: F3 ``` -------------------------------- ### Configure foreground process Source: https://f1bonacc1.github.io/process-compose/launcher Configures a process to run in the foreground, requiring manual start and full TTY access. Useful for interactive applications. ```yaml processes: vim: command: "vim process-compose.yaml" is_foreground: true ``` -------------------------------- ### Define .env File Content Source: https://f1bonacc1.github.io/process-compose/configuration Example content for a .env file, showcasing key-value pairs for configuration. These variables can be used to override or set environment variables. ```dotenv VERSION='1.2.3' DB_USER='USERNAME' DB_PASSWORD='VERY_STRONG_PASSWORD' WAIT_SEC=60 ``` -------------------------------- ### Process Compose Project State Help Options Source: https://f1bonacc1.github.io/process-compose/cli/process-compose_project_state Displays help information for the 'state' subcommand, listing available flags. ```bash process-compose project state -h ``` -------------------------------- ### Disable a process Source: https://f1bonacc1.github.io/process-compose/launcher Marks a process as disabled, preventing it from starting automatically. The process can still be started manually. ```yaml processes: process_name: command: "ls -R /" disabled: true #default false ``` -------------------------------- ### Process Compose Recipe Help Options Source: https://f1bonacc1.github.io/process-compose/cli/process-compose_recipe Displays help information for the 'recipe' command. Use this to see available subcommands and their options. ```bash -h, --help help for recipe ``` -------------------------------- ### Disable Scheduled Process Source: https://f1bonacc1.github.io/process-compose/scheduled-processes Prevent a scheduled process from starting automatically by setting `disabled: true`. The schedule is paused until the process is manually started. ```yaml processes: manual-backup: command: "./backup.sh" disabled: true schedule: cron: "0 2 * * *" # Only starts running after first manual start ``` -------------------------------- ### Print version and build info Source: https://f1bonacc1.github.io/process-compose/cli/process-compose_version Use this command to display the current version and build details of process-compose. It accepts flags to modify the output. ```bash process-compose version [flags] ``` -------------------------------- ### Process Compose Completion Help Source: https://f1bonacc1.github.io/process-compose/cli/process-compose_completion Displays help information for the process-compose completion command. ```bash process-compose completion --help ``` -------------------------------- ### Version command options Source: https://f1bonacc1.github.io/process-compose/cli/process-compose_version These flags are specific to the 'version' command. Use '--help' for general help. ```bash -h, --help help for version -s, --short Print only version ``` -------------------------------- ### Sample process-compose.yaml Configuration Source: https://f1bonacc1.github.io/process-compose/intro This YAML file defines the structure and dependencies of multiple processes for an imaginary system. It includes global environment variables, log settings, and detailed configurations for each process, including their commands, restart policies, and inter-process dependencies. ```yaml version: "0.5" environment: - "GLOBAL_ENV_VAR=1" log_location: /path/to/combined/output/logfile.log log_level: debug processes: Manager: command: "/path/to/manager" availability: restart: "always" depends_on: ClientA: condition: process_started ClientB: condition: process_started ClientA: command: "/path/to/ClientA" availability: restart: "always" depends_on: Server_1A: condition: process_started Server_2A: condition: process_started environment: - "LOCAL_ENV_VAR=1" ClientB: command: "/path/to/ClientB -some -arg" availability: restart: "always" depends_on: Server_1B: condition: process_started Server_2B: condition: process_started environment: - "LOCAL_ENV_VAR=2" Server_1A: command: "/path/to/Server_1A" availability: restart: "always" Server_2A: command: "/path/to/Server_2A" availability: restart: "always" Server_1B: command: "/path/to/Server_1B" availability: restart: "always" Server_2B: command: "/path/to/Server_2B" availability: restart: "always" ``` -------------------------------- ### Generate Bash Completion Script Source: https://f1bonacc1.github.io/process-compose/cli/process-compose_completion_bash This command generates the autocompletion script for the bash shell. It requires the 'bash-completion' package to be installed. ```bash process-compose completion bash ``` -------------------------------- ### Deploying with Production Configuration Source: https://f1bonacc1.github.io/process-compose/merge Command to deploy a process-compose application using a specific production configuration file alongside the base configuration. ```bash $ process-compose -f process-compose.yml -f process-compose.prod.yml ``` -------------------------------- ### List Available Processes Source: https://f1bonacc1.github.io/process-compose/client Use the client command to list all available processes managed by Process Compose. ```bash process-compose process list #lists available processes ``` -------------------------------- ### MCP Inspector with SSE Transport Source: https://f1bonacc1.github.io/process-compose/mcp-server Commands to start process-compose with SSE enabled and connect the MCP Inspector to the SSE endpoint. ```bash # Start process-compose with MCP enabled (SSE default) process-compose -f your-config.yaml # In another terminal, connect inspector to the SSE endpoint npx @modelcontextprotocol/inspector http://localhost:3000/sse ``` -------------------------------- ### Interval-Based Scheduling Configuration Source: https://f1bonacc1.github.io/process-compose/scheduled-processes Configure a process to run at fixed intervals using Go duration syntax. Optionally run immediately on startup. ```yaml processes: periodic-cleanup: command: "./cleanup.sh" schedule: interval: "30m" # Run every 30 minutes run_on_start: true # Also run immediately on startup ``` -------------------------------- ### Process Compose Scale Command Options Source: https://f1bonacc1.github.io/process-compose/cli/process-compose_process_scale Help options for the scale command. Use '-h' or '--help' to display them. ```bash -h, --help help for scale ``` -------------------------------- ### Process Compose Run Command Options Source: https://f1bonacc1.github.io/process-compose/cli/process-compose_run Available options for the 'run' command, including configuration file paths, disabling dotenv, help, and managing dependencies. ```bash -f, --config stringArray path to config files to load (env: PC_CONFIG_FILES) --disable-dotenv disable .env file loading (env: PC_DISABLE_DOTENV=1) -h, --help help for run --no-deps don't start dependent processes ``` -------------------------------- ### Process Compose Info Command Options Source: https://f1bonacc1.github.io/process-compose/cli/process-compose_info Displays the available options for the 'process-compose info' command, including help. ```bash -h, --help help for info ``` -------------------------------- ### Attach to Remote TUI Client Source: https://f1bonacc1.github.io/process-compose/client Run the process-compose client in a fully remote TUI mode, useful when process-compose is started in headless mode. ```bash process-compose attach ``` -------------------------------- ### Help Option for Restart Command Source: https://f1bonacc1.github.io/process-compose/cli/process-compose_namespace_restart Displays help information for the 'process-compose namespace restart' command. ```bash -h, --help help for restart ``` -------------------------------- ### Process Compose Project is-Ready Command Options Source: https://f1bonacc1.github.io/process-compose/cli/process-compose_project_is-ready This snippet shows the specific options for the 'is-ready' command, including the --wait flag to poll for readiness. ```bash -h, --help help for is-ready --wait Wait for the project to be ready instead of exiting with an error ``` -------------------------------- ### Synopsis of process-compose recipe pull Source: https://f1bonacc1.github.io/process-compose/cli/process-compose_recipe_pull This is the basic command structure for pulling a recipe. Replace '[recipe-name]' with the actual name of the recipe you want to download. ```bash process-compose recipe pull [recipe-name] [flags] ``` -------------------------------- ### GET /graph Source: https://f1bonacc1.github.io/process-compose/graph Retrieves the process dependency graph as a recursive JSON structure. The response contains a map of 'leaf' nodes and their full dependency trees. ```APIDOC ## GET /graph ### Description Retrieves the process dependency graph, which is represented as a recursive JSON structure. The response includes a `nodes` map, where each entry signifies a 'leaf' node (a process not depended upon by any other process) and its complete dependency tree. ### Method GET ### Endpoint /graph ### Response #### Success Response (200) - **nodes** (object) - A map where keys are leaf process names and values are their recursive dependency trees. ### Request Example ```bash curl localhost:8080/graph ``` ### Response Example ```json { "nodes": { "leaf_process_name_1": { "name": "leaf_process_name_1", "status": "Running", "dependencies": [ { "name": "dependency_1", "status": "Completed", "dependencies": [] } ] } } } ``` ``` -------------------------------- ### Process Compose Recipe Show Synopsis Source: https://f1bonacc1.github.io/process-compose/cli/process-compose_recipe_show Displays the synopsis for the 'process-compose recipe show' command, including its arguments and basic usage. ```bash process-compose recipe show [recipe-name] [flags] ``` -------------------------------- ### Process Compose Project State Command Source: https://f1bonacc1.github.io/process-compose/cli/process-compose_project_state The basic command to get the state of a Process Compose project. Use this to query the current status of your project. ```bash process-compose project state [flags] ``` -------------------------------- ### Configure background (daemon) process Source: https://f1bonacc1.github.io/process-compose/launcher Sets up a process to run in the background using `is_daemon: true`. Requires a custom shutdown command for termination. ```yaml processes: nginx: command: "docker run -d --rm --name nginx_test nginx" # note the '-d' for detached mode is_daemon: true # this flag is required for background processes (default false) launch_timeout_seconds: 2 # default 5s shutdown: command: "docker stop nginx_test" timeout_seconds: 10 # default 10 signal: 15 # default 15, but only if command is not defined or empty ``` -------------------------------- ### Process Compose Ports Command Help Options Source: https://f1bonacc1.github.io/process-compose/cli/process-compose_process_ports This snippet shows the help flag for the 'ports' subcommand, indicating how to get more information about this specific command. ```bash -h, --help help for ports ``` -------------------------------- ### Update Project Configuration Source: https://f1bonacc1.github.io/process-compose/configuration Apply changes to your `process-compose.yaml` file without restarting the entire project. This command stops and starts affected processes based on the modifications. ```bash process-compose project update -f process-compose.yaml ``` -------------------------------- ### Process Compose Info Command Help Flag Source: https://f1bonacc1.github.io/process-compose/cli/process-compose_info Use the help flag with the 'process-compose info' command to see available options. ```bash process-compose info --help ``` -------------------------------- ### Configuration Inheritance with 'extends' Source: https://f1bonacc1.github.io/process-compose/merge Shows how the `extends` keyword simplifies configuration file inheritance by referencing another configuration file. ```yaml # ./some/dir/process-compose.prod.yaml version: "0.5" extends: "process-compose.yaml" processes: ``` -------------------------------- ### Base configuration file with a disabled process Source: https://f1bonacc1.github.io/process-compose/merge Defines a process that is initially disabled in a base configuration file. This serves as a starting point for demonstrating override scenarios. ```yaml processes: my_process: command: "echo 'running process'" disabled: true ``` -------------------------------- ### List Namespaces Command Source: https://f1bonacc1.github.io/process-compose/cli/process-compose_namespace Lists all available namespaces managed by process-compose. ```bash process-compose namespace list ``` -------------------------------- ### Scale Process on the Fly (CLI) Source: https://f1bonacc1.github.io/process-compose/launcher Command-line interface command to scale a specific process to a desired number of replicas. ```bash process-compose process scale process_name 3 ``` -------------------------------- ### Process Compose Namespace List Command Source: https://f1bonacc1.github.io/process-compose/cli/process-compose_namespace_list Basic command to list all available namespaces. ```bash process-compose namespace list [flags] ``` -------------------------------- ### Process Compose Process Get Inherited Parent Command Options Source: https://f1bonacc1.github.io/process-compose/cli/process-compose_process_get These options are inherited from parent commands and control the connection to the process compose server, logging, and operational modes. ```bash -a, --address string address of the target process compose server (default "localhost") -L, --log-file string Specify the log file path (env: PC_LOG_FILE) (default "/tmp/process-compose-.log") --log-no-color disable color output in the log file (env: PC_LOG_NO_COLOR) --no-server disable HTTP server (env: PC_NO_SERVER) --ordered-shutdown shut down processes in reverse dependency order -p, --port int port number (env: PC_PORT_NUM) (default 8080) --read-only enable read-only mode (env: PC_READ_ONLY) --token-file string path to a file containing the API token (env: PC_API_TOKEN_PATH) -u, --unix-socket string path to unix socket (env: PC_SOCKET_PATH) (default "/tmp/process-compose-.sock") -U, --use-uds use unix domain sockets instead of tcp ``` -------------------------------- ### Override configuration file attempting to enable a process Source: https://f1bonacc1.github.io/process-compose/merge An example of an override configuration file attempting to enable a process that was disabled in the base configuration. This highlights the potential issues with boolean merging. ```yaml processes: my_process: # Attempt to enable the process disabled: false ``` -------------------------------- ### REST API Graph Endpoint Source: https://f1bonacc1.github.io/process-compose/graph Access the dependency graph via the REST API using the GET /graph endpoint. The response is a JSON object containing process nodes and their dependencies. ```bash curl localhost:8080/graph ``` -------------------------------- ### Synopsis for Recipe Search Source: https://f1bonacc1.github.io/process-compose/cli/process-compose_recipe_search The basic command structure for searching recipes. Use this to understand the fundamental syntax. ```bash process-compose recipe search [query] [flags] ``` -------------------------------- ### Build Process Compose Binary Source: https://f1bonacc1.github.io/process-compose/contributing Build the executable binary for Process Compose. This command is used after setting up the environment and dependencies. ```bash make build ``` -------------------------------- ### Truncate Command Help Options Source: https://f1bonacc1.github.io/process-compose/cli/process-compose_process_logs_truncate Displays help information specific to the truncate command. ```bash process-compose process logs truncate -h, --help help for truncate ``` -------------------------------- ### Process Compose Analyze Options Source: https://f1bonacc1.github.io/process-compose/cli/process-compose_analyze Lists available options for the 'process-compose analyze' command, including logging, server, and shutdown configurations. ```bash --address string address to listen on (env: PC_ADDRESS) (default "localhost") -L, --log-file string Specify the log file path (env: PC_LOG_FILE) (default "/tmp/process-compose-.log") --log-no-color disable color output in the log file (env: PC_LOG_NO_COLOR) --no-server disable HTTP server (env: PC_NO_SERVER) --ordered-shutdown shut down processes in reverse dependency order -p, --port int port number (env: PC_PORT_NUM) (default 8080) --read-only enable read-only mode (env: PC_READ_ONLY) --token-file string path to a file containing the API token (env: PC_API_TOKEN_PATH) -u, --unix-socket string path to unix socket (env: PC_SOCKET_PATH) (default "/tmp/process-compose-.sock") -U, --use-uds use unix domain sockets instead of tcp ``` -------------------------------- ### Process Compose Project is-Ready Command Usage Source: https://f1bonacc1.github.io/process-compose/cli/process-compose_project_is-ready This is the basic usage of the 'is-ready' command. It checks if the project is ready without waiting. ```bash process-compose project is-ready [flags] ``` -------------------------------- ### Specify Configuration Files Source: https://f1bonacc1.github.io/process-compose/configuration Explicitly define which configuration files to use with the `-f` flag. This allows for precise control over the loaded configuration. ```bash process-compose -f "path/to/process-compose-file.yaml" ``` -------------------------------- ### Run all processes Source: https://f1bonacc1.github.io/process-compose/launcher Executes all defined processes in the process-compose.yaml file. Dependencies are resolved and executed in order. ```bash process-compose up # will run all the processes - equal to 'process-compose' ``` -------------------------------- ### Process Compose Recipe Show Flags Source: https://f1bonacc1.github.io/process-compose/cli/process-compose_recipe_show Lists the specific flags available for the 'process-compose recipe show' command, such as help and syntax highlighting. ```bash -h, --help help for show -s, --syntax-highlight Highlight the recipe yaml syntax ``` -------------------------------- ### Help Flag for Namespace List Source: https://f1bonacc1.github.io/process-compose/cli/process-compose_namespace_list Use the help flag to display information about the 'list' command. ```bash -h, --help help for list ``` -------------------------------- ### List Namespaces CLI Source: https://f1bonacc1.github.io/process-compose/configuration Command to list all available namespaces. Aliases 'ns ls' are also supported. ```bash process-compose namespace list # or use those aliases process-compose ns ls ``` -------------------------------- ### Process Compose Project CLI Options Source: https://f1bonacc1.github.io/process-compose/cli/process-compose_project These are the specific options available for the 'process-compose project' command. Use '-a' to set the target server address. ```bash -a, --address string address of the target process compose server (default "localhost") -h, --help help for project ``` -------------------------------- ### Process Compose Restart Command Help Flags Source: https://f1bonacc1.github.io/process-compose/cli/process-compose_process_restart Displays help information for the restart command. This is useful for understanding all available options specific to restarting a process. ```bash process-compose process restart --help ``` -------------------------------- ### Environment Commands for Resource Information Source: https://f1bonacc1.github.io/process-compose/configuration Fetch resource information such as available memory and CPU core count using env_cmds. ```yaml env_cmds: AVAILABLE_MEMORY: "free -m | awk '/Mem:/ {print $7}'" CPU_CORES: "nproc" ``` -------------------------------- ### Specify Custom .env Files Source: https://f1bonacc1.github.io/process-compose/configuration Command-line arguments to specify custom .env files to be loaded. This allows for different environment configurations (e.g., local, development). ```bash process-compose -e .env -e .env.local -e .env.dev ``` -------------------------------- ### Environment Commands for System Information Source: https://f1bonacc1.github.io/process-compose/configuration Use env_cmds to capture system information like hostname and kernel version. ```yaml env_cmds: HOSTNAME: "hostname" KERNEL_VERSION: "uname -r" ``` -------------------------------- ### Help Flag for Version Update Source: https://f1bonacc1.github.io/process-compose/cli/process-compose_version_update Use the help flag to display information about the update command's options. ```bash -h, --help help for update ``` -------------------------------- ### Analyze Command Help Source: https://f1bonacc1.github.io/process-compose/cli/process-compose_analyze Displays help information for the 'analyze' subcommand. ```bash -h, --help help for analyze ``` -------------------------------- ### Compile from Source with Nix Source: https://f1bonacc1.github.io/process-compose/installation Compiles and runs Process Compose directly from the latest source code using the Nix package manager. This is useful for development or testing unreleased changes. ```shell # or to compile from the latest source nix run github:F1bonacc1/process-compose -- --help ``` -------------------------------- ### Override configuration to reliably enable a process using 'is_disabled' Source: https://f1bonacc1.github.io/process-compose/merge Demonstrates the recommended way to enable a process in an override file by using 'is_disabled: "false"'. This method reliably overcomes the boolean merging ambiguity. ```yaml processes: my_process: # Use is_disabled as a string to reliably enable is_disabled: "false" ``` -------------------------------- ### Database Query Tool Configuration Source: https://f1bonacc1.github.io/process-compose/mcp-server Configures a process to execute SQL queries against a database using psql. Requires a 'query' argument. ```yaml processes: query-db: command: "psql -d mydb -c \"@{query}\"" description: "Execute a database query" disabled: true working_dir: "/app" mcp: type: tool arguments: - name: query type: string description: "SQL query to execute" required: true ``` -------------------------------- ### Process Compose Run Command Syntax Source: https://f1bonacc1.github.io/process-compose/cli/process-compose_run Basic syntax for running a process using process-compose. Command line arguments for the process are passed after '--'. ```bash process-compose run PROCESS [flags] -- [process_args] ``` -------------------------------- ### Process Compose Inherited Parent Command Options Source: https://f1bonacc1.github.io/process-compose/cli/process-compose_project_is-ready These are options inherited from parent commands that can be used with 'process-compose project is-ready'. They control server address, logging, and connection methods. ```bash -a, --address string address of the target process compose server (default "localhost") -L, --log-file string Specify the log file path (env: PC_LOG_FILE) (default "/tmp/process-compose-.log") --log-no-color disable color output in the log file (env: PC_LOG_NO_COLOR) --no-server disable HTTP server (env: PC_NO_SERVER) --ordered-shutdown shut down processes in reverse dependency order -p, --port int port number (env: PC_PORT_NUM) (default 8080) --read-only enable read-only mode (env: PC_READ_ONLY) --token-file string path to a file containing the API token (env: PC_API_TOKEN_PATH) -u, --unix-socket string path to unix socket (env: PC_SOCKET_PATH) (default "/tmp/process-compose-.sock") -U, --use-uds use unix domain sockets instead of tcp ``` -------------------------------- ### Process Compose Info Command Usage Source: https://f1bonacc1.github.io/process-compose/cli/process-compose_info Basic usage of the 'process-compose info' command to display configuration details. ```bash process-compose info [flags] ``` -------------------------------- ### Configure Custom Backend Shell Source: https://f1bonacc1.github.io/process-compose/configuration Configure a custom backend shell directly in the `process-compose.yaml` file when an environment variable is insufficient. Ensure the shell command is in your PATH. ```yaml version: "0.5" shell: shell_command: "python3" shell_argument: "-m" processes: http: command: "server.py" ``` -------------------------------- ### Local Process Variables with Go Templates Source: https://f1bonacc1.github.io/process-compose/configuration Define per-process variables using Go templates for use in command, log location, and environment settings. ```yaml processes: watcher: vars: LOG_LOCATION: "./watcher.log" OK: SUCCESS PRE: 2 POST: 8 BASH: "/bin/bash" command: "sleep {{.PRE}} && echo {{.OK}} && sleep {{.POST}}" log_location: {{.LOG_LOCATION}} environment: - 'SHELL={{.BASH}}' readiness_probe: exec: command: "grep -q {{.OK}} {{.LOG_LOCATION}}" initial_delay_seconds: 1 period_seconds: 1 timeout_seconds: 1 success_threshold: 1 ``` -------------------------------- ### Create Personal Automation Hub with AI Access Source: https://f1bonacc1.github.io/process-compose/blog Expose personal scripts and commands as 'tool' or 'resource' types in process-compose for AI accessibility. This includes file operations, script execution, and system monitoring. ```yaml processes: backup-photos: command: "rsync -av ~/Photos/ backup-server:/photos/ && echo '{"status": "success", "files_copied": '$(rsync -av --dry-run ~/Photos/ backup-server:/photos/ | grep -c 'uptodate')'}}'" mcp: type: tool organize-downloads: command: "python ~/scripts/organize_downloads.py @{folder} --output-format json" mcp: type: tool arguments: - name: folder type: string description: "Folder path to organize" check-disk-space: command: "df -h / | tail -1 | awk '{print \"{\\\"filesystem\\\":\\\"\" $1 \"\\\",\\\"size\\\":\\\"\" $2 \"\\\",\\\"used\\\":\\\"\" $3 \"\\\",\\\"available\\\":\\\"\" $4 \"\\\",\\\"percent\\\":\\\"\" $5 \"\\\"}\"}'" mcp: type: resource ``` -------------------------------- ### Help Flag for Namespace Command Source: https://f1bonacc1.github.io/process-compose/cli/process-compose_namespace Displays help information for the namespace command. This is a standard flag for most CLI commands. ```bash -h, --help help for namespace ``` -------------------------------- ### Run Latest Binary Release with Nix Source: https://f1bonacc1.github.io/process-compose/installation Executes the latest binary release of Process Compose using the Nix package manager. This command is useful for quickly testing or using the most recent stable version. ```shell # to use the latest binary release nix run nixpkgs/master#process-compose -- --help ``` -------------------------------- ### Process Compose Analyze Critical Chain Command Source: https://f1bonacc1.github.io/process-compose/cli/process-compose_analyze_critical-chain This is the basic command structure for analyzing the critical chain of process startups. You can optionally specify process names as arguments to filter the output. ```bash process-compose analyze critical-chain [process...] [flags] ``` -------------------------------- ### Process Compose CLI Options Source: https://f1bonacc1.github.io/process-compose/cli/process-compose Detailed list of command-line flags for configuring process-compose, including environment variable overrides and default values. ```bash --address string address to listen on (env: PC_ADDRESS) (default "localhost") -f, --config stringArray path to config files to load (env: PC_CONFIG_FILES) --detach-on-success detach the process-compose TUI after successful startup. Requires --detached-with-tui -D, --detached run process-compose in detached mode --detached-with-tui run process-compose in detached mode with TUI --disable-dotenv disable .env file loading (env: PC_DISABLE_DOTENV=1) --dry-run validate the config and exit -e, --env stringArray path to env files to load (default [.env]) -h, --help help for process-compose -d, --hide-disabled hide disabled processes (env: PC_HIDE_DISABLED_PROC) --keep-project keep the project running even after all processes exit -L, --log-file string Specify the log file path (env: PC_LOG_FILE) (default "/tmp/process-compose-.log") --log-no-color disable color output in the log file (env: PC_LOG_NO_COLOR) --logs-truncate truncate process logs buffer on startup -n, --namespace stringArray run only specified namespaces (default all, env: PC_NAMESPACES) --no-server disable HTTP server (env: PC_NO_SERVER) --ordered-shutdown shut down processes in reverse dependency order -p, --port int port number (env: PC_PORT_NUM) (default 8080) --read-only enable read-only mode (env: PC_READ_ONLY) --recursive-metrics collect metrics recursively (env: PC_RECURSIVE_METRICS) -r, --ref-rate duration TUI refresh interval in seconds or as a Go duration string (e.g. 1s) (default 1) -R, --reverse sort in reverse order --shortcuts stringArray paths to shortcut config files to load (env: PC_SHORTCUTS_FILES) (default [/home//.config/process-compose/shortcuts.yml]) --slow-ref-rate duration Slow(er) refresh interval for resources (CPU, RAM) in seconds or as a Go duration string (e.g. 1s). The value should be higher than --ref-rate (default 1) -S, --sort string sort column name. legal values (case insensitive): [AGE, CPU, EXIT, HEALTH, MEM, NAME, NAMESPACE, PID, RESTARTS, STATUS] (default "NAME") --theme string select process compose theme (default "Default") --token-file string path to a file containing the API token (env: PC_API_TOKEN_PATH) -t, --tui enable TUI (disable with -t=false) (env: PC_DISABLE_TUI) (default true) --tui-fs enable TUI full screen (env: PC_TUI_FULL_SCREEN=1) -u, --unix-socket string path to unix socket (env: PC_SOCKET_PATH) (default "/tmp/process-compose-.sock") -U, --use-uds use unix domain sockets instead of tcp ``` -------------------------------- ### Configure Liveness Probe with Exec Command Source: https://f1bonacc1.github.io/process-compose/health This snippet demonstrates configuring a liveness probe for a daemon process using an 'exec' command to check if a Docker container is running. Ensure the 'is_daemon' property is set to true for daemon processes. ```yaml processes: nginx: command: "docker run -d --rm -p80:80 --name nginx_test nginx" is_daemon: true shutdown: command: "docker stop nginx_test" signal: 15 timeout_seconds: 5 liveness_probe: exec: command: "[ $(docker inspect -f '{{.State.Running}}' nginx_test) = 'true' ]" working_dir: /tmp # if not specified the process working dir will be used initial_delay_seconds: 5 period_seconds: 2 timeout_seconds: 5 success_threshold: 1 failure_threshold: 3 ```