From 7e95cfebd20d853a3a24b472c3d2fdf115a764d3 Mon Sep 17 00:00:00 2001 From: Berger Eugene Date: Sat, 27 Jul 2024 18:35:41 +0300 Subject: [PATCH] feat #202: Added CLI to the documentation --- Makefile | 9 ++- go.mod | 2 + go.sum | 2 + src/cmd/docs.go | 27 +++++++++ www/docs/cli/process-compose.md | 45 ++++++++++++++ www/docs/cli/process-compose_attach.md | 38 ++++++++++++ www/docs/cli/process-compose_completion.md | 38 ++++++++++++ .../cli/process-compose_completion_bash.md | 57 ++++++++++++++++++ .../cli/process-compose_completion_fish.md | 48 +++++++++++++++ .../process-compose_completion_powershell.md | 45 ++++++++++++++ .../cli/process-compose_completion_zsh.md | 59 +++++++++++++++++++ www/docs/cli/process-compose_down.md | 33 +++++++++++ www/docs/cli/process-compose_info.md | 32 ++++++++++ www/docs/cli/process-compose_process.md | 36 +++++++++++ www/docs/cli/process-compose_process_list.md | 34 +++++++++++ www/docs/cli/process-compose_process_logs.md | 35 +++++++++++ www/docs/cli/process-compose_process_ports.md | 33 +++++++++++ .../cli/process-compose_process_restart.md | 33 +++++++++++ www/docs/cli/process-compose_process_scale.md | 33 +++++++++++ www/docs/cli/process-compose_process_start.md | 33 +++++++++++ www/docs/cli/process-compose_process_stop.md | 33 +++++++++++ www/docs/cli/process-compose_project.md | 30 ++++++++++ www/docs/cli/process-compose_project_state.md | 34 +++++++++++ www/docs/cli/process-compose_run.md | 40 +++++++++++++ www/docs/cli/process-compose_up.md | 48 +++++++++++++++ www/docs/cli/process-compose_version.md | 32 ++++++++++ www/docs/contributing.md | 40 ++++++++++++- www/docs/sponsors.md | 17 ++++++ www/mkdocs.yml | 14 +++++ 29 files changed, 958 insertions(+), 2 deletions(-) create mode 100644 src/cmd/docs.go create mode 100644 www/docs/cli/process-compose.md create mode 100644 www/docs/cli/process-compose_attach.md create mode 100644 www/docs/cli/process-compose_completion.md create mode 100644 www/docs/cli/process-compose_completion_bash.md create mode 100644 www/docs/cli/process-compose_completion_fish.md create mode 100644 www/docs/cli/process-compose_completion_powershell.md create mode 100644 www/docs/cli/process-compose_completion_zsh.md create mode 100644 www/docs/cli/process-compose_down.md create mode 100644 www/docs/cli/process-compose_info.md create mode 100644 www/docs/cli/process-compose_process.md create mode 100644 www/docs/cli/process-compose_process_list.md create mode 100644 www/docs/cli/process-compose_process_logs.md create mode 100644 www/docs/cli/process-compose_process_ports.md create mode 100644 www/docs/cli/process-compose_process_restart.md create mode 100644 www/docs/cli/process-compose_process_scale.md create mode 100644 www/docs/cli/process-compose_process_start.md create mode 100644 www/docs/cli/process-compose_process_stop.md create mode 100644 www/docs/cli/process-compose_project.md create mode 100644 www/docs/cli/process-compose_project_state.md create mode 100644 www/docs/cli/process-compose_run.md create mode 100644 www/docs/cli/process-compose_up.md create mode 100644 www/docs/cli/process-compose_version.md create mode 100644 www/docs/sponsors.md diff --git a/Makefile b/Makefile index 5d5ed58..c9ad121 100644 --- a/Makefile +++ b/Makefile @@ -8,6 +8,7 @@ NUMVER = $(shell echo ${VERSION} | cut -d"v" -f 2) PKG = github.com/f1bonacc1/${NAME} SHELL := /bin/bash PROJ_NAME := Process Compose +DOCS_DIR := www/docs/cli LD_FLAGS := -ldflags="-X ${PKG}/src/config.Version=${VERSION} \ -X ${PKG}/src/config.CheckForUpdates=true \ -X ${PKG}/src/config.Commit=${GIT_REV} \ @@ -20,7 +21,7 @@ ifeq ($(OS),Windows_NT) RM = cmd /C del /Q /F endif -.PHONY: test run testrace +.PHONY: test run testrace docs buildrun: build run @@ -81,3 +82,9 @@ snapshot: github-workflows: act -W ./.github/workflows/go.yml -j build act -W ./.github/workflows/nix.yml -j build + +docs: + ./bin/process-compose docs ${DOCS_DIR} + for f in ${DOCS_DIR}/*.md ; do sed -i 's/${USER}//g' $$f ; done + for f in ${DOCS_DIR}/*.md ; do sed -i 's/process-compose-[0-9]\+.sock/process-compose-.sock/g' $$f ; done + diff --git a/go.mod b/go.mod index 8e3a6f2..9298b4b 100644 --- a/go.mod +++ b/go.mod @@ -36,6 +36,7 @@ require ( github.com/bytedance/sonic/loader v0.1.1 // indirect github.com/cloudwego/base64x v0.1.4 // indirect github.com/cloudwego/iasm v0.2.0 // indirect + github.com/cpuguy83/go-md2man/v2 v2.0.3 // indirect github.com/gabriel-vasile/mimetype v1.4.3 // indirect github.com/gdamore/encoding v1.0.0 // indirect github.com/gin-contrib/sse v0.1.0 // indirect @@ -63,6 +64,7 @@ require ( github.com/pelletier/go-toml/v2 v2.2.2 // indirect github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect github.com/rivo/uniseg v0.4.7 // indirect + github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/shoenig/go-m1cpu v0.1.6 // indirect github.com/tklauser/go-sysconf v0.3.12 // indirect github.com/tklauser/numcpus v0.6.1 // indirect diff --git a/go.sum b/go.sum index 26281fe..61fb2cc 100644 --- a/go.sum +++ b/go.sum @@ -25,6 +25,7 @@ github.com/cloudwego/base64x v0.1.4/go.mod h1:0zlkT4Wn5C6NdauXdJRhSKRlJvmclQ1hhJ github.com/cloudwego/iasm v0.2.0 h1:1KNIy1I1H9hNNFEEH3DVnI4UujN+1zjpuk6gwHLTssg= github.com/cloudwego/iasm v0.2.0/go.mod h1:8rXZaNYT2n95jn+zTI1sDr+IgcD2GVs0nlbbQPiEFhY= github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= +github.com/cpuguy83/go-md2man/v2 v2.0.3 h1:qMCsGGgs+MAzDFyp9LpAe1Lqy/fY/qCovCm0qnXZOBM= github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/creack/pty v1.1.21 h1:1/QdRyBaHHJP61QkWMXlOIBfsgdDeeKfK8SYVUWJKf0= github.com/creack/pty v1.1.21/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4= @@ -149,6 +150,7 @@ github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUz github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= github.com/rs/zerolog v1.32.0 h1:keLypqrlIjaFsbmJOBdB/qvyF8KEtCWHwobLp5l/mQ0= github.com/rs/zerolog v1.32.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss= +github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/shirou/gopsutil v2.18.12+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= github.com/shirou/gopsutil/v4 v4.24.6 h1:9qqCSYF2pgOU+t+NgJtp7Co5+5mHF/HyKBUckySQL64= diff --git a/src/cmd/docs.go b/src/cmd/docs.go new file mode 100644 index 0000000..afd8d6c --- /dev/null +++ b/src/cmd/docs.go @@ -0,0 +1,27 @@ +package cmd + +import ( + "github.com/spf13/cobra/doc" + + "github.com/rs/zerolog/log" + "github.com/spf13/cobra" +) + +// docsCmd represents the docs command +var docsCmd = &cobra.Command{ + Use: "docs [OUTPUT_PATH]", + Short: "Generate Process Compose markdown documentation", + Args: cobra.ExactArgs(1), + Run: func(cmd *cobra.Command, args []string) { + outPath := args[0] + err := doc.GenMarkdownTree(rootCmd, outPath) + if err != nil { + log.Fatal().Err(err).Msg("Failed to generate docs") + } + }, + Hidden: true, +} + +func init() { + rootCmd.AddCommand(docsCmd) +} diff --git a/www/docs/cli/process-compose.md b/www/docs/cli/process-compose.md new file mode 100644 index 0000000..ef1ef64 --- /dev/null +++ b/www/docs/cli/process-compose.md @@ -0,0 +1,45 @@ +## process-compose + +Processes scheduler and orchestrator + +``` +process-compose [flags] +``` + +### Options + +``` + -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 process-compose + -d, --hide-disabled hide disabled processes + --keep-tui keep TUI running even after all processes exit + -L, --log-file string Specify the log file path (env: PC_LOG_FILE) (default "/tmp/process-compose-.log") + -n, --namespace stringArray run only specified namespaces (default all) + --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) + -r, --ref-rate duration TUI refresh rate in seconds or as a Go duration string (e.g. 1s) (default 1) + -R, --reverse sort in reverse order + -S, --sort string sort column name. legal values (case insensitive): [AGE, 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) + --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 +``` + +### SEE ALSO + +* [process-compose attach](process-compose_attach.md) - Attach the Process Compose TUI Remotely to a Running Process Compose Server +* [process-compose completion](process-compose_completion.md) - Generate the autocompletion script for the specified shell +* [process-compose down](process-compose_down.md) - Stops all the running processes and terminates the Process Compose +* [process-compose info](process-compose_info.md) - Print configuration info +* [process-compose process](process-compose_process.md) - Execute operations on the available processes +* [process-compose project](process-compose_project.md) - Execute operations on a running Process Compose project +* [process-compose run](process-compose_run.md) - Run PROCESS in the foreground, and its dependencies in the background +* [process-compose up](process-compose_up.md) - Run process compose project +* [process-compose version](process-compose_version.md) - Print version and build info + +###### Auto generated by spf13/cobra on 27-Jul-2024 diff --git a/www/docs/cli/process-compose_attach.md b/www/docs/cli/process-compose_attach.md new file mode 100644 index 0000000..ef2f5a5 --- /dev/null +++ b/www/docs/cli/process-compose_attach.md @@ -0,0 +1,38 @@ +## process-compose attach + +Attach the Process Compose TUI Remotely to a Running Process Compose Server + +``` +process-compose attach [flags] +``` + +### Options + +``` + -a, --address string address of the target process compose server (default "localhost") + -h, --help help for attach + -l, --log-length int log length to display in TUI (default 1000) + -r, --ref-rate duration TUI refresh rate in seconds or as a Go duration string (e.g. 1s) (default 1) + -R, --reverse sort in reverse order + -S, --sort string sort column name. legal values (case insensitive): [AGE, EXIT, HEALTH, MEM, NAME, NAMESPACE, PID, RESTARTS, STATUS] (default "NAME") + --theme string select process compose theme (default "Default") +``` + +### Options inherited from parent commands + +``` + --keep-tui keep TUI running even after all processes exit + -L, --log-file string Specify the log file path (env: PC_LOG_FILE) (default "/tmp/process-compose-.log") + --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) + -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 +``` + +### SEE ALSO + +* [process-compose](process-compose.md) - Processes scheduler and orchestrator + +###### Auto generated by spf13/cobra on 27-Jul-2024 diff --git a/www/docs/cli/process-compose_completion.md b/www/docs/cli/process-compose_completion.md new file mode 100644 index 0000000..4c3e5a7 --- /dev/null +++ b/www/docs/cli/process-compose_completion.md @@ -0,0 +1,38 @@ +## process-compose completion + +Generate the autocompletion script for the specified shell + +### Synopsis + +Generate the autocompletion script for process-compose for the specified shell. +See each sub-command's help for details on how to use the generated script. + + +### Options + +``` + -h, --help help for completion +``` + +### Options inherited from parent commands + +``` + --keep-tui keep TUI running even after all processes exit + -L, --log-file string Specify the log file path (env: PC_LOG_FILE) (default "/tmp/process-compose-.log") + --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) + -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 +``` + +### SEE ALSO + +* [process-compose](process-compose.md) - Processes scheduler and orchestrator +* [process-compose completion bash](process-compose_completion_bash.md) - Generate the autocompletion script for bash +* [process-compose completion fish](process-compose_completion_fish.md) - Generate the autocompletion script for fish +* [process-compose completion powershell](process-compose_completion_powershell.md) - Generate the autocompletion script for powershell +* [process-compose completion zsh](process-compose_completion_zsh.md) - Generate the autocompletion script for zsh + +###### Auto generated by spf13/cobra on 27-Jul-2024 diff --git a/www/docs/cli/process-compose_completion_bash.md b/www/docs/cli/process-compose_completion_bash.md new file mode 100644 index 0000000..c5e9778 --- /dev/null +++ b/www/docs/cli/process-compose_completion_bash.md @@ -0,0 +1,57 @@ +## process-compose completion bash + +Generate the autocompletion script for bash + +### Synopsis + +Generate the autocompletion script for the bash shell. + +This script depends on the 'bash-completion' package. +If it is not installed already, you can install it via your OS's package manager. + +To load completions in your current shell session: + + source <(process-compose completion bash) + +To load completions for every new session, execute once: + +#### Linux: + + process-compose completion bash > /etc/bash_completion.d/process-compose + +#### macOS: + + process-compose completion bash > $(brew --prefix)/etc/bash_completion.d/process-compose + +You will need to start a new shell for this setup to take effect. + + +``` +process-compose completion bash +``` + +### Options + +``` + -h, --help help for bash + --no-descriptions disable completion descriptions +``` + +### Options inherited from parent commands + +``` + --keep-tui keep TUI running even after all processes exit + -L, --log-file string Specify the log file path (env: PC_LOG_FILE) (default "/tmp/process-compose-.log") + --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) + -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 +``` + +### SEE ALSO + +* [process-compose completion](process-compose_completion.md) - Generate the autocompletion script for the specified shell + +###### Auto generated by spf13/cobra on 27-Jul-2024 diff --git a/www/docs/cli/process-compose_completion_fish.md b/www/docs/cli/process-compose_completion_fish.md new file mode 100644 index 0000000..60dfb31 --- /dev/null +++ b/www/docs/cli/process-compose_completion_fish.md @@ -0,0 +1,48 @@ +## process-compose completion fish + +Generate the autocompletion script for fish + +### Synopsis + +Generate the autocompletion script for the fish shell. + +To load completions in your current shell session: + + process-compose completion fish | source + +To load completions for every new session, execute once: + + process-compose completion fish > ~/.config/fish/completions/process-compose.fish + +You will need to start a new shell for this setup to take effect. + + +``` +process-compose completion fish [flags] +``` + +### Options + +``` + -h, --help help for fish + --no-descriptions disable completion descriptions +``` + +### Options inherited from parent commands + +``` + --keep-tui keep TUI running even after all processes exit + -L, --log-file string Specify the log file path (env: PC_LOG_FILE) (default "/tmp/process-compose-.log") + --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) + -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 +``` + +### SEE ALSO + +* [process-compose completion](process-compose_completion.md) - Generate the autocompletion script for the specified shell + +###### Auto generated by spf13/cobra on 27-Jul-2024 diff --git a/www/docs/cli/process-compose_completion_powershell.md b/www/docs/cli/process-compose_completion_powershell.md new file mode 100644 index 0000000..9e5082a --- /dev/null +++ b/www/docs/cli/process-compose_completion_powershell.md @@ -0,0 +1,45 @@ +## process-compose completion powershell + +Generate the autocompletion script for powershell + +### Synopsis + +Generate the autocompletion script for powershell. + +To load completions in your current shell session: + + process-compose completion powershell | Out-String | Invoke-Expression + +To load completions for every new session, add the output of the above command +to your powershell profile. + + +``` +process-compose completion powershell [flags] +``` + +### Options + +``` + -h, --help help for powershell + --no-descriptions disable completion descriptions +``` + +### Options inherited from parent commands + +``` + --keep-tui keep TUI running even after all processes exit + -L, --log-file string Specify the log file path (env: PC_LOG_FILE) (default "/tmp/process-compose-.log") + --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) + -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 +``` + +### SEE ALSO + +* [process-compose completion](process-compose_completion.md) - Generate the autocompletion script for the specified shell + +###### Auto generated by spf13/cobra on 27-Jul-2024 diff --git a/www/docs/cli/process-compose_completion_zsh.md b/www/docs/cli/process-compose_completion_zsh.md new file mode 100644 index 0000000..98cb871 --- /dev/null +++ b/www/docs/cli/process-compose_completion_zsh.md @@ -0,0 +1,59 @@ +## process-compose completion zsh + +Generate the autocompletion script for zsh + +### Synopsis + +Generate the autocompletion script for the zsh shell. + +If shell completion is not already enabled in your environment you will need +to enable it. You can execute the following once: + + echo "autoload -U compinit; compinit" >> ~/.zshrc + +To load completions in your current shell session: + + source <(process-compose completion zsh) + +To load completions for every new session, execute once: + +#### Linux: + + process-compose completion zsh > "${fpath[1]}/_process-compose" + +#### macOS: + + process-compose completion zsh > $(brew --prefix)/share/zsh/site-functions/_process-compose + +You will need to start a new shell for this setup to take effect. + + +``` +process-compose completion zsh [flags] +``` + +### Options + +``` + -h, --help help for zsh + --no-descriptions disable completion descriptions +``` + +### Options inherited from parent commands + +``` + --keep-tui keep TUI running even after all processes exit + -L, --log-file string Specify the log file path (env: PC_LOG_FILE) (default "/tmp/process-compose-.log") + --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) + -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 +``` + +### SEE ALSO + +* [process-compose completion](process-compose_completion.md) - Generate the autocompletion script for the specified shell + +###### Auto generated by spf13/cobra on 27-Jul-2024 diff --git a/www/docs/cli/process-compose_down.md b/www/docs/cli/process-compose_down.md new file mode 100644 index 0000000..9c1f0f4 --- /dev/null +++ b/www/docs/cli/process-compose_down.md @@ -0,0 +1,33 @@ +## process-compose down + +Stops all the running processes and terminates the Process Compose + +``` +process-compose down [flags] +``` + +### Options + +``` + -a, --address string address of the target process compose server (default "localhost") + -h, --help help for down +``` + +### Options inherited from parent commands + +``` + --keep-tui keep TUI running even after all processes exit + -L, --log-file string Specify the log file path (env: PC_LOG_FILE) (default "/tmp/process-compose-.log") + --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) + -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 +``` + +### SEE ALSO + +* [process-compose](process-compose.md) - Processes scheduler and orchestrator + +###### Auto generated by spf13/cobra on 27-Jul-2024 diff --git a/www/docs/cli/process-compose_info.md b/www/docs/cli/process-compose_info.md new file mode 100644 index 0000000..6d5bd82 --- /dev/null +++ b/www/docs/cli/process-compose_info.md @@ -0,0 +1,32 @@ +## process-compose info + +Print configuration info + +``` +process-compose info [flags] +``` + +### Options + +``` + -h, --help help for info +``` + +### Options inherited from parent commands + +``` + --keep-tui keep TUI running even after all processes exit + -L, --log-file string Specify the log file path (env: PC_LOG_FILE) (default "/tmp/process-compose-.log") + --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) + -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 +``` + +### SEE ALSO + +* [process-compose](process-compose.md) - Processes scheduler and orchestrator + +###### Auto generated by spf13/cobra on 27-Jul-2024 diff --git a/www/docs/cli/process-compose_process.md b/www/docs/cli/process-compose_process.md new file mode 100644 index 0000000..3fe427a --- /dev/null +++ b/www/docs/cli/process-compose_process.md @@ -0,0 +1,36 @@ +## process-compose process + +Execute operations on the available processes + +### Options + +``` + -a, --address string address of the target process compose server (default "localhost") + -h, --help help for process +``` + +### Options inherited from parent commands + +``` + --keep-tui keep TUI running even after all processes exit + -L, --log-file string Specify the log file path (env: PC_LOG_FILE) (default "/tmp/process-compose-.log") + --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) + -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 +``` + +### SEE ALSO + +* [process-compose](process-compose.md) - Processes scheduler and orchestrator +* [process-compose process list](process-compose_process_list.md) - List available processes +* [process-compose process logs](process-compose_process_logs.md) - Fetch the logs of a process +* [process-compose process ports](process-compose_process_ports.md) - Get the ports that a process is listening on +* [process-compose process restart](process-compose_process_restart.md) - Restart a process +* [process-compose process scale](process-compose_process_scale.md) - Scale a process to a given count +* [process-compose process start](process-compose_process_start.md) - Start a process +* [process-compose process stop](process-compose_process_stop.md) - Stop a running process + +###### Auto generated by spf13/cobra on 27-Jul-2024 diff --git a/www/docs/cli/process-compose_process_list.md b/www/docs/cli/process-compose_process_list.md new file mode 100644 index 0000000..d7611b2 --- /dev/null +++ b/www/docs/cli/process-compose_process_list.md @@ -0,0 +1,34 @@ +## process-compose process list + +List available processes + +``` +process-compose process list [flags] +``` + +### Options + +``` + -h, --help help for list + -o, --output string Output format. One of: (json, wide) +``` + +### Options inherited from parent commands + +``` + -a, --address string address of the target process compose server (default "localhost") + --keep-tui keep TUI running even after all processes exit + -L, --log-file string Specify the log file path (env: PC_LOG_FILE) (default "/tmp/process-compose-.log") + --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) + -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 +``` + +### SEE ALSO + +* [process-compose process](process-compose_process.md) - Execute operations on the available processes + +###### Auto generated by spf13/cobra on 27-Jul-2024 diff --git a/www/docs/cli/process-compose_process_logs.md b/www/docs/cli/process-compose_process_logs.md new file mode 100644 index 0000000..48695cc --- /dev/null +++ b/www/docs/cli/process-compose_process_logs.md @@ -0,0 +1,35 @@ +## process-compose process logs + +Fetch the logs of a process + +``` +process-compose process logs [PROCESS] [flags] +``` + +### Options + +``` + -f, --follow Follow log output + -h, --help help for logs + -n, --tail int Number of lines to show from the end of the logs (default 9223372036854775807) +``` + +### Options inherited from parent commands + +``` + -a, --address string address of the target process compose server (default "localhost") + --keep-tui keep TUI running even after all processes exit + -L, --log-file string Specify the log file path (env: PC_LOG_FILE) (default "/tmp/process-compose-.log") + --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) + -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 +``` + +### SEE ALSO + +* [process-compose process](process-compose_process.md) - Execute operations on the available processes + +###### Auto generated by spf13/cobra on 27-Jul-2024 diff --git a/www/docs/cli/process-compose_process_ports.md b/www/docs/cli/process-compose_process_ports.md new file mode 100644 index 0000000..0ba2683 --- /dev/null +++ b/www/docs/cli/process-compose_process_ports.md @@ -0,0 +1,33 @@ +## process-compose process ports + +Get the ports that a process is listening on + +``` +process-compose process ports [PROCESS] [flags] +``` + +### Options + +``` + -h, --help help for ports +``` + +### Options inherited from parent commands + +``` + -a, --address string address of the target process compose server (default "localhost") + --keep-tui keep TUI running even after all processes exit + -L, --log-file string Specify the log file path (env: PC_LOG_FILE) (default "/tmp/process-compose-.log") + --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) + -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 +``` + +### SEE ALSO + +* [process-compose process](process-compose_process.md) - Execute operations on the available processes + +###### Auto generated by spf13/cobra on 27-Jul-2024 diff --git a/www/docs/cli/process-compose_process_restart.md b/www/docs/cli/process-compose_process_restart.md new file mode 100644 index 0000000..157b63a --- /dev/null +++ b/www/docs/cli/process-compose_process_restart.md @@ -0,0 +1,33 @@ +## process-compose process restart + +Restart a process + +``` +process-compose process restart [PROCESS] [flags] +``` + +### Options + +``` + -h, --help help for restart +``` + +### Options inherited from parent commands + +``` + -a, --address string address of the target process compose server (default "localhost") + --keep-tui keep TUI running even after all processes exit + -L, --log-file string Specify the log file path (env: PC_LOG_FILE) (default "/tmp/process-compose-.log") + --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) + -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 +``` + +### SEE ALSO + +* [process-compose process](process-compose_process.md) - Execute operations on the available processes + +###### Auto generated by spf13/cobra on 27-Jul-2024 diff --git a/www/docs/cli/process-compose_process_scale.md b/www/docs/cli/process-compose_process_scale.md new file mode 100644 index 0000000..c60ea9a --- /dev/null +++ b/www/docs/cli/process-compose_process_scale.md @@ -0,0 +1,33 @@ +## process-compose process scale + +Scale a process to a given count + +``` +process-compose process scale [PROCESS] [COUNT] [flags] +``` + +### Options + +``` + -h, --help help for scale +``` + +### Options inherited from parent commands + +``` + -a, --address string address of the target process compose server (default "localhost") + --keep-tui keep TUI running even after all processes exit + -L, --log-file string Specify the log file path (env: PC_LOG_FILE) (default "/tmp/process-compose-.log") + --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) + -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 +``` + +### SEE ALSO + +* [process-compose process](process-compose_process.md) - Execute operations on the available processes + +###### Auto generated by spf13/cobra on 27-Jul-2024 diff --git a/www/docs/cli/process-compose_process_start.md b/www/docs/cli/process-compose_process_start.md new file mode 100644 index 0000000..d14eb82 --- /dev/null +++ b/www/docs/cli/process-compose_process_start.md @@ -0,0 +1,33 @@ +## process-compose process start + +Start a process + +``` +process-compose process start [PROCESS] [flags] +``` + +### Options + +``` + -h, --help help for start +``` + +### Options inherited from parent commands + +``` + -a, --address string address of the target process compose server (default "localhost") + --keep-tui keep TUI running even after all processes exit + -L, --log-file string Specify the log file path (env: PC_LOG_FILE) (default "/tmp/process-compose-.log") + --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) + -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 +``` + +### SEE ALSO + +* [process-compose process](process-compose_process.md) - Execute operations on the available processes + +###### Auto generated by spf13/cobra on 27-Jul-2024 diff --git a/www/docs/cli/process-compose_process_stop.md b/www/docs/cli/process-compose_process_stop.md new file mode 100644 index 0000000..572d0b0 --- /dev/null +++ b/www/docs/cli/process-compose_process_stop.md @@ -0,0 +1,33 @@ +## process-compose process stop + +Stop a running process + +``` +process-compose process stop [PROCESS...] [flags] +``` + +### Options + +``` + -h, --help help for stop +``` + +### Options inherited from parent commands + +``` + -a, --address string address of the target process compose server (default "localhost") + --keep-tui keep TUI running even after all processes exit + -L, --log-file string Specify the log file path (env: PC_LOG_FILE) (default "/tmp/process-compose-.log") + --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) + -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 +``` + +### SEE ALSO + +* [process-compose process](process-compose_process.md) - Execute operations on the available processes + +###### Auto generated by spf13/cobra on 27-Jul-2024 diff --git a/www/docs/cli/process-compose_project.md b/www/docs/cli/process-compose_project.md new file mode 100644 index 0000000..900f73a --- /dev/null +++ b/www/docs/cli/process-compose_project.md @@ -0,0 +1,30 @@ +## process-compose project + +Execute operations on a running Process Compose project + +### Options + +``` + -a, --address string address of the target process compose server (default "localhost") + -h, --help help for project +``` + +### Options inherited from parent commands + +``` + --keep-tui keep TUI running even after all processes exit + -L, --log-file string Specify the log file path (env: PC_LOG_FILE) (default "/tmp/process-compose-.log") + --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) + -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 +``` + +### SEE ALSO + +* [process-compose](process-compose.md) - Processes scheduler and orchestrator +* [process-compose project state](process-compose_project_state.md) - Get Process Compose project state + +###### Auto generated by spf13/cobra on 27-Jul-2024 diff --git a/www/docs/cli/process-compose_project_state.md b/www/docs/cli/process-compose_project_state.md new file mode 100644 index 0000000..07b8ce5 --- /dev/null +++ b/www/docs/cli/process-compose_project_state.md @@ -0,0 +1,34 @@ +## process-compose project state + +Get Process Compose project state + +``` +process-compose project state [flags] +``` + +### Options + +``` + -h, --help help for state + --with-memory check memory usage +``` + +### Options inherited from parent commands + +``` + -a, --address string address of the target process compose server (default "localhost") + --keep-tui keep TUI running even after all processes exit + -L, --log-file string Specify the log file path (env: PC_LOG_FILE) (default "/tmp/process-compose-.log") + --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) + -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 +``` + +### SEE ALSO + +* [process-compose project](process-compose_project.md) - Execute operations on a running Process Compose project + +###### Auto generated by spf13/cobra on 27-Jul-2024 diff --git a/www/docs/cli/process-compose_run.md b/www/docs/cli/process-compose_run.md new file mode 100644 index 0000000..6395173 --- /dev/null +++ b/www/docs/cli/process-compose_run.md @@ -0,0 +1,40 @@ +## process-compose run + +Run PROCESS in the foreground, and its dependencies in the background + +### Synopsis + +Run selected process with std(in|out|err) attached, while other processes run in the background. +Command line arguments, provided after --, are passed to the PROCESS. + +``` +process-compose run PROCESS [flags] -- [process_args] +``` + +### Options + +``` + -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 +``` + +### Options inherited from parent commands + +``` + --keep-tui keep TUI running even after all processes exit + -L, --log-file string Specify the log file path (env: PC_LOG_FILE) (default "/tmp/process-compose-.log") + --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) + -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 +``` + +### SEE ALSO + +* [process-compose](process-compose.md) - Processes scheduler and orchestrator + +###### Auto generated by spf13/cobra on 27-Jul-2024 diff --git a/www/docs/cli/process-compose_up.md b/www/docs/cli/process-compose_up.md new file mode 100644 index 0000000..2471722 --- /dev/null +++ b/www/docs/cli/process-compose_up.md @@ -0,0 +1,48 @@ +## process-compose up + +Run process compose project + +### Synopsis + +Run all the process compose processes. +If one or more process names are passed as arguments, +will start them and their dependencies only + +``` +process-compose up [PROCESS...] [flags] +``` + +### Options + +``` + -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 up + -d, --hide-disabled hide disabled processes + -n, --namespace stringArray run only specified namespaces (default all) + --no-deps don't start dependent processes + -r, --ref-rate duration TUI refresh rate in seconds or as a Go duration string (e.g. 1s) (default 1) + -R, --reverse sort in reverse order + -S, --sort string sort column name. legal values (case insensitive): [AGE, 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) +``` + +### Options inherited from parent commands + +``` + --keep-tui keep TUI running even after all processes exit + -L, --log-file string Specify the log file path (env: PC_LOG_FILE) (default "/tmp/process-compose-.log") + --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) + -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 +``` + +### SEE ALSO + +* [process-compose](process-compose.md) - Processes scheduler and orchestrator + +###### Auto generated by spf13/cobra on 27-Jul-2024 diff --git a/www/docs/cli/process-compose_version.md b/www/docs/cli/process-compose_version.md new file mode 100644 index 0000000..05d03d3 --- /dev/null +++ b/www/docs/cli/process-compose_version.md @@ -0,0 +1,32 @@ +## process-compose version + +Print version and build info + +``` +process-compose version [flags] +``` + +### Options + +``` + -h, --help help for version +``` + +### Options inherited from parent commands + +``` + --keep-tui keep TUI running even after all processes exit + -L, --log-file string Specify the log file path (env: PC_LOG_FILE) (default "/tmp/process-compose-.log") + --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) + -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 +``` + +### SEE ALSO + +* [process-compose](process-compose.md) - Processes scheduler and orchestrator + +###### Auto generated by spf13/cobra on 27-Jul-2024 diff --git a/www/docs/contributing.md b/www/docs/contributing.md index ce2790d..65d2d64 100644 --- a/www/docs/contributing.md +++ b/www/docs/contributing.md @@ -4,5 +4,43 @@ Process Compose is written in Go. ### Prerequisites: - [Make](https://www.gnu.org/software/make/) -- [Go 1.21+](https://go.dev/doc/install) +- [Go 1.22+](https://go.dev/doc/install) + +### Clone Process Compose: + +``` +git clone git@github.com:F1bonacc1/process-compose.git +``` + +`cd` into the directory and install the dependencies: + +``` +go mod tidy +``` + +You should then be able to build the binary: + +``` +make build +``` + +## Test your change + +You can create a branch for your changes and try to build from the source as you go. + +When you are satisfied with the changes, we suggest you run: + +``` +make ci +``` + +## Create a commit + +Commit messages should be well formatted, and to make that "standardized", we are using Conventional Commits. + +You can follow the documentation on [their website](https://www.conventionalcommits.org/). + +## Submit a pull request + +Push your branch to your `process-compose` fork and open a pull request against the main branch. diff --git a/www/docs/sponsors.md b/www/docs/sponsors.md new file mode 100644 index 0000000..8a3e33d --- /dev/null +++ b/www/docs/sponsors.md @@ -0,0 +1,17 @@ +Do you or your company use Process Compose? You can help keep the project bug-free and feature rich by sponsoring the project and its contributors. + +## GitHub Sponsors + +GitHub Sponsors is a great way to contribute directly to the Process Compose maintainer, [f1bonnacc1](https://github.com/F1bonacc1). + +This money usually goes to buying coffee, snacks, better hardware, and, hopefully, one day, paying the bills. + +You can sponsor and see who's sponsoring f1bonacc1 [here](https://github.com/sponsors/f1bonacc1). + + + +And, of course, you can also sponsor any of the [contributors](https://github.com/F1bonacc1/process-compose/graphs/contributors)! + +------ + +**🔥🔥 Thanks for your support! 🔥🔥** \ No newline at end of file diff --git a/www/mkdocs.yml b/www/mkdocs.yml index 4b75cd2..8cc9e89 100644 --- a/www/mkdocs.yml +++ b/www/mkdocs.yml @@ -15,6 +15,20 @@ nav: - 'Merging Configuration': merge.md - 'Remote Client': client.md - TUI: tui.md + - CLI: + - 'process-compose': cli/process-compose.md + - 'attach': cli/process-compose_attach.md + - 'completion': cli/process-compose_completion.md + - 'down': cli/process-compose_down.md + - 'info': cli/process-compose_info.md + - 'process': cli/process-compose_process.md + - 'project': cli/process-compose_project.md + - 'run': cli/process-compose_run.md + - 'up': cli/process-compose_up.md + - 'version': cli/process-compose_version.md + - Contributing: + - Contributing: contributing.md + - Sponsors: sponsors.md theme: name: material