openvibe 0.57.1 → 0.58.1
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/README.md +100 -510
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -1,569 +1,159 @@
|
|
|
1
|
-
|
|
2
|
-
<a href="https://shittycodingagent.ai">
|
|
3
|
-
<img src="https://shittycodingagent.ai/logo.svg" alt="pi logo" width="128">
|
|
4
|
-
</a>
|
|
5
|
-
</p>
|
|
6
|
-
<p align="center">
|
|
7
|
-
<a href="https://discord.com/invite/3cU7Bz4UPx"><img alt="Discord" src="https://img.shields.io/badge/discord-community-5865F2?style=flat-square&logo=discord&logoColor=white" /></a>
|
|
8
|
-
<a href="https://www.npmjs.com/package/@mariozechner/pi-coding-agent"><img alt="npm" src="https://img.shields.io/npm/v/@mariozechner/pi-coding-agent?style=flat-square" /></a>
|
|
9
|
-
<a href="https://github.com/badlogic/pi-mono/actions/workflows/ci.yml"><img alt="Build status" src="https://img.shields.io/github/actions/workflow/status/badlogic/pi-mono/ci.yml?style=flat-square&branch=main" /></a>
|
|
10
|
-
</p>
|
|
11
|
-
<p align="center">
|
|
12
|
-
<a href="https://pi.dev">pi.dev</a> domain graciously donated by
|
|
13
|
-
<br /><br />
|
|
14
|
-
<a href="https://exe.dev"><img src="docs/images/exy.png" alt="Exy mascot" width="48" /><br />exe.dev</a>
|
|
15
|
-
</p>
|
|
16
|
-
|
|
17
|
-
Pi is a minimal terminal coding harness. Adapt pi to your workflows, not the other way around, without having to fork and modify pi internals. Extend it with TypeScript [Extensions](#extensions), [Skills](#skills), [Prompt Templates](#prompt-templates), and [Themes](#themes). Put your extensions, skills, prompt templates, and themes in [Pi Packages](#pi-packages) and share them with others via npm or git.
|
|
18
|
-
|
|
19
|
-
Pi ships with powerful defaults but skips features like sub agents and plan mode. Instead, you can ask pi to build what you want or install a third party pi package that matches your workflow.
|
|
20
|
-
|
|
21
|
-
Pi runs in four modes: interactive, print or JSON, RPC for process integration, and an SDK for embedding in your own apps. See [openclaw/openclaw](https://github.com/openclaw/openclaw) for a real-world SDK integration.
|
|
22
|
-
|
|
23
|
-
## Table of Contents
|
|
24
|
-
|
|
25
|
-
- [Quick Start](#quick-start)
|
|
26
|
-
- [Providers & Models](#providers--models)
|
|
27
|
-
- [Interactive Mode](#interactive-mode)
|
|
28
|
-
- [Editor](#editor)
|
|
29
|
-
- [Commands](#commands)
|
|
30
|
-
- [Keyboard Shortcuts](#keyboard-shortcuts)
|
|
31
|
-
- [Message Queue](#message-queue)
|
|
32
|
-
- [Sessions](#sessions)
|
|
33
|
-
- [Branching](#branching)
|
|
34
|
-
- [Compaction](#compaction)
|
|
35
|
-
- [Settings](#settings)
|
|
36
|
-
- [Context Files](#context-files)
|
|
37
|
-
- [Customization](#customization)
|
|
38
|
-
- [Prompt Templates](#prompt-templates)
|
|
39
|
-
- [Skills](#skills)
|
|
40
|
-
- [Extensions](#extensions)
|
|
41
|
-
- [Themes](#themes)
|
|
42
|
-
- [Pi Packages](#pi-packages)
|
|
43
|
-
- [Programmatic Usage](#programmatic-usage)
|
|
44
|
-
- [Philosophy](#philosophy)
|
|
45
|
-
- [CLI Reference](#cli-reference)
|
|
46
|
-
|
|
47
|
-
---
|
|
48
|
-
|
|
49
|
-
## Quick Start
|
|
1
|
+
# OpenVibe
|
|
50
2
|
|
|
51
|
-
|
|
52
|
-
npm install -g @mariozechner/pi-coding-agent
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
Authenticate with an API key:
|
|
56
|
-
|
|
57
|
-
```bash
|
|
58
|
-
export ANTHROPIC_API_KEY=sk-ant-...
|
|
59
|
-
pi
|
|
60
|
-
```
|
|
3
|
+
OpenVibe 是一个专业的 AI 编程助手,为开发者提供智能的代码编辑、文件管理和项目协作功能。
|
|
61
4
|
|
|
62
|
-
|
|
5
|
+
## 安装
|
|
63
6
|
|
|
64
7
|
```bash
|
|
65
|
-
|
|
66
|
-
/login # Then select provider
|
|
8
|
+
npm install -g openvibe
|
|
67
9
|
```
|
|
68
10
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
**Platform notes:** [Windows](docs/windows.md) | [Termux (Android)](docs/termux.md) | [tmux](docs/tmux.md) | [Terminal setup](docs/terminal-setup.md) | [Shell aliases](docs/shell-aliases.md)
|
|
72
|
-
|
|
73
|
-
---
|
|
74
|
-
|
|
75
|
-
## Providers & Models
|
|
76
|
-
|
|
77
|
-
For each built-in provider, pi maintains a list of tool-capable models, updated with every release. Authenticate via subscription (`/login`) or API key, then select any model from that provider via `/model` (or Ctrl+L).
|
|
78
|
-
|
|
79
|
-
**Subscriptions:**
|
|
80
|
-
- Anthropic Claude Pro/Max
|
|
81
|
-
- OpenAI ChatGPT Plus/Pro (Codex)
|
|
82
|
-
- GitHub Copilot
|
|
83
|
-
- Google Gemini CLI
|
|
84
|
-
- Google Antigravity
|
|
85
|
-
|
|
86
|
-
**API keys:**
|
|
87
|
-
- Anthropic
|
|
88
|
-
- OpenAI
|
|
89
|
-
- Azure OpenAI
|
|
90
|
-
- Google Gemini
|
|
91
|
-
- Google Vertex
|
|
92
|
-
- Amazon Bedrock
|
|
93
|
-
- Mistral
|
|
94
|
-
- Groq
|
|
95
|
-
- Cerebras
|
|
96
|
-
- xAI
|
|
97
|
-
- OpenRouter
|
|
98
|
-
- Vercel AI Gateway
|
|
99
|
-
- ZAI
|
|
100
|
-
- OpenCode Zen
|
|
101
|
-
- OpenCode Go
|
|
102
|
-
- Hugging Face
|
|
103
|
-
- Kimi For Coding
|
|
104
|
-
- MiniMax
|
|
105
|
-
|
|
106
|
-
See [docs/providers.md](docs/providers.md) for detailed setup instructions.
|
|
107
|
-
|
|
108
|
-
**Custom providers & models:** Add providers via `~/.pi/agent/models.json` if they speak a supported API (OpenAI, Anthropic, Google). For custom APIs or OAuth, use extensions. See [docs/models.md](docs/models.md) and [docs/custom-provider.md](docs/custom-provider.md).
|
|
109
|
-
|
|
110
|
-
---
|
|
111
|
-
|
|
112
|
-
## Interactive Mode
|
|
113
|
-
|
|
114
|
-
<p align="center"><img src="docs/images/interactive-mode.png" alt="Interactive Mode" width="600"></p>
|
|
115
|
-
|
|
116
|
-
The interface from top to bottom:
|
|
117
|
-
|
|
118
|
-
- **Startup header** - Shows shortcuts (`/hotkeys` for all), loaded AGENTS.md files, prompt templates, skills, and extensions
|
|
119
|
-
- **Messages** - Your messages, assistant responses, tool calls and results, notifications, errors, and extension UI
|
|
120
|
-
- **Editor** - Where you type; border color indicates thinking level
|
|
121
|
-
- **Footer** - Working directory, session name, total token/cache usage, cost, context usage, current model
|
|
122
|
-
|
|
123
|
-
The editor can be temporarily replaced by other UI, like built-in `/settings` or custom UI from extensions (e.g., a Q&A tool that lets the user answer model questions in a structured format). [Extensions](#extensions) can also replace the editor, add widgets above/below it, a status line, custom footer, or overlays.
|
|
124
|
-
|
|
125
|
-
### Editor
|
|
11
|
+
## 快速开始
|
|
126
12
|
|
|
127
|
-
|
|
128
|
-
|---------|-----|
|
|
129
|
-
| File reference | Type `@` to fuzzy-search project files |
|
|
130
|
-
| Path completion | Tab to complete paths |
|
|
131
|
-
| Multi-line | Shift+Enter (or Ctrl+Enter on Windows Terminal) |
|
|
132
|
-
| Images | Ctrl+V to paste (Alt+V on Windows), or drag onto terminal |
|
|
133
|
-
| Bash commands | `!command` runs and sends output to LLM, `!!command` runs without sending |
|
|
13
|
+
### 首次配置
|
|
134
14
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
### Commands
|
|
138
|
-
|
|
139
|
-
Type `/` in the editor to trigger commands. [Extensions](#extensions) can register custom commands, [skills](#skills) are available as `/skill:name`, and [prompt templates](#prompt-templates) expand via `/templatename`.
|
|
140
|
-
|
|
141
|
-
| Command | Description |
|
|
142
|
-
|---------|-------------|
|
|
143
|
-
| `/login`, `/logout` | OAuth authentication |
|
|
144
|
-
| `/model` | Switch models |
|
|
145
|
-
| `/scoped-models` | Enable/disable models for Ctrl+P cycling |
|
|
146
|
-
| `/settings` | Thinking level, theme, message delivery, transport |
|
|
147
|
-
| `/resume` | Pick from previous sessions |
|
|
148
|
-
| `/new` | Start a new session |
|
|
149
|
-
| `/name <name>` | Set session display name |
|
|
150
|
-
| `/session` | Show session info (path, tokens, cost) |
|
|
151
|
-
| `/tree` | Jump to any point in the session and continue from there |
|
|
152
|
-
| `/fork` | Create a new session from the current branch |
|
|
153
|
-
| `/compact [prompt]` | Manually compact context, optional custom instructions |
|
|
154
|
-
| `/copy` | Copy last assistant message to clipboard |
|
|
155
|
-
| `/export [file]` | Export session to HTML file |
|
|
156
|
-
| `/share` | Upload as private GitHub gist with shareable HTML link |
|
|
157
|
-
| `/reload` | Reload extensions, skills, prompts, context files (themes hot-reload automatically) |
|
|
158
|
-
| `/hotkeys` | Show all keyboard shortcuts |
|
|
159
|
-
| `/changelog` | Display version history |
|
|
160
|
-
| `/quit`, `/exit` | Quit pi |
|
|
161
|
-
|
|
162
|
-
### Keyboard Shortcuts
|
|
163
|
-
|
|
164
|
-
See `/hotkeys` for the full list. Customize via `~/.pi/agent/keybindings.json`. See [docs/keybindings.md](docs/keybindings.md).
|
|
165
|
-
|
|
166
|
-
**Commonly used:**
|
|
167
|
-
|
|
168
|
-
| Key | Action |
|
|
169
|
-
|-----|--------|
|
|
170
|
-
| Ctrl+C | Clear editor |
|
|
171
|
-
| Ctrl+C twice | Quit |
|
|
172
|
-
| Escape | Cancel/abort |
|
|
173
|
-
| Escape twice | Open `/tree` |
|
|
174
|
-
| Ctrl+L | Open model selector |
|
|
175
|
-
| Ctrl+P / Shift+Ctrl+P | Cycle scoped models forward/backward |
|
|
176
|
-
| Shift+Tab | Cycle thinking level |
|
|
177
|
-
| Ctrl+O | Collapse/expand tool output |
|
|
178
|
-
| Ctrl+T | Collapse/expand thinking blocks |
|
|
179
|
-
|
|
180
|
-
### Message Queue
|
|
181
|
-
|
|
182
|
-
Submit messages while the agent is working:
|
|
183
|
-
|
|
184
|
-
- **Enter** queues a *steering* message, delivered after current tool execution (interrupts remaining tools)
|
|
185
|
-
- **Alt+Enter** queues a *follow-up* message, delivered only after the agent finishes all work
|
|
186
|
-
- **Escape** aborts and restores queued messages to editor
|
|
187
|
-
- **Alt+Up** retrieves queued messages back to editor
|
|
188
|
-
|
|
189
|
-
Configure delivery in [settings](docs/settings.md): `steeringMode` and `followUpMode` can be `"one-at-a-time"` (default, waits for response) or `"all"` (delivers all queued at once). `transport` selects provider transport preference (`"sse"`, `"websocket"`, or `"auto"`) for providers that support multiple transports.
|
|
190
|
-
|
|
191
|
-
---
|
|
192
|
-
|
|
193
|
-
## Sessions
|
|
194
|
-
|
|
195
|
-
Sessions are stored as JSONL files with a tree structure. Each entry has an `id` and `parentId`, enabling in-place branching without creating new files. See [docs/session.md](docs/session.md) for file format.
|
|
196
|
-
|
|
197
|
-
### Management
|
|
198
|
-
|
|
199
|
-
Sessions auto-save to `~/.pi/agent/sessions/` organized by working directory.
|
|
15
|
+
运行 OpenVibe 后,系统将引导你完成初始配置:
|
|
200
16
|
|
|
201
17
|
```bash
|
|
202
|
-
|
|
203
|
-
pi -r # Browse and select from past sessions
|
|
204
|
-
pi --no-session # Ephemeral mode (don't save)
|
|
205
|
-
pi --session <path> # Use specific session file or ID
|
|
206
|
-
```
|
|
207
|
-
|
|
208
|
-
### Branching
|
|
209
|
-
|
|
210
|
-
**`/tree`** - Navigate the session tree in-place. Select any previous point, continue from there, and switch between branches. All history preserved in a single file.
|
|
211
|
-
|
|
212
|
-
<p align="center"><img src="docs/images/tree-view.png" alt="Tree View" width="600"></p>
|
|
213
|
-
|
|
214
|
-
- Search by typing, fold/unfold and jump between branches with Ctrl+←/Ctrl+→ or Alt+←/Alt+→, page with ←/→
|
|
215
|
-
- Filter modes (Ctrl+O): default → no-tools → user-only → labeled-only → all
|
|
216
|
-
- Press `l` to label entries as bookmarks
|
|
217
|
-
|
|
218
|
-
**`/fork`** - Create a new session file from the current branch. Opens a selector, copies history up to the selected point, and places that message in the editor for modification.
|
|
219
|
-
|
|
220
|
-
### Compaction
|
|
221
|
-
|
|
222
|
-
Long sessions can exhaust context windows. Compaction summarizes older messages while keeping recent ones.
|
|
223
|
-
|
|
224
|
-
**Manual:** `/compact` or `/compact <custom instructions>`
|
|
225
|
-
|
|
226
|
-
**Automatic:** Enabled by default. Triggers on context overflow (recovers and retries) or when approaching the limit (proactive). Configure via `/settings` or `settings.json`.
|
|
227
|
-
|
|
228
|
-
Compaction is lossy. The full history remains in the JSONL file; use `/tree` to revisit. Customize compaction behavior via [extensions](#extensions). See [docs/compaction.md](docs/compaction.md) for internals.
|
|
229
|
-
|
|
230
|
-
---
|
|
231
|
-
|
|
232
|
-
## Settings
|
|
233
|
-
|
|
234
|
-
Use `/settings` to modify common options, or edit JSON files directly:
|
|
235
|
-
|
|
236
|
-
| Location | Scope |
|
|
237
|
-
|----------|-------|
|
|
238
|
-
| `~/.pi/agent/settings.json` | Global (all projects) |
|
|
239
|
-
| `.pi/settings.json` | Project (overrides global) |
|
|
240
|
-
|
|
241
|
-
See [docs/settings.md](docs/settings.md) for all options.
|
|
242
|
-
|
|
243
|
-
---
|
|
244
|
-
|
|
245
|
-
## Context Files
|
|
246
|
-
|
|
247
|
-
Pi loads `AGENTS.md` (or `CLAUDE.md`) at startup from:
|
|
248
|
-
- `~/.pi/agent/AGENTS.md` (global)
|
|
249
|
-
- Parent directories (walking up from cwd)
|
|
250
|
-
- Current directory
|
|
251
|
-
|
|
252
|
-
Use for project instructions, conventions, common commands. All matching files are concatenated.
|
|
253
|
-
|
|
254
|
-
### System Prompt
|
|
255
|
-
|
|
256
|
-
Replace the default system prompt with `.pi/SYSTEM.md` (project) or `~/.pi/agent/SYSTEM.md` (global). Append without replacing via `APPEND_SYSTEM.md`.
|
|
257
|
-
|
|
258
|
-
---
|
|
259
|
-
|
|
260
|
-
## Customization
|
|
261
|
-
|
|
262
|
-
### Prompt Templates
|
|
263
|
-
|
|
264
|
-
Reusable prompts as Markdown files. Type `/name` to expand.
|
|
265
|
-
|
|
266
|
-
```markdown
|
|
267
|
-
<!-- ~/.pi/agent/prompts/review.md -->
|
|
268
|
-
Review this code for bugs, security issues, and performance problems.
|
|
269
|
-
Focus on: {{focus}}
|
|
270
|
-
```
|
|
271
|
-
|
|
272
|
-
Place in `~/.pi/agent/prompts/`, `.pi/prompts/`, or a [pi package](#pi-packages) to share with others. See [docs/prompt-templates.md](docs/prompt-templates.md).
|
|
273
|
-
|
|
274
|
-
### Skills
|
|
275
|
-
|
|
276
|
-
On-demand capability packages following the [Agent Skills standard](https://agentskills.io). Invoke via `/skill:name` or let the agent load them automatically.
|
|
277
|
-
|
|
278
|
-
```markdown
|
|
279
|
-
<!-- ~/.pi/agent/skills/my-skill/SKILL.md -->
|
|
280
|
-
# My Skill
|
|
281
|
-
Use this skill when the user asks about X.
|
|
282
|
-
|
|
283
|
-
## Steps
|
|
284
|
-
1. Do this
|
|
285
|
-
2. Then that
|
|
18
|
+
openvibe
|
|
286
19
|
```
|
|
287
20
|
|
|
288
|
-
|
|
21
|
+
你需要提供:
|
|
22
|
+
- **API 地址**: 你的 AI 服务接口地址
|
|
23
|
+
- **API 密钥**: 访问 AI 服务的密钥
|
|
24
|
+
- **模型名称**: 使用的 AI 模型名称
|
|
289
25
|
|
|
290
|
-
###
|
|
26
|
+
### 基本用法
|
|
291
27
|
|
|
292
|
-
|
|
28
|
+
```bash
|
|
29
|
+
# 启动交互式会话
|
|
30
|
+
openvibe
|
|
293
31
|
|
|
294
|
-
|
|
32
|
+
# 直接执行指令
|
|
33
|
+
openvibe "分析当前项目的代码结构"
|
|
295
34
|
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
pi.registerTool({ name: "deploy", ... });
|
|
299
|
-
pi.registerCommand("stats", { ... });
|
|
300
|
-
pi.on("tool_call", async (event, ctx) => { ... });
|
|
301
|
-
}
|
|
35
|
+
# 处理文件
|
|
36
|
+
openvibe -f src/main.ts "优化这段代码"
|
|
302
37
|
```
|
|
303
38
|
|
|
304
|
-
|
|
305
|
-
- Custom tools (or replace built-in tools entirely)
|
|
306
|
-
- Sub-agents and plan mode
|
|
307
|
-
- Custom compaction and summarization
|
|
308
|
-
- Permission gates and path protection
|
|
309
|
-
- Custom editors and UI components
|
|
310
|
-
- Status lines, headers, footers
|
|
311
|
-
- Git checkpointing and auto-commit
|
|
312
|
-
- SSH and sandbox execution
|
|
313
|
-
- MCP server integration
|
|
314
|
-
- Make pi look like Claude Code
|
|
315
|
-
- Games while waiting (yes, Doom runs)
|
|
316
|
-
- ...anything you can dream up
|
|
317
|
-
|
|
318
|
-
Place in `~/.pi/agent/extensions/`, `.pi/extensions/`, or a [pi package](#pi-packages) to share with others. See [docs/extensions.md](docs/extensions.md) and [examples/extensions/](examples/extensions/).
|
|
319
|
-
|
|
320
|
-
### Themes
|
|
321
|
-
|
|
322
|
-
Built-in: `dark`, `light`. Themes hot-reload: modify the active theme file and pi immediately applies changes.
|
|
323
|
-
|
|
324
|
-
Place in `~/.pi/agent/themes/`, `.pi/themes/`, or a [pi package](#pi-packages) to share with others. See [docs/themes.md](docs/themes.md).
|
|
325
|
-
|
|
326
|
-
### Pi Packages
|
|
39
|
+
## 核心功能
|
|
327
40
|
|
|
328
|
-
|
|
41
|
+
- **智能代码编辑**: 基于 AI 的代码分析、重构和生成
|
|
42
|
+
- **文件操作工具**: read、write、edit、bash、grep、find 等
|
|
43
|
+
- **会话管理**: 保存和恢复对话历史
|
|
44
|
+
- **扩展系统**: 自定义功能扩展
|
|
45
|
+
- **交互式终端界面**: 直观的 TUI 操作体验
|
|
329
46
|
|
|
330
|
-
|
|
47
|
+
## 配置说明
|
|
331
48
|
|
|
332
|
-
|
|
333
|
-
pi install npm:@foo/pi-tools
|
|
334
|
-
pi install npm:@foo/pi-tools@1.2.3 # pinned version
|
|
335
|
-
pi install git:github.com/user/repo
|
|
336
|
-
pi install git:github.com/user/repo@v1 # tag or commit
|
|
337
|
-
pi install git:git@github.com:user/repo
|
|
338
|
-
pi install git:git@github.com:user/repo@v1 # tag or commit
|
|
339
|
-
pi install https://github.com/user/repo
|
|
340
|
-
pi install https://github.com/user/repo@v1 # tag or commit
|
|
341
|
-
pi install ssh://git@github.com/user/repo
|
|
342
|
-
pi install ssh://git@github.com/user/repo@v1 # tag or commit
|
|
343
|
-
pi remove npm:@foo/pi-tools
|
|
344
|
-
pi list
|
|
345
|
-
pi update # skips pinned packages
|
|
346
|
-
pi config # enable/disable extensions, skills, prompts, themes
|
|
347
|
-
```
|
|
348
|
-
|
|
349
|
-
Packages install to `~/.pi/agent/git/` (git) or global npm. Use `-l` for project-local installs (`.pi/git/`, `.pi/npm/`).
|
|
350
|
-
|
|
351
|
-
Create a package by adding a `pi` key to `package.json`:
|
|
49
|
+
配置文件位于 `~/.openvibe/config.json`:
|
|
352
50
|
|
|
353
51
|
```json
|
|
354
52
|
{
|
|
355
|
-
"
|
|
356
|
-
"
|
|
357
|
-
"
|
|
358
|
-
"extensions": ["./extensions"],
|
|
359
|
-
"skills": ["./skills"],
|
|
360
|
-
"prompts": ["./prompts"],
|
|
361
|
-
"themes": ["./themes"]
|
|
362
|
-
}
|
|
53
|
+
"apiUrl": "https://api.example.com/v1/chat/completions",
|
|
54
|
+
"apiKey": "your-api-key",
|
|
55
|
+
"model": "your-model-name"
|
|
363
56
|
}
|
|
364
57
|
```
|
|
365
58
|
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
See [docs/packages.md](docs/packages.md).
|
|
369
|
-
|
|
370
|
-
---
|
|
371
|
-
|
|
372
|
-
## Programmatic Usage
|
|
59
|
+
## 命令行选项
|
|
373
60
|
|
|
374
|
-
### SDK
|
|
375
|
-
|
|
376
|
-
```typescript
|
|
377
|
-
import { AuthStorage, createAgentSession, ModelRegistry, SessionManager } from "@mariozechner/pi-coding-agent";
|
|
378
|
-
|
|
379
|
-
const { session } = await createAgentSession({
|
|
380
|
-
sessionManager: SessionManager.inMemory(),
|
|
381
|
-
authStorage: AuthStorage.create(),
|
|
382
|
-
modelRegistry: new ModelRegistry(authStorage),
|
|
383
|
-
});
|
|
384
|
-
|
|
385
|
-
await session.prompt("What files are in the current directory?");
|
|
386
61
|
```
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
pi --mode rpc
|
|
62
|
+
Usage: openvibe [options] [prompt]
|
|
63
|
+
|
|
64
|
+
Options:
|
|
65
|
+
-f, --file <path> 包含文件路径
|
|
66
|
+
-c, --context <path> 添加上下文文件/目录
|
|
67
|
+
--no-onboarding 跳过引导配置
|
|
68
|
+
-h, --help 显示帮助信息
|
|
69
|
+
-v, --version 显示版本号
|
|
396
70
|
```
|
|
397
71
|
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
See [docs/rpc.md](docs/rpc.md) for the protocol.
|
|
401
|
-
|
|
402
|
-
---
|
|
403
|
-
|
|
404
|
-
## Philosophy
|
|
405
|
-
|
|
406
|
-
Pi is aggressively extensible so it doesn't have to dictate your workflow. Features that other tools bake in can be built with [extensions](#extensions), [skills](#skills), or installed from third-party [pi packages](#pi-packages). This keeps the core minimal while letting you shape pi to fit how you work.
|
|
407
|
-
|
|
408
|
-
**No MCP.** Build CLI tools with READMEs (see [Skills](#skills)), or build an extension that adds MCP support. [Why?](https://mariozechner.at/posts/2025-11-02-what-if-you-dont-need-mcp/)
|
|
409
|
-
|
|
410
|
-
**No sub-agents.** There's many ways to do this. Spawn pi instances via tmux, or build your own with [extensions](#extensions), or install a package that does it your way.
|
|
72
|
+
## 工具功能
|
|
411
73
|
|
|
412
|
-
|
|
74
|
+
OpenVibe 内置以下工具:
|
|
413
75
|
|
|
414
|
-
|
|
76
|
+
| 工具 | 描述 |
|
|
77
|
+
|------|------|
|
|
78
|
+
| `read` | 读取文件内容 |
|
|
79
|
+
| `write` | 写入文件内容 |
|
|
80
|
+
| `edit` | 编辑文件(精确替换) |
|
|
81
|
+
| `bash` | 执行 shell 命令 |
|
|
82
|
+
| `grep` | 搜索文件内容 |
|
|
83
|
+
| `find` | 查找文件 |
|
|
84
|
+
| `ls` | 列出目录内容 |
|
|
415
85
|
|
|
416
|
-
|
|
86
|
+
## 交互式快捷键
|
|
417
87
|
|
|
418
|
-
|
|
88
|
+
在交互模式下:
|
|
419
89
|
|
|
420
|
-
|
|
90
|
+
| 快捷键 | 功能 |
|
|
91
|
+
|--------|------|
|
|
92
|
+
| `Ctrl+C` | 退出程序 |
|
|
93
|
+
| `Ctrl+D` | 结束输入 |
|
|
94
|
+
| `Ctrl+L` | 清屏 |
|
|
95
|
+
| `Tab` | 自动补全 |
|
|
421
96
|
|
|
422
|
-
|
|
97
|
+
## 扩展开发
|
|
423
98
|
|
|
424
|
-
|
|
99
|
+
OpenVibe 支持 TypeScript 扩展,示例:
|
|
425
100
|
|
|
426
|
-
```
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
pi config # Enable/disable package resources
|
|
101
|
+
```typescript
|
|
102
|
+
import { defineExtension } from 'openvibe';
|
|
103
|
+
|
|
104
|
+
export default defineExtension({
|
|
105
|
+
name: 'my-extension',
|
|
106
|
+
setup({ onMessage }) {
|
|
107
|
+
onMessage((message) => {
|
|
108
|
+
console.log('收到消息:', message);
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
});
|
|
438
112
|
```
|
|
439
113
|
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
| Flag | Description |
|
|
443
|
-
|------|-------------|
|
|
444
|
-
| (default) | Interactive mode |
|
|
445
|
-
| `-p`, `--print` | Print response and exit |
|
|
446
|
-
| `--mode json` | Output all events as JSON lines (see [docs/json.md](docs/json.md)) |
|
|
447
|
-
| `--mode rpc` | RPC mode for process integration (see [docs/rpc.md](docs/rpc.md)) |
|
|
448
|
-
| `--export <in> [out]` | Export session to HTML |
|
|
449
|
-
|
|
450
|
-
### Model Options
|
|
451
|
-
|
|
452
|
-
| Option | Description |
|
|
453
|
-
|--------|-------------|
|
|
454
|
-
| `--provider <name>` | Provider (anthropic, openai, google, etc.) |
|
|
455
|
-
| `--model <pattern>` | Model pattern or ID (supports `provider/id` and optional `:<thinking>`) |
|
|
456
|
-
| `--api-key <key>` | API key (overrides env vars) |
|
|
457
|
-
| `--thinking <level>` | `off`, `minimal`, `low`, `medium`, `high`, `xhigh` |
|
|
458
|
-
| `--models <patterns>` | Comma-separated patterns for Ctrl+P cycling |
|
|
459
|
-
| `--list-models [search]` | List available models |
|
|
460
|
-
|
|
461
|
-
### Session Options
|
|
462
|
-
|
|
463
|
-
| Option | Description |
|
|
464
|
-
|--------|-------------|
|
|
465
|
-
| `-c`, `--continue` | Continue most recent session |
|
|
466
|
-
| `-r`, `--resume` | Browse and select session |
|
|
467
|
-
| `--session <path>` | Use specific session file or partial UUID |
|
|
468
|
-
| `--session-dir <dir>` | Custom session storage directory |
|
|
469
|
-
| `--no-session` | Ephemeral mode (don't save) |
|
|
470
|
-
|
|
471
|
-
### Tool Options
|
|
472
|
-
|
|
473
|
-
| Option | Description |
|
|
474
|
-
|--------|-------------|
|
|
475
|
-
| `--tools <list>` | Enable specific built-in tools (default: `read,bash,edit,write`) |
|
|
476
|
-
| `--no-tools` | Disable all built-in tools (extension tools still work) |
|
|
477
|
-
|
|
478
|
-
Available built-in tools: `read`, `bash`, `edit`, `write`, `grep`, `find`, `ls`
|
|
114
|
+
## 历史记录
|
|
479
115
|
|
|
480
|
-
|
|
116
|
+
OpenVibe 自动保存所有会话历史,方便你随时回顾和继续之前的对话。
|
|
481
117
|
|
|
482
|
-
|
|
483
|
-
|--------|-------------|
|
|
484
|
-
| `-e`, `--extension <source>` | Load extension from path, npm, or git (repeatable) |
|
|
485
|
-
| `--no-extensions` | Disable extension discovery |
|
|
486
|
-
| `--skill <path>` | Load skill (repeatable) |
|
|
487
|
-
| `--no-skills` | Disable skill discovery |
|
|
488
|
-
| `--prompt-template <path>` | Load prompt template (repeatable) |
|
|
489
|
-
| `--no-prompt-templates` | Disable prompt template discovery |
|
|
490
|
-
| `--theme <path>` | Load theme (repeatable) |
|
|
491
|
-
| `--no-themes` | Disable theme discovery |
|
|
492
|
-
|
|
493
|
-
Combine `--no-*` with explicit flags to load exactly what you need, ignoring settings.json (e.g., `--no-extensions -e ./my-ext.ts`).
|
|
494
|
-
|
|
495
|
-
### Other Options
|
|
496
|
-
|
|
497
|
-
| Option | Description |
|
|
498
|
-
|--------|-------------|
|
|
499
|
-
| `--system-prompt <text>` | Replace default prompt (context files and skills still appended) |
|
|
500
|
-
| `--append-system-prompt <text>` | Append to system prompt |
|
|
501
|
-
| `--verbose` | Force verbose startup |
|
|
502
|
-
| `-h`, `--help` | Show help |
|
|
503
|
-
| `-v`, `--version` | Show version |
|
|
504
|
-
|
|
505
|
-
### File Arguments
|
|
506
|
-
|
|
507
|
-
Prefix files with `@` to include in the message:
|
|
118
|
+
### 查看历史
|
|
508
119
|
|
|
509
120
|
```bash
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
pi @code.ts @test.ts "Review these files"
|
|
513
|
-
```
|
|
121
|
+
# 列出所有历史会话
|
|
122
|
+
openvibe --history
|
|
514
123
|
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
```
|
|
518
|
-
# Interactive with initial prompt
|
|
519
|
-
pi "List all .ts files in src/"
|
|
520
|
-
|
|
521
|
-
# Non-interactive
|
|
522
|
-
pi -p "Summarize this codebase"
|
|
523
|
-
|
|
524
|
-
# Different model
|
|
525
|
-
pi --provider openai --model gpt-4o "Help me refactor"
|
|
526
|
-
|
|
527
|
-
# Model with provider prefix (no --provider needed)
|
|
528
|
-
pi --model openai/gpt-4o "Help me refactor"
|
|
529
|
-
|
|
530
|
-
# Model with thinking level shorthand
|
|
531
|
-
pi --model sonnet:high "Solve this complex problem"
|
|
532
|
-
|
|
533
|
-
# Limit model cycling
|
|
534
|
-
pi --models "claude-*,gpt-4o"
|
|
124
|
+
# 查看特定会话
|
|
125
|
+
openvibe --session <session-id>
|
|
126
|
+
```
|
|
535
127
|
|
|
536
|
-
|
|
537
|
-
pi --tools read,grep,find,ls -p "Review the code"
|
|
128
|
+
### 历史文件位置
|
|
538
129
|
|
|
539
|
-
|
|
540
|
-
pi --thinking high "Solve this complex problem"
|
|
541
|
-
```
|
|
130
|
+
历史记录保存在 `~/.openvibe/sessions/` 目录下,每个会话以 JSONL 格式存储。
|
|
542
131
|
|
|
543
|
-
###
|
|
132
|
+
### 快捷键
|
|
544
133
|
|
|
545
|
-
|
|
546
|
-
|----------|-------------|
|
|
547
|
-
| `PI_CODING_AGENT_DIR` | Override config directory (default: `~/.pi/agent`) |
|
|
548
|
-
| `PI_PACKAGE_DIR` | Override package directory (useful for Nix/Guix where store paths tokenize poorly) |
|
|
549
|
-
| `PI_SKIP_VERSION_CHECK` | Skip version check at startup |
|
|
550
|
-
| `PI_CACHE_RETENTION` | Set to `long` for extended prompt cache (Anthropic: 1h, OpenAI: 24h) |
|
|
551
|
-
| `VISUAL`, `EDITOR` | External editor for Ctrl+G |
|
|
134
|
+
在交互模式下管理历史:
|
|
552
135
|
|
|
553
|
-
|
|
136
|
+
| 快捷键 | 功能 |
|
|
137
|
+
|--------|------|
|
|
138
|
+
| `Ctrl+R` | 打开历史会话选择器 |
|
|
139
|
+
| `Ctrl+S` | 保存当前会话 |
|
|
140
|
+
| `Ctrl+Shift+S` | 重命名当前会话 |
|
|
554
141
|
|
|
555
|
-
|
|
142
|
+
- [扩展开发指南](docs/extensions.md)
|
|
143
|
+
- [SDK 文档](docs/sdk.md)
|
|
144
|
+
- [主题定制](docs/themes.md)
|
|
145
|
+
- [快捷键配置](docs/keybindings.md)
|
|
556
146
|
|
|
557
|
-
|
|
147
|
+
## 系统要求
|
|
558
148
|
|
|
559
|
-
|
|
149
|
+
- Node.js >= 18.0.0
|
|
150
|
+
- npm >= 9.0.0
|
|
560
151
|
|
|
561
|
-
##
|
|
152
|
+
## 许可证
|
|
562
153
|
|
|
563
154
|
MIT
|
|
564
155
|
|
|
565
|
-
##
|
|
156
|
+
## 相关链接
|
|
566
157
|
|
|
567
|
-
- [
|
|
568
|
-
- [
|
|
569
|
-
- [@mariozechner/pi-tui](https://www.npmjs.com/package/@mariozechner/pi-tui): Terminal UI components
|
|
158
|
+
- [npm 包](https://www.npmjs.com/package/openvibe)
|
|
159
|
+
- [问题反馈](https://github.com/openvibe/openvibe/issues)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "openvibe",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.58.1",
|
|
4
4
|
"description": "OpenVibe - AI Coding Assistant CLI",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"piConfig": {
|
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
"dist",
|
|
27
27
|
"docs",
|
|
28
28
|
"examples",
|
|
29
|
+
"README.md",
|
|
29
30
|
"CHANGELOG.md"
|
|
30
31
|
],
|
|
31
32
|
"scripts": {
|