pi-open-tui 0.4.2 → 0.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +25 -0
- package/README.md +52 -120
- package/README.zh-CN.md +52 -120
- package/docs/configuration.md +245 -0
- package/docs/footer-segments.md +121 -0
- package/docs/implementation.md +185 -0
- package/extensions/open-tui/config.ts +25 -7
- package/extensions/open-tui/copy-buttons.ts +141 -63
- package/extensions/open-tui/footer-segments.ts +119 -0
- package/extensions/open-tui/footer.ts +121 -13
- package/extensions/open-tui/index.ts +8 -1
- package/extensions/open-tui/settings-command.ts +312 -63
- package/extensions/open-tui/tool-preview.ts +8 -2
- package/extensions/open-tui/tool-view.ts +184 -31
- package/extensions/open-tui/utils.ts +18 -6
- package/package.json +9 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,30 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.4.3] - 2026-11-05
|
|
4
|
+
|
|
5
|
+
### New Features
|
|
6
|
+
|
|
7
|
+
- Let extensions contribute text to either main footer row through the public `open-tui:footer:*` events, with placement, width priorities, lifecycle cleanup, and a separate visibility setting.
|
|
8
|
+
- Add opt-in compact rows for extension, MCP, and replacement tools through `toolView.extensionTools`, with generic summaries and native rendering on expansion.
|
|
9
|
+
- Add search-specific compact summaries for recognized `@ff-labs/pi-fff` installations, including page match counts, matching file totals, and pagination and fallback hints.
|
|
10
|
+
- Allow selected tools, such as `edit`, to keep their native rendering in compact mode through `toolView.exclude`.
|
|
11
|
+
|
|
12
|
+
### Breaking Changes
|
|
13
|
+
|
|
14
|
+
- Require Pi 1.5.0 or later.
|
|
15
|
+
|
|
16
|
+
### Changed
|
|
17
|
+
|
|
18
|
+
- Group `/open-tui` settings into sections in English and Simplified Chinese, with non-selectable headings and scrolling that includes heading rows.
|
|
19
|
+
- Keep feature introductions and usage examples in both READMEs, and move complete configuration and implementation details into bilingual reference documents in `docs/`.
|
|
20
|
+
|
|
21
|
+
### Fixed
|
|
22
|
+
|
|
23
|
+
- Show code-block Copy labels as soon as streaming ends, without requiring a terminal resize, and hide them when streaming resumes.
|
|
24
|
+
- Preserve each Copy button's code and click region across Markdown block reuse, repeated identical blocks, and mixed cached and new blocks; restore source tabs using the current block occurrence.
|
|
25
|
+
- Cancel pending Copy clicks when buttons are disabled, and suppress clipboard notifications from cleaned-up installations.
|
|
26
|
+
- Make changed-word highlighting for short edit-preview lines independent of scheduling delays, while keeping matching limits for larger diffs.
|
|
27
|
+
|
|
3
28
|
## [0.4.2] - 2026-11-03
|
|
4
29
|
|
|
5
30
|
### Changed
|
package/README.md
CHANGED
|
@@ -8,24 +8,24 @@ A polished terminal interface for the [Pi](https://pi.dev) coding agent.
|
|
|
8
8
|
|
|
9
9
|

|
|
10
10
|
|
|
11
|
-
Live terminal screenshot with Pi 1.4.0.
|
|
12
|
-
|
|
13
11
|
## Highlights
|
|
14
12
|
|
|
15
13
|
- **Pi header** with model, thinking level, working directory, and useful slash-command hints
|
|
16
|
-
- **Responsive footer** with Git state, detected runtime, context usage,
|
|
17
|
-
- **Framed editor** with block, bar, and underline
|
|
18
|
-
- **Project awareness** for 50+ runtimes and detailed Git
|
|
19
|
-
- **Turn telemetry**
|
|
20
|
-
- **Thinking peek
|
|
21
|
-
- **
|
|
14
|
+
- **Responsive footer** with Git state, detected runtime, context usage, tokens, cost, and extension status
|
|
15
|
+
- **Framed editor** with block, bar, and underline cursors, preserving compatible editors from other extensions
|
|
16
|
+
- **Project awareness** for 50+ runtimes and detailed Git state, including ahead/behind, staged, modified, untracked, stash, and detached HEAD
|
|
17
|
+
- **Turn telemetry** with generation speed, time to first token, duration, stalls, tokens, and cost rate
|
|
18
|
+
- **Thinking peek** with a live preview of hidden reasoning while the model works
|
|
19
|
+
- **Compact tool view** with edit/write previews and optional support for extension and MCP tools
|
|
20
|
+
- **Fullscreen Copy buttons** for code blocks and user messages
|
|
21
|
+
- **Interactive settings** in English and Simplified Chinese through `/open-tui`
|
|
22
22
|
|
|
23
23
|
## Requirements
|
|
24
24
|
|
|
25
|
-
- Pi 1.
|
|
25
|
+
- Pi 1.5.0 or later
|
|
26
26
|
- Node.js 22.19.0 or later (Pi's minimum)
|
|
27
27
|
- A terminal with UTF-8 and color support
|
|
28
|
-
- A [Nerd Font](https://www.nerdfonts.com/font-downloads) for the full icon set (optional;
|
|
28
|
+
- A [Nerd Font](https://www.nerdfonts.com/font-downloads) for the full icon set (optional; Unicode and ASCII modes are available)
|
|
29
29
|
|
|
30
30
|
## Install
|
|
31
31
|
|
|
@@ -43,132 +43,64 @@ pi -e npm:pi-open-tui
|
|
|
43
43
|
|
|
44
44
|
## Font and icons
|
|
45
45
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
The default `auto` mode checks the terminal environment, not the installed font file. It uses Nerd Font icons in interactive UTF-8 TTYs, including terminals running through a runner or subshell. If icons appear as boxes or incorrect symbols, open `/open-tui` and choose one of these modes under **Appearance**:
|
|
49
|
-
|
|
50
|
-
- `nerd`: force Nerd Font icons after configuring a Nerd Font in the terminal
|
|
51
|
-
- `unicode`: portable Unicode icons (folder, branch, laptop, bulb, plug, hourglass, ...) that render without a patched font; emoji glyphs use the terminal's emoji fallback
|
|
52
|
-
- `ascii`: use plain-text icons with no patched font required
|
|
53
|
-
- `auto`: use Nerd Font icons in interactive UTF-8 TTYs; use portable Unicode icons for SSH sessions (the client terminal controls the font and usually has no Nerd Font); use ASCII for non-interactive output, `TERM=dumb`, or an explicitly non-UTF-8 locale
|
|
46
|
+
For the full icon set, install a [Nerd Font](https://www.nerdfonts.com/font-downloads), select it in your terminal profile, and restart the terminal. Installing the font in the OS alone is not enough for apps such as VS Code or Windows Terminal.
|
|
54
47
|
|
|
55
|
-
|
|
48
|
+
In `/open-tui`, **Appearance → Icons** offers `auto`, `nerd`, `unicode`, and `ascii`. The default `auto` mode checks the terminal environment, not the installed font. If icons appear as boxes, choose `unicode`; if your terminal has a Nerd Font, you can force `nerd`, including over SSH.
|
|
56
49
|
|
|
57
|
-
|
|
50
|
+
See [icon detection and spacing](./docs/configuration.md#icons) for automatic selection rules and the Kitty spacing option.
|
|
58
51
|
|
|
59
52
|
## Configuration
|
|
60
53
|
|
|
61
|
-
Run `/open-tui` to open the settings dialog.
|
|
62
|
-
|
|
63
|
-
Example configuration:
|
|
64
|
-
|
|
65
|
-
```json
|
|
66
|
-
{
|
|
67
|
-
"enabled": true,
|
|
68
|
-
"header": true,
|
|
69
|
-
"inlineFooter": false,
|
|
70
|
-
"copyButtons": true,
|
|
71
|
-
"settingsLanguage": "en",
|
|
72
|
-
"cursorStyle": "block",
|
|
73
|
-
"icons": {
|
|
74
|
-
"mode": "auto"
|
|
75
|
-
},
|
|
76
|
-
"footerSegments": {
|
|
77
|
-
"cwd": true,
|
|
78
|
-
"hostname": false,
|
|
79
|
-
"sessionName": false,
|
|
80
|
-
"gitBranch": true,
|
|
81
|
-
"gitStatus": true,
|
|
82
|
-
"gitCommit": false,
|
|
83
|
-
"runtime": true,
|
|
84
|
-
"context": true,
|
|
85
|
-
"tokens": true,
|
|
86
|
-
"cost": true,
|
|
87
|
-
"liveTps": true,
|
|
88
|
-
"extensionStatuses": true,
|
|
89
|
-
"capitalizeProviderName": true,
|
|
90
|
-
"nerdIconSpacing": false
|
|
91
|
-
},
|
|
92
|
-
"telemetry": {
|
|
93
|
-
"enabled": true,
|
|
94
|
-
"tps": true,
|
|
95
|
-
"ttft": true,
|
|
96
|
-
"duration": true,
|
|
97
|
-
"tokens": true,
|
|
98
|
-
"stalls": true,
|
|
99
|
-
"cost": true
|
|
100
|
-
},
|
|
101
|
-
"thinkingPeek": {
|
|
102
|
-
"lines": 1
|
|
103
|
-
},
|
|
104
|
-
"toolView": {
|
|
105
|
-
"mode": "native"
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
```
|
|
54
|
+
Run `/open-tui` to open the settings dialog. Its **General**, **Appearance**, **Footer**, and **Telemetry** tabs are available in English and Simplified Chinese and adapt to the terminal size. Use Tab/Shift+Tab or ←/→ to switch tabs, ↑/↓ to move, Enter/Space to change a value, and Esc/q to close.
|
|
109
55
|
|
|
110
|
-
|
|
56
|
+
Settings are stored in `open-tui.json` inside Pi's agent directory (default: `~/.pi/agent`; overridden by `PI_CODING_AGENT_DIR`). If saving fails, a warning explains that the change applies only to the current session.
|
|
111
57
|
|
|
112
|
-
|
|
|
58
|
+
| Setting | Where to find it | Default |
|
|
113
59
|
| --- | --- | --- |
|
|
114
|
-
|
|
|
115
|
-
|
|
|
116
|
-
|
|
|
117
|
-
|
|
|
118
|
-
|
|
|
119
|
-
|
|
|
120
|
-
|
|
|
121
|
-
| `footerSegments.capitalizeProviderName` | Boolean | Capitalizes the first character of the provider name in the footer; set it to `false` to keep the provider's original casing |
|
|
122
|
-
| `footerSegments.nerdIconSpacing` | Boolean | Adds an extra blank cell after Nerd Font icons in the footer; defaults to `false` |
|
|
123
|
-
| `telemetry` | Boolean flags | Enables telemetry and its individual measurements |
|
|
124
|
-
| `thinkingPeek.lines` | `0`, `1`, `2` | Off, one-line, or two-line hidden thinking preview |
|
|
125
|
-
| `toolView.mode` | `native`, `compact` | Pi's native cards (default) or compact call/summary rows with successful edit/write previews. Applies to rows created after the change |
|
|
126
|
-
|
|
127
|
-
`sessionName` appears only when the session has a name. `hostname` shows the short host name (first label of the machine's host name, e.g. `mba` from `mba.example.com`) with a server icon. In detached HEAD state, `gitBranch` shows `HEAD` with the short commit hash; `gitCommit` appends the tag pointing at that commit and only takes effect while `gitBranch` is on. Disabling `extensionStatuses` hides the entire extension status line, including MCP status. Each status keeps the colours its extension applied with `ctx.ui.theme.fg()`. A status without colours renders in the muted theme colour.
|
|
60
|
+
| Header and settings language | General → Interface | Header on, English |
|
|
61
|
+
| Thinking peek | General → Messages & tools | 1 line |
|
|
62
|
+
| Copy buttons | General → Messages & tools | On, fullscreen only |
|
|
63
|
+
| Tool view | General → Messages & tools | Native |
|
|
64
|
+
| Footer in editor border | General → Footer | Off |
|
|
65
|
+
| Icons and cursor style | Appearance | Auto icons, block cursor |
|
|
66
|
+
| Footer fields and telemetry measurements | Footer / Telemetry | Individually configurable |
|
|
128
67
|
|
|
129
|
-
|
|
68
|
+
Selecting **Tool view: Compact** reveals **Compact extension tools** as a child setting. Switching back to Native hides it and retains its value. The [configuration reference](./docs/configuration.md#english) contains the complete JSON defaults, every option, and tool exclusions.
|
|
130
69
|
|
|
131
|
-
|
|
70
|
+
## Header, footer, and editor
|
|
132
71
|
|
|
133
|
-
|
|
72
|
+
The header provides model and project context with command hints. The two main footer rows keep location, Git state, runtime, a working/done timer, context usage, model details, tokens, and cost visible as space allows. Fields can be toggled individually; the layout shortens or hides lower-priority information in narrow terminals.
|
|
134
73
|
|
|
135
|
-
|
|
74
|
+
Footer token and cost totals include assistant responses, tool-reported usage, compaction and branch summaries, and cache warming. The cache-hit percentage describes the latest assistant response. Other extensions can use separate status rows or [contribute text directly to the main footer](./docs/footer-segments.md).
|
|
136
75
|
|
|
137
|
-
|
|
76
|
+
Enable **Footer in editor border** to move the two main rows into the editor's top and bottom borders. Extension status rows remain below the editor. Compatible editors keep their input behavior, completion, and ghost text; editors that cannot be framed retain a separate footer. See [editor compatibility and layout](./docs/implementation.md#editor-and-layout) for the integration boundaries.
|
|
138
77
|
|
|
139
78
|
## Turn telemetry
|
|
140
79
|
|
|
141
|
-
After each complete agent run, pi-open-tui shows one transient result
|
|
80
|
+
After each complete agent run, pi-open-tui shows one transient result, combining its assistant turns:
|
|
142
81
|
|
|
143
82
|
```text
|
|
144
83
|
> TPS 42.5 tok/s | ~ TTFT 1.2s | + 29.7s | ↑ 567 | ↓ 1.2k | ! stall 1x / 4.3s | $ $3.60/M
|
|
145
84
|
```
|
|
146
85
|
|
|
147
|
-
TPS
|
|
86
|
+
TPS measures provider-reported output tokens over generation time, including waiting and stalls but excluding tool execution between turns. The working timer also shows an estimated live speed such as `~54 tok/s` during streaming. The `$ / M` field is the effective rate per million tokens for the run; the footer shows cumulative session cost.
|
|
148
87
|
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
The `$ / M` value is the model's list-price rate from `usage.cost.total`, not the cumulative session cost shown in the footer. Every telemetry field can be toggled from the **Telemetry** tab.
|
|
88
|
+
Toggle notification fields under **Telemetry → Measurements**, or live speed under **Footer → Runtime → Live TPS**. See [measurement definitions](./docs/implementation.md#usage-and-telemetry) for formulas, timing boundaries, and cache accounting.
|
|
152
89
|
|
|
153
90
|
## Thinking peek
|
|
154
91
|
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
- while the model is reasoning, the current thinking tail streams by with a spinner (`~ think ⠋ …`);
|
|
158
|
-
- when the answer starts, it settles on a check mark (`~ think ✓`);
|
|
159
|
-
- in 2-line mode, the previous and latest thinking lines share the same text indentation; if the latest line overflows, both rows follow its newest tail as tokens arrive instead of retaining the previous line;
|
|
160
|
-
- after the task settles, the native `Thinking...` label is restored.
|
|
92
|
+
With Pi's **Hide thinking** enabled, pi-open-tui replaces the hidden block's `Thinking...` label with the latest reasoning tail while the model works:
|
|
161
93
|
|
|
162
94
|
```text
|
|
163
95
|
~ think ⠋ previous thought
|
|
164
96
|
latest thought
|
|
165
97
|
```
|
|
166
98
|
|
|
167
|
-
|
|
99
|
+
Choose **Off**, **1 line**, or **2 lines** under **General → Messages & tools → Thinking peek**. The ticker appears only when the model streams reasoning, settles on a check mark when the answer begins, and returns to Pi's native label after the task settles. It follows Pi's Hide thinking toggle immediately and clips text to fit the available width.
|
|
168
100
|
|
|
169
101
|
## Tool view
|
|
170
102
|
|
|
171
|
-
**Native** remains the default.
|
|
103
|
+
**Native** remains the default. Select **General → Messages & tools → Tool view → Compact** to display Pi's built-in tools (`read`, `bash`, `powershell`, `edit`, `write`, `grep`, `find`, `ls`) as call and summary rows:
|
|
172
104
|
|
|
173
105
|
```text
|
|
174
106
|
● Read(extensions/open-tui/footer.ts:1-120)
|
|
@@ -179,18 +111,17 @@ The ticker appears only once the model actually streams reasoning, so non-reason
|
|
|
179
111
|
└ Done · 131 lines · 6.4s
|
|
180
112
|
```
|
|
181
113
|
|
|
182
|
-
- Successful
|
|
183
|
-
-
|
|
184
|
-
-
|
|
185
|
-
-
|
|
186
|
-
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
- The mode is chosen when Pi creates a row, so switching it affects new rows; `/reload` or a new session applies it to the whole transcript.
|
|
114
|
+
- Successful `edit` and `write` calls show syntax-highlighted previews of up to 16 rows, with a hint to expand longer output.
|
|
115
|
+
- Running shell calls show recent output and elapsed time; errors retain their error summary.
|
|
116
|
+
- Click a row to expand its native card, or use `Ctrl+O` to expand all rows. Tools, arguments, results, and model-visible content are unchanged.
|
|
117
|
+
- Enable **Compact extension tools** to include extension and MCP tools. Use `toolView.exclude` in the config file for tools that should keep native rendering. Recognized `@ff-labs/pi-fff` tools receive search-specific summaries.
|
|
118
|
+
- Changing the mode affects newly created rows. Use `/reload` or a new session to apply it to the whole transcript.
|
|
119
|
+
|
|
120
|
+
See [tool rendering details](./docs/implementation.md#tool-rendering) for preview rules, extension summaries, and renderer compatibility.
|
|
190
121
|
|
|
191
122
|
## Copy buttons
|
|
192
123
|
|
|
193
|
-
In fullscreen mode (Pi's `tuiMode: "fullscreen"`),
|
|
124
|
+
In fullscreen mode (Pi's `tuiMode: "fullscreen"`), completed code blocks show a clickable `[Copy]` label in their rounded frame when there is enough width. User messages have a Copy label too. Clicking copies the source text and Pi flashes `Copied!`.
|
|
194
125
|
|
|
195
126
|
```text
|
|
196
127
|
╭─ sh ─────────────── [Copy] ╮
|
|
@@ -198,15 +129,16 @@ In fullscreen mode (Pi's `tuiMode: "fullscreen"`), every fenced code block is dr
|
|
|
198
129
|
╰────────────────────────────╯
|
|
199
130
|
```
|
|
200
131
|
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
- Drag-selecting across a frame includes its border characters and the `[Copy]` text.
|
|
207
|
-
- If pi-pretty-tui is installed, its own code-block frames and copy buttons are kept and these are not drawn.
|
|
132
|
+
Code labels copy code without fences, preserving indentation and tabs. User-message labels copy the original message. Streaming code blocks gain their label when streaming finishes; regular mode and thinking blocks keep Pi's plain fences. Use Pi's `/copy` to copy a whole assistant reply.
|
|
133
|
+
|
|
134
|
+
Toggle **General → Messages & tools → Copy buttons** to enable or disable this feature. [Copy-button details](./docs/implementation.md#copy-button-behavior) cover width limits, cached blocks, and interaction with other renderers.
|
|
135
|
+
|
|
136
|
+
## Documentation
|
|
208
137
|
|
|
209
|
-
|
|
138
|
+
- [Configuration reference](./docs/configuration.md#english) — complete defaults, options, and icon selection
|
|
139
|
+
- [Implementation and compatibility](./docs/implementation.md#english) — measurement formulas, layout, rendering, and lifecycle
|
|
140
|
+
- [Extension footer segments](./docs/footer-segments.md) — public events and an integration example for extension authors
|
|
141
|
+
- [Changelog](./CHANGELOG.md) — released and upcoming changes
|
|
210
142
|
|
|
211
143
|
## Local development
|
|
212
144
|
|
|
@@ -217,7 +149,7 @@ npm run typecheck
|
|
|
217
149
|
pi -e .
|
|
218
150
|
```
|
|
219
151
|
|
|
220
|
-
CI checks Pi 1.
|
|
152
|
+
CI checks Pi 1.5.0 and the latest release on Node.js 22.19.0 and 24 across Linux, Windows, and macOS. Keep all Pi packages on the same version. Use `pi -e .` to check terminal fonts, mouse interaction, and cursor support interactively.
|
|
221
153
|
|
|
222
154
|
## Acknowledgements
|
|
223
155
|
|
package/README.zh-CN.md
CHANGED
|
@@ -8,24 +8,24 @@
|
|
|
8
8
|
|
|
9
9
|

|
|
10
10
|
|
|
11
|
-
Pi 1.4.0 的真实终端截图。
|
|
12
|
-
|
|
13
11
|
## 功能亮点
|
|
14
12
|
|
|
15
13
|
- **Pi 顶栏**:显示模型、思考等级、当前目录和常用斜杠命令提示
|
|
16
|
-
-
|
|
17
|
-
-
|
|
18
|
-
- **项目环境感知**:识别 50 多种运行环境,并展示 ahead/behind、已暂存、已修改、未跟踪、stash
|
|
19
|
-
-
|
|
20
|
-
-
|
|
21
|
-
-
|
|
14
|
+
- **自适应底栏**:展示 Git 状态、运行环境、上下文用量、Token、费用和扩展状态
|
|
15
|
+
- **带边框的编辑器**:支持块状、竖线和下划线光标,保留其他扩展的兼容编辑器
|
|
16
|
+
- **项目环境感知**:识别 50 多种运行环境,并展示 ahead/behind、已暂存、已修改、未跟踪、stash 和分离 HEAD 等 Git 状态
|
|
17
|
+
- **单轮遥测**:展示生成速度、首 Token 延迟、耗时、停顿、Token 数量和费用速率
|
|
18
|
+
- **思考预览**:模型工作时实时预览隐藏的推理内容
|
|
19
|
+
- **紧凑工具视图**:提供编辑/写入预览,可选支持扩展和 MCP 工具
|
|
20
|
+
- **全屏复制按钮**:一键复制代码块和用户消息
|
|
21
|
+
- **交互式设置**:通过 `/open-tui` 使用英文或简体中文界面
|
|
22
22
|
|
|
23
23
|
## 环境要求
|
|
24
24
|
|
|
25
|
-
- Pi 1.
|
|
25
|
+
- Pi 1.5.0 或更高版本
|
|
26
26
|
- Node.js 22.19.0 或更高版本(Pi 的最低要求)
|
|
27
27
|
- 支持 UTF-8 和彩色输出的终端
|
|
28
|
-
- 使用完整图标集时需要 [Nerd Font](https://www.nerdfonts.com/font-downloads)
|
|
28
|
+
- 使用完整图标集时需要 [Nerd Font](https://www.nerdfonts.com/font-downloads)(可选,也可使用 Unicode 或 ASCII 模式)
|
|
29
29
|
|
|
30
30
|
## 安装
|
|
31
31
|
|
|
@@ -43,132 +43,64 @@ pi -e npm:pi-open-tui
|
|
|
43
43
|
|
|
44
44
|
## 字体与图标
|
|
45
45
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
默认的 `auto` 模式检查终端环境,而不是已安装的字体文件。在支持 UTF-8 的交互式 TTY 中,它会使用 Nerd Font 图标,即使 Pi 运行在 runner 或子 shell 中。如果图标显示为方框、乱码或错误符号,请打开 `/open-tui`,在**外观**页选择合适的模式:
|
|
49
|
-
|
|
50
|
-
- `nerd`:终端已配置 Nerd Font 时,强制使用 Nerd Font 图标
|
|
51
|
-
- `unicode`:可移植 Unicode 图标(文件夹、分支、笔记本电脑、灯泡、插头、沙漏等),无需修补字体;emoji 字形通过终端的 emoji 回退渲染
|
|
52
|
-
- `ascii`:使用纯文本图标,无需安装修补字体
|
|
53
|
-
- `auto`:在支持 UTF-8 的交互式 TTY 中使用 Nerd Font 图标;SSH 会话使用可移植 Unicode 图标(字体由客户端终端决定,通常没有 Nerd Font);非交互式输出、`TERM=dumb` 或明确配置为非 UTF-8 的 locale 使用 ASCII
|
|
46
|
+
使用完整图标集时,请安装 [Nerd Font](https://www.nerdfonts.com/font-downloads),在终端配置中选中它并重启终端。使用 VS Code、Windows Terminal 等应用时,只在操作系统中安装字体还不够。
|
|
54
47
|
|
|
55
|
-
|
|
48
|
+
`/open-tui` 的**外观 → 图标**提供 `auto`、`nerd`、`unicode` 和 `ascii`。默认 `auto` 检查终端环境,并不检查实际字体;图标显示为方框时可选 `unicode`,终端已配置 Nerd Font 时可强制选 `nerd`,SSH 会话同样适用。
|
|
56
49
|
|
|
57
|
-
|
|
50
|
+
自动选择规则和 Kitty 的间距选项见[图标检测与间距](./docs/configuration.md#图标)。
|
|
58
51
|
|
|
59
52
|
## 配置
|
|
60
53
|
|
|
61
|
-
运行 `/open-tui`
|
|
62
|
-
|
|
63
|
-
配置示例:
|
|
64
|
-
|
|
65
|
-
```json
|
|
66
|
-
{
|
|
67
|
-
"enabled": true,
|
|
68
|
-
"header": true,
|
|
69
|
-
"inlineFooter": false,
|
|
70
|
-
"copyButtons": true,
|
|
71
|
-
"settingsLanguage": "zh",
|
|
72
|
-
"cursorStyle": "block",
|
|
73
|
-
"icons": {
|
|
74
|
-
"mode": "auto"
|
|
75
|
-
},
|
|
76
|
-
"footerSegments": {
|
|
77
|
-
"cwd": true,
|
|
78
|
-
"hostname": false,
|
|
79
|
-
"sessionName": false,
|
|
80
|
-
"gitBranch": true,
|
|
81
|
-
"gitStatus": true,
|
|
82
|
-
"gitCommit": false,
|
|
83
|
-
"runtime": true,
|
|
84
|
-
"context": true,
|
|
85
|
-
"tokens": true,
|
|
86
|
-
"cost": true,
|
|
87
|
-
"liveTps": true,
|
|
88
|
-
"extensionStatuses": true,
|
|
89
|
-
"capitalizeProviderName": true,
|
|
90
|
-
"nerdIconSpacing": false
|
|
91
|
-
},
|
|
92
|
-
"telemetry": {
|
|
93
|
-
"enabled": true,
|
|
94
|
-
"tps": true,
|
|
95
|
-
"ttft": true,
|
|
96
|
-
"duration": true,
|
|
97
|
-
"tokens": true,
|
|
98
|
-
"stalls": true,
|
|
99
|
-
"cost": true
|
|
100
|
-
},
|
|
101
|
-
"thinkingPeek": {
|
|
102
|
-
"lines": 1
|
|
103
|
-
},
|
|
104
|
-
"toolView": {
|
|
105
|
-
"mode": "native"
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
```
|
|
54
|
+
运行 `/open-tui` 打开设置窗口,包含**常规**、**外观**、**底栏**和**遥测**四个页面,支持英文和简体中文,并适应终端尺寸。Tab/Shift+Tab 或 ←/→ 切页,↑/↓ 移动,Enter/Space 修改值,Esc/q 关闭。
|
|
109
55
|
|
|
110
|
-
|
|
56
|
+
设置保存在 Pi 的 agent 目录内的 `open-tui.json` 中,默认目录是 `~/.pi/agent`,可通过 `PI_CODING_AGENT_DIR` 覆盖。保存失败时会提示:修改仅在当前会话生效。
|
|
111
57
|
|
|
112
|
-
|
|
|
58
|
+
| 设置 | 位置 | 默认值 |
|
|
113
59
|
| --- | --- | --- |
|
|
114
|
-
|
|
|
115
|
-
|
|
|
116
|
-
|
|
|
117
|
-
|
|
|
118
|
-
|
|
|
119
|
-
|
|
|
120
|
-
|
|
|
121
|
-
| `footerSegments.capitalizeProviderName` | 布尔开关 | 将底栏中提供商名称的首字母大写;设为 `false` 时保留原始大小写 |
|
|
122
|
-
| `footerSegments.nerdIconSpacing` | 布尔开关 | 在底栏 Nerd Font 图标后额外留一格空白;默认 `false` |
|
|
123
|
-
| `telemetry` | 布尔开关 | 控制遥测总开关和各项指标 |
|
|
124
|
-
| `thinkingPeek.lines` | `0`、`1`、`2` | 关闭、单行或双行思考预览 |
|
|
125
|
-
| `toolView.mode` | `native`、`compact` | Pi 原生卡片(默认),或带编辑/写入成功预览的紧凑调用与摘要行。只对切换后新建的行生效 |
|
|
126
|
-
|
|
127
|
-
`sessionName` 仅在会话有名称时显示;`hostname` 会显示主机名的短名称(主机名的第一个标签,例如从 `mba.example.com` 显示为 `mba`),并使用服务器图标;处于分离 HEAD(detached HEAD)状态时,`gitBranch` 会显示 `HEAD` 和短提交哈希,`gitCommit` 会在其后追加指向该提交的标签,且仅在开启 `gitBranch` 时生效;关闭 `extensionStatuses` 会隐藏整行扩展状态,其中也包括 MCP 状态。每条状态会保留其扩展通过 `ctx.ui.theme.fg()` 设置的颜色;未设置颜色的状态使用 muted 主题色显示。
|
|
60
|
+
| 顶栏与设置语言 | 常规 → 界面 | 顶栏开启、英文 |
|
|
61
|
+
| 思考预览 | 常规 → 消息与工具 | 单行 |
|
|
62
|
+
| 复制按钮 | 常规 → 消息与工具 | 开启,仅全屏模式 |
|
|
63
|
+
| 工具视图 | 常规 → 消息与工具 | 原生 |
|
|
64
|
+
| 底栏嵌入输入框 | 常规 → 底栏 | 关闭 |
|
|
65
|
+
| 图标与光标样式 | 外观 | 自动图标、块状光标 |
|
|
66
|
+
| 底栏字段与遥测指标 | 底栏 / 遥测 | 可分别设置 |
|
|
128
67
|
|
|
129
|
-
|
|
68
|
+
选择**工具视图:紧凑**后,才会显示子选项**紧凑显示扩展工具**;切回原生时隐藏该选项并保留其值。完整 JSON 默认配置、所有选项和工具排除列表见[配置参考](./docs/configuration.md#简体中文)。
|
|
130
69
|
|
|
131
|
-
|
|
70
|
+
## 顶栏、底栏与编辑器
|
|
132
71
|
|
|
133
|
-
|
|
72
|
+
顶栏提供模型、项目环境和命令提示。两条主底栏集中显示位置、Git 状态、运行环境、工作/完成计时器、上下文用量、模型详情、Token 和费用。可单独开关各项字段;终端变窄时,布局会缩短或隐藏低优先级信息。
|
|
134
73
|
|
|
135
|
-
|
|
74
|
+
底栏 Token 和费用总计包含助手回复、工具报告的用量、压缩与分支摘要以及缓存预热;缓存命中率表示最近一条助手回复。其他扩展可以使用独立状态行,也可以[直接向主底栏添加内容](./docs/footer-segments.md)。
|
|
136
75
|
|
|
137
|
-
|
|
76
|
+
开启**底栏嵌入输入框**,可把两条主信息行移入编辑器上下边框,扩展状态行仍显示在编辑器下方。兼容编辑器会保留输入行为、补全和灰字建议;无法加框的编辑器继续使用独立底栏。集成边界见[编辑器兼容性与布局](./docs/implementation.md#编辑器与布局)。
|
|
138
77
|
|
|
139
78
|
## 单轮遥测
|
|
140
79
|
|
|
141
|
-
每次 Agent 完整运行结束后,pi-open-tui
|
|
80
|
+
每次 Agent 完整运行结束后,pi-open-tui 会合并其中的助手轮次,显示一条临时结果:
|
|
142
81
|
|
|
143
82
|
```text
|
|
144
83
|
> TPS 42.5 tok/s | ~ TTFT 1.2s | + 29.7s | ↑ 567 | ↓ 1.2k | ! stall 1x / 4.3s | $ $3.60/M
|
|
145
84
|
```
|
|
146
85
|
|
|
147
|
-
TPS
|
|
86
|
+
TPS 用服务商报告的输出 Token 除以生成时间,包含等待和停顿,不包含轮次之间的工具执行时间。流式输出期间,工作计时器还会显示 `~54 tok/s` 这样的实时估算速度。`$ / M` 表示本次运行每百万 Token 的综合费率,底栏则显示会话累计费用。
|
|
148
87
|
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
`$ / M` 表示根据 `usage.cost.total` 得到的模型标价速率,不是底栏中的会话累计费用。所有遥测字段都可以在**遥测**页单独开关。
|
|
88
|
+
可在**遥测 → 测量指标**中开关通知字段,在**底栏 → 运行环境 → 实时 TPS**中控制实时速度。计算公式、计时边界和缓存统计见[指标定义](./docs/implementation.md#用量与遥测)。
|
|
152
89
|
|
|
153
90
|
## 思考预览
|
|
154
91
|
|
|
155
|
-
开启 Pi 的 **Hide thinking**
|
|
156
|
-
|
|
157
|
-
- 模型推理时,思考内容的末尾片段会随 spinner 滚动(`~ think ⠋ …`);
|
|
158
|
-
- 开始输出正文时定格为对勾(`~ think ✓`);
|
|
159
|
-
- 双行模式中,上一条和最新一条思考内容使用相同的文字缩进;如果最新一行超出宽度,则两行随新 Token 持续显示它的最新末尾片段,不再保留上一条;
|
|
160
|
-
- 任务结束后恢复原生 `Thinking...` 标签。
|
|
92
|
+
开启 Pi 的 **Hide thinking** 后,模型工作时 pi-open-tui 会用最新推理片段替换隐藏思考块的 `Thinking...` 标签:
|
|
161
93
|
|
|
162
94
|
```text
|
|
163
95
|
~ think ⠋ 上一条思考
|
|
164
96
|
最新一条思考
|
|
165
97
|
```
|
|
166
98
|
|
|
167
|
-
|
|
99
|
+
在**常规 → 消息与工具 → 思考预览**中选择**关闭、单行或双行**。字幕仅在模型真正输出推理时出现,正文开始后变为对勾,任务结束后恢复原生标签。可见性随 Pi 的 Hide thinking 开关立即变化,文字会按可用宽度截断。
|
|
168
100
|
|
|
169
101
|
## 工具视图
|
|
170
102
|
|
|
171
|
-
|
|
103
|
+
默认使用**原生**模式。在**常规 → 消息与工具 → 工具视图**中选择**紧凑**后,Pi 内置工具(`read`、`bash`、`powershell`、`edit`、`write`、`grep`、`find`、`ls`)显示为调用行和摘要行:
|
|
172
104
|
|
|
173
105
|
```text
|
|
174
106
|
● Read(extensions/open-tui/footer.ts:1-120)
|
|
@@ -179,18 +111,17 @@ TPS 的计算方式是:将本次运行中服务商报告的全部 Assistant
|
|
|
179
111
|
└ Done · 131 lines · 6.4s
|
|
180
112
|
```
|
|
181
113
|
|
|
182
|
-
-
|
|
183
|
-
-
|
|
184
|
-
- `
|
|
185
|
-
-
|
|
186
|
-
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
- 模式在 Pi 创建某行时确定,因此切换只影响新建的行;执行 `/reload` 或新开会话后整个记录都会应用。
|
|
114
|
+
- `edit` 和 `write` 成功后显示带语法高亮的预览,最多 16 行,较长输出会提示展开。
|
|
115
|
+
- Shell 运行时显示近期输出和已用时间;出错时保留错误摘要。
|
|
116
|
+
- 点击某行展开其原生卡片,`Ctrl+O` 展开全部行。工具、参数、结果和模型看到的内容都不改变。
|
|
117
|
+
- 开启**紧凑显示扩展工具**可包含扩展和 MCP 工具;需要保留原生显示的工具可写入配置文件中的 `toolView.exclude`。识别到的 `@ff-labs/pi-fff` 工具使用专门的搜索摘要。
|
|
118
|
+
- 切换模式只影响新建的行;执行 `/reload` 或新开会话后,整个记录都会应用。
|
|
119
|
+
|
|
120
|
+
预览规则、扩展摘要和渲染器兼容性见[工具渲染细节](./docs/implementation.md#工具渲染)。
|
|
190
121
|
|
|
191
122
|
## 复制按钮
|
|
192
123
|
|
|
193
|
-
全屏模式(Pi 的 `tuiMode: "fullscreen"
|
|
124
|
+
全屏模式(Pi 的 `tuiMode: "fullscreen"`)下,完成的代码块会在宽度足够时,在圆角边框中显示可点击的 `[Copy]` 标签;用户消息也有复制标签。点击后复制原文,Pi 会短暂提示 `Copied!`。
|
|
194
125
|
|
|
195
126
|
```text
|
|
196
127
|
╭─ sh ─────────────── [Copy] ╮
|
|
@@ -198,15 +129,16 @@ TPS 的计算方式是:将本次运行中服务商报告的全部 Assistant
|
|
|
198
129
|
╰────────────────────────────╯
|
|
199
130
|
```
|
|
200
131
|
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
- 拖动选择经过边框时会包含边框字符和 `[Copy]` 文字。
|
|
207
|
-
- 如果同时安装了 pi-pretty-tui,则保留它自己的代码块边框和复制按钮,不再绘制这些内容。
|
|
132
|
+
代码标签复制不含围栏的代码,保留缩进和制表符;用户消息标签复制输入原文。流式代码块会在输出结束后显示标签;普通模式和思考块保留 Pi 原生围栏。复制整条助手回复请使用 Pi 的 `/copy`。
|
|
133
|
+
|
|
134
|
+
可在**常规 → 消息与工具 → 复制按钮**中开关此功能。宽度限制、代码块缓存和与其他渲染器共存的细节见[复制按钮说明](./docs/implementation.md#复制按钮行为)。
|
|
135
|
+
|
|
136
|
+
## 文档
|
|
208
137
|
|
|
209
|
-
|
|
138
|
+
- [配置参考](./docs/configuration.md#简体中文) — 完整默认值、配置项和图标选择规则
|
|
139
|
+
- [实现与兼容性](./docs/implementation.md#简体中文) — 指标公式、布局、渲染和生命周期
|
|
140
|
+
- [扩展底栏接口(英文)](./docs/footer-segments.md) — 面向扩展开发者的公开事件和接入示例
|
|
141
|
+
- [更新日志](./CHANGELOG.md) — 已发布和待发布的改动
|
|
210
142
|
|
|
211
143
|
## 本地开发
|
|
212
144
|
|
|
@@ -217,7 +149,7 @@ npm run typecheck
|
|
|
217
149
|
pi -e .
|
|
218
150
|
```
|
|
219
151
|
|
|
220
|
-
CI 在 Linux、Windows、macOS 上,使用 Node.js 22.19.0 和 24
|
|
152
|
+
CI 在 Linux、Windows、macOS 上,使用 Node.js 22.19.0 和 24 检查 Pi 1.5.0 及最新版本。核对兼容性时应让所有 Pi 包保持同一版本。终端字体、鼠标交互和光标支持可通过 `pi -e .` 实际检查。
|
|
221
153
|
|
|
222
154
|
## 致谢
|
|
223
155
|
|