miso-tui

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

miso-tui

miso-tui

Use this skill when configuring multi-process TUI display, task ordering, or concurrent tasks.

当你需要配置多进程TUI显示、任务排序或并发任务时,可使用该skill。

tui
Field

tui
字段

Controls the terminal UI mode. Set at the top level of
miso.json
.
ValueBehavior
"off"
Default. No TUI. Normal stdout.
"tabbed"
Sidebar with per-process log panes. Click or use arrow keys to navigate,
r
to restart,
C
to copy full log buffer.
"merged"
Interleaved output with color-coded process labels and a filter bar.
{ "mode": "tabbed", "cleanExit": true }
Object form.
cleanExit: true
suppresses the log dump to stdout when the TUI exits. By default, all buffered process output is printed to stdout after the TUI closes.
Auto-exit behavior: After all processes finish, the TUI waits 2 seconds then exits. By default, all buffered output is also dumped to stdout after the TUI closes. Set
cleanExit: true
to suppress that dump.

用于控制终端UI模式,需配置在
miso.json
的顶层。
行为
"off"
默认值。无TUI,使用标准stdout输出。
"tabbed"
侧边栏搭配每个进程对应的日志面板。可点击或使用方向键导航,按
r
重启任务,按
C
复制完整日志缓冲区内容。
"merged"
交错输出内容,带有颜色标记的进程标签和筛选栏。
{ "mode": "tabbed", "cleanExit": true }
对象形式配置。
cleanExit: true
会禁止TUI退出时将日志转储到stdout。默认情况下,TUI关闭后所有缓冲的进程输出都会打印到stdout。
自动退出行为: 所有进程结束后,TUI会等待2秒再退出。默认情况下,TUI关闭后所有缓冲的输出都会打印到stdout,设置
cleanExit: true
可禁止该输出转储。

repo
Field

repo
字段

Controls how miso discovers and orchestrates workspaces or pipeline tasks.
ValueBehavior
"single"
Default. One project, no workspace awareness.
"mono"
Miso-native monorepo orchestration. Discovers workspaces from
workspaces
in root
package.json
.
"turbo"
Delegates to Turborepo. Parses Turborepo output into TUI tabs.
"nx"
Delegates to Nx (
nx run-many --target=<script>
). Parses output into TUI tabs.
Object formUse when you need
tasks
config:
{ "mode": "turbo", "tasks": { ... } }

控制miso如何发现和编排工作区或流水线任务。
行为
"single"
默认值。单项目,无工作区感知能力。
"mono"
miso原生的monorepo编排能力,会从根目录
package.json
workspaces
字段中发现工作区。
"turbo"
委托给Turborepo处理,将Turborepo的输出解析为TUI标签页。
"nx"
委托给Nx(
nx run-many --target=<script>
)处理,将输出解析为TUI标签页。
对象形式当你需要配置
tasks
时使用:
{ "mode": "turbo", "tasks": { ... } }

repo.tasks
— Concurrent and Dependent Tasks

repo.tasks
— 并发与依赖任务

tasks
is an object where each key is a script name. Configure ordering and concurrency:
tasks
是一个对象,每个键对应一个脚本名称,可用于配置任务排序和并发规则:

dependsOn

dependsOn

Run upstream tasks before this one (topological order):
json
"repo": {
  "mode": "mono",
  "tasks": {
    "build": {
      "dependsOn": ["^build"]
    }
  }
}
"^build"
means: run
build
in all upstream dependencies first. Without
^
, it's a same-workspace dependency (rarely needed).
在当前任务之前运行上游任务(拓扑排序):
json
"repo": {
  "mode": "mono",
  "tasks": {
    "build": {
      "dependsOn": ["^build"]
    }
  }
}
"^build"
含义是:先运行所有上游依赖的
build
任务。 如果没有
^
,则代表是同一工作区的依赖(极少使用)。

concurrent

concurrent

Launch additional tasks alongside this one in the TUI:
json
"repo": {
  "mode": "turbo",
  "tasks": {
    "dev": {
      "concurrent": ["studio"]
    }
  }
}
Running
miso dev
will also launch
studio
as a TUI tab alongside it.
concurrent
tasks are always run by miso directly — they are not passed to turbo/nx even when
mode
is
"turbo"
.
In
"mono"
mode,
concurrent
launches extra scripts from the root
scripts/
folder alongside the workspace-distributed task. In
"turbo"
mode,
concurrent
launches extra scripts from the root
scripts/
folder alongside miso's native
dev
orchestration (not turbo's).

在TUI中与当前任务并行启动额外任务:
json
"repo": {
  "mode": "turbo",
  "tasks": {
    "dev": {
      "concurrent": ["studio"]
    }
  }
}
运行
miso dev
时会同步启动
studio
作为TUI的另一个标签页。
concurrent
定义的任务始终由miso直接运行——即便
mode
设置为
"turbo"
,也不会传递给turbo/nx处理。
"mono"
模式下,
concurrent
会从根目录
scripts/
文件夹中启动额外脚本,与工作区分发的任务并行运行。 在
"turbo"
模式下,
concurrent
会从根目录
scripts/
文件夹中启动额外脚本,与miso原生的
dev
编排流程(而非turbo的编排流程)并行运行。

Overriding a Turbo (or Nx) Task

覆盖Turbo(或Nx)任务

When
repo.mode
is
"turbo"
or
"nx"
, miso routes each command individually:
  • Task name is in
    repo.tasks
    → miso runs it directly with its own TUI orchestration
  • Task name is NOT in
    repo.tasks
    → miso delegates to
    turbo run <task>
    (or
    nx run-many
    )
This lets you pick exactly which tasks miso controls and which turbo handles.
Example: take over
dev
, keep turbo for everything else
Before (turbo handles dev — string shorthand):
json
{
  "repo": "turbo",
  "tui": "tabbed"
}
miso dev
→ delegates to
turbo run dev
; turbo parses output into TUI tabs.
After (miso handles dev — object form with
tasks
):
json
{
  "repo": {
    "mode": "turbo",
    "tasks": {
      "dev": {
        "concurrent": ["studio"]
      }
    }
  },
  "tui": "tabbed"
}
miso dev
→ miso discovers workspaces from
package.json
, launches
dev
+
studio
in parallel in TUI tabs directly.
miso build
and
miso lint
still delegate to turbo.
Minimum override (no extra config needed):
json
"tasks": {
  "dev": {}
}
An empty task entry is enough to make miso take over
dev
.

repo.mode
设置为
"turbo"
"nx"
时,miso会单独路由每个命令:
  • 任务名称存在于
    repo.tasks
    → miso使用自身的TUI编排能力直接运行该任务
  • 任务名称不存在于
    repo.tasks
    → miso将任务委托给
    turbo run <task>
    (或
    nx run-many
    )处理
你可以通过该机制精确控制哪些任务由miso管控,哪些由turbo处理。
示例:接管
dev
任务,其余任务仍由turbo处理
修改前(turbo处理dev —— 字符串简写形式):
json
{
  "repo": "turbo",
  "tui": "tabbed"
}
miso dev
→ 委托给
turbo run dev
处理;turbo将输出解析为TUI标签页。
修改后(miso处理dev —— 带
tasks
的对象形式):
json
{
  "repo": {
    "mode": "turbo",
    "tasks": {
      "dev": {
        "concurrent": ["studio"]
      }
    }
  },
  "tui": "tabbed"
}
miso dev
→ miso从
package.json
中发现工作区,直接在TUI标签页中并行启动
dev
studio
任务。
miso build
miso lint
仍会委托给turbo处理。
最简覆盖配置(无需额外配置):
json
"tasks": {
  "dev": {}
}
空的任务配置项就足以让miso接管
dev
任务。

Full Example

完整示例

json
{
  "$schema": "https://misojs.dev/miso.schema.json",
  "tui": "tabbed",
  "repo": {
    "mode": "turbo",
    "tasks": {
      "dev": {
        "concurrent": ["studio", "worker"]
      },
      "build": {
        "dependsOn": ["^build"]
      }
    }
  }
}

json
{
  "$schema": "https://misojs.dev/miso.schema.json",
  "tui": "tabbed",
  "repo": {
    "mode": "turbo",
    "tasks": {
      "dev": {
        "concurrent": ["studio", "worker"]
      },
      "build": {
        "dependsOn": ["^build"]
      }
    }
  }
}

Common Mistakes

常见错误

  • repo: "turbo"
    without Turbo installed
    — Turbo must be in PATH; miso shells out to
    turbo
    directly
  • dependsOn
    without
    ^
    "dependsOn": ["build"]
    means same-workspace dependency; use
    "dependsOn": ["^build"]
    for cross-workspace topological ordering
  • Expecting TUI for a single process — the TUI only launches when multiple processes are involved (either monorepo workspaces or
    concurrent
    tasks configured)
  • tui
    nested inside
    repo
    tui
    is a top-level field, not under
    repo
  • "repo": "turbo"
    when you want miso to run dev
    — string shorthand
    "turbo"
    fully delegates all tasks to turbo; to make miso handle specific tasks, use the object form with
    tasks
    :
    { "mode": "turbo", "tasks": { "dev": {} } }
  • concurrent
    tasks going to turbo
    concurrent
    tasks are always run by miso directly, even in
    "turbo"
    mode; they are not passed to
    turbo run
  • 配置了
    repo: "turbo"
    但未安装Turbo
    —— Turbo必须在PATH中,miso会直接调用
    turbo
    命令
  • dependsOn
    没有加
    ^
    ——
    "dependsOn": ["build"]
    代表同一工作区的依赖;如果需要跨工作区拓扑排序,请使用
    "dependsOn": ["^build"]
  • 期望单进程也显示TUI —— 只有当涉及多进程时(要么是monorepo工作区,要么配置了
    concurrent
    任务)才会启动TUI
  • tui
    配置嵌套在
    repo
    ——
    tui
    是顶层字段,不能放在
    repo
  • 想要miso运行dev任务却配置了
    "repo": "turbo"
    —— 字符串简写
    "turbo"
    会将所有任务完全委托给turbo;如果想要miso处理特定任务,请使用带
    tasks
    的对象形式:
    { "mode": "turbo", "tasks": { "dev": {} } }
  • 期望
    concurrent
    任务传递给turbo处理
    ——
    concurrent
    任务始终由miso直接运行,即便在
    "turbo"
    模式下也不会传递给
    turbo run