Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: keybinds for tui #9831

Merged
merged 1 commit into from
Jan 31, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,6 @@ You can now run your `dev` task to start your development scripts in parallel:
turbo dev
```

### Interacting with tasks

Some scripts allow you to type into them using `stdin` for interactive inputs. Using [the terminal ui](https://turbo.build/repo/docs/reference/configuration#ui), you can select a task, enter it, and use `stdin` as you typically would.

<Callout type="good-to-know">
A task must be
[interactive](https://turbo.build/repo/docs/reference/configuration#interactive)
to enable this functionality.
</Callout>

### Running setup tasks before `dev`

You may also want to run scripts that set up your development environment or pre-build packages. You can make sure those tasks run before the `dev` task with `dependsOn`:
Expand Down Expand Up @@ -81,6 +71,35 @@ The `--filter` flag allows you to pick a subset of your [Package Graph](/repo/do
turbo dev --filter=web
```

## Using the terminal UI

Turborepo's terminal UI enables a number of features that create a highly interactive experience around your tasks.

### Customizing your view

You can quickly adjust the UI to your needs using keybinds.

| Keybind | Action |
| ------- | ----------------------------------------------------------------- |
| `m` | Toggle popup listing keybinds |
| `↑`/`↓` | Select the next/previous task in the task list |
| `j`/`k` | Select the next/previous task in the task list |
| `p` | Toggle selection pinning for selected task |
| `h` | Toggle visibility of the task list |
| `c` | When logs are highlighted, copy selection to the system clipboard |
| `u`/`d` | Scroll logs `u`p and `d`own |

### Interacting with tasks

Some of your tools may allow you to type input into them. Examples of this include Drizzle ORM's interactive migrations or Jest's filtering and re-running of test suites.

You can interact with tasks that are [marked as interactive](/repo/docs/reference/configuration#interactive) to give them input.

| Keybind | Action |
| -------- | ----------------- |
| `i` | Begin interacting |
| `Ctrl+z` | Stop interacting |

## Watch Mode

Many tools have a built-in watcher, like [`tsc --watch`](https://www.typescriptlang.org/docs/handbook/compiler-options.html#compiler-options),
Expand Down
2 changes: 1 addition & 1 deletion docs/repo-docs/reference/configuration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ Default: `false` (Defaults to `true` for tasks marked as `persistent`)

Label a task as `interactive` to make it accept inputs from `stdin` in the terminal UI. Must be used with `persistent`.

This task is most useful for scripts that can be manipulated while they are running, like Jest or Vitest.
This option is most useful for scripts that can be manipulated while they are running, like Jest or Vitest.

```jsonc title="./turbo.json"
{
Expand Down
Loading