Skip to content

Commit ccb86b1

Browse files
committed
Add examples
1 parent a924dc9 commit ccb86b1

File tree

3 files changed

+56
-0
lines changed

3 files changed

+56
-0
lines changed

README.md

+33
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,27 @@ Run commands concurrently (alias: c)
352352
konk run concurrently <command...> [flags]
353353
```
354354

355+
### Examples
356+
357+
```
358+
# Run two commands concurrently
359+
360+
konk run concurrently "script/api-server" "script/frontend-server"
361+
362+
# Run a set of npm commands concurrently
363+
364+
konk run concurrently -n lint -n test
365+
366+
# Run a set of npm commands concurrently, but aggregate their output
367+
368+
konk run concurrently -g -n lint -n test
369+
370+
# Run all npm commands prefixed with "check:" concurrently using Bun, ignore
371+
# errors, aggregate output, and use the script name as the label
372+
373+
konk run concurrently -bgcL -n "check:*"
374+
```
375+
355376
### Options
356377

357378
```
@@ -386,6 +407,18 @@ Run commands serially (alias: s)
386407
konk run serially <command...> [flags]
387408
```
388409

410+
### Examples
411+
412+
```
413+
# Run two commands in serial
414+
415+
konk run serially "echo foo" "echo bar"
416+
417+
# Run a set of npm commands in serial
418+
419+
konk run serially -n build -n deploy
420+
```
421+
389422
### Options
390423

391424
```

cmd/concurrently.go

+16
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,22 @@ var cCommand = cobra.Command{
1616
Use: "concurrently <command...>",
1717
Aliases: []string{"c"},
1818
Short: "Run commands concurrently (alias: c)",
19+
Example: `# Run two commands concurrently
20+
21+
konk run concurrently "script/api-server" "script/frontend-server"
22+
23+
# Run a set of npm commands concurrently
24+
25+
konk run concurrently -n lint -n test
26+
27+
# Run a set of npm commands concurrently, but aggregate their output
28+
29+
konk run concurrently -g -n lint -n test
30+
31+
# Run all npm commands prefixed with "check:" concurrently using Bun, ignore
32+
# errors, aggregate output, and use the script name as the label
33+
34+
konk run concurrently -bgcL -n "check:*"`,
1935
RunE: func(cmd *cobra.Command, args []string) error {
2036
dbg := debugger.Get(cmd.Context())
2137
dbg.Flags(cmd)

cmd/serially.go

+7
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,13 @@ var sCommand = cobra.Command{
1616
Use: "serially <command...>",
1717
Aliases: []string{"s"},
1818
Short: "Run commands serially (alias: s)",
19+
Example: `# Run two commands in serial
20+
21+
konk run serially "echo foo" "echo bar"
22+
23+
# Run a set of npm commands in serial
24+
25+
konk run serially -n build -n deploy`,
1926
RunE: func(cmd *cobra.Command, args []string) error {
2027
dbg := debugger.Get(cmd.Context())
2128
dbg.Flags(cmd)

0 commit comments

Comments
 (0)