Skip to content

Commit a9776c4

Browse files
authored
chore(docs): interactive console components (#1602)
1 parent a50c492 commit a9776c4

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

docs/1-essentials/04-console-commands.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,21 @@ final readonly class SynchronizeAircraft
223223
}
224224
```
225225

226+
## Interactive components
227+
228+
Tempest console comes with a range of interactive components that can be used to interact with the user while running a console command:
229+
230+
- `$console->ask()` will prompt the user for input and validate it.
231+
- `$console->confirm()` will prompt the user for a yes/no answer.
232+
- `$console->password()` will prompt the user for a password, the input will be masked.
233+
- `$console->progressBar()` will render a progress bar.
234+
- `$console->search()` will prompt the user with a search bar and update a result list in real-time.
235+
- `$console->task()` will run a task and show a progress bar while it's running.
236+
237+
:::warning
238+
Interactive components are only supported on Mac and Linux. On Windows, Tempest will fall back to non-interactive versions of these components.
239+
:::
240+
226241
## Middleware
227242

228243
Console middleware can be applied globally or on a per-command basis. Global console middleware will be discovered and applied automatically, by priority order.
@@ -316,4 +331,4 @@ $this->console
316331
->assertSee('caution')
317332
->submit()
318333
->assertSuccess();
319-
```
334+
```

0 commit comments

Comments
 (0)