Skip to content

Commit

Permalink
Add examples
Browse files Browse the repository at this point in the history
  • Loading branch information
jclem committed Dec 24, 2024
1 parent a924dc9 commit ccb86b1
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 0 deletions.
33 changes: 33 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,27 @@ Run commands concurrently (alias: c)
konk run concurrently <command...> [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

```
Expand Down Expand Up @@ -386,6 +407,18 @@ Run commands serially (alias: s)
konk run serially <command...> [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

```
Expand Down
16 changes: 16 additions & 0 deletions cmd/concurrently.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,22 @@ var cCommand = cobra.Command{
Use: "concurrently <command...>",
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)
Expand Down
7 changes: 7 additions & 0 deletions cmd/serially.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@ var sCommand = cobra.Command{
Use: "serially <command...>",
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)
Expand Down

0 comments on commit ccb86b1

Please sign in to comment.