diff --git a/README.md b/README.md index 693c969..188ed0b 100644 --- a/README.md +++ b/README.md @@ -352,6 +352,27 @@ Run commands concurrently (alias: c) konk run concurrently [flags] ``` +### Examples + +``` +# Run two commands concurrently + +konk run concurrently "script/api-server" "script/frontend-server" + +# Run a set of npm commands concurrently + +konk run concurrently -n lint -n test + +# Run a set of npm commands concurrently, but aggregate their output + +konk run concurrently -g -n lint -n test + +# Run all npm commands prefixed with "check:" concurrently using Bun, ignore +# errors, aggregate output, and use the script name as the label + +konk run concurrently -bgcL -n "check:*" +``` + ### Options ``` @@ -386,6 +407,18 @@ Run commands serially (alias: s) konk run serially [flags] ``` +### Examples + +``` +# Run two commands in serial + +konk run serially "echo foo" "echo bar" + +# Run a set of npm commands in serial + +konk run serially -n build -n deploy +``` + ### Options ``` diff --git a/cmd/concurrently.go b/cmd/concurrently.go index 7b09c61..a43db19 100644 --- a/cmd/concurrently.go +++ b/cmd/concurrently.go @@ -16,6 +16,22 @@ var cCommand = cobra.Command{ Use: "concurrently ", Aliases: []string{"c"}, Short: "Run commands concurrently (alias: c)", + Example: `# Run two commands concurrently + +konk run concurrently "script/api-server" "script/frontend-server" + +# Run a set of npm commands concurrently + +konk run concurrently -n lint -n test + +# Run a set of npm commands concurrently, but aggregate their output + +konk run concurrently -g -n lint -n test + +# Run all npm commands prefixed with "check:" concurrently using Bun, ignore +# errors, aggregate output, and use the script name as the label + +konk run concurrently -bgcL -n "check:*"`, RunE: func(cmd *cobra.Command, args []string) error { dbg := debugger.Get(cmd.Context()) dbg.Flags(cmd) diff --git a/cmd/serially.go b/cmd/serially.go index 6b80d33..7f3e10a 100644 --- a/cmd/serially.go +++ b/cmd/serially.go @@ -16,6 +16,13 @@ var sCommand = cobra.Command{ Use: "serially ", Aliases: []string{"s"}, Short: "Run commands serially (alias: s)", + Example: `# Run two commands in serial + +konk run serially "echo foo" "echo bar" + +# Run a set of npm commands in serial + +konk run serially -n build -n deploy`, RunE: func(cmd *cobra.Command, args []string) error { dbg := debugger.Get(cmd.Context()) dbg.Flags(cmd)