Skip to content

Commit

Permalink
docs: keybinds for tui (#9831)
Browse files Browse the repository at this point in the history
### Description

Document the new TUI keybinds.

### Testing Instructions

👀
  • Loading branch information
anthonyshew authored Jan 31, 2025
1 parent b04f81d commit 7ebaf75
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 11 deletions.
39 changes: 29 additions & 10 deletions docs/repo-docs/crafting-your-repository/developing-applications.mdx
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

0 comments on commit 7ebaf75

Please sign in to comment.