@cydm/pie 1.0.0 → 1.0.2

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.
Files changed (2) hide show
  1. package/README.md +115 -89
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,153 +1,179 @@
1
1
  # @cydm/pie
2
2
 
3
- Pie AI Agent CLI - 命令行交互界面
3
+ `@cydm/pie` is a minimal, powerful, embeddable agent suite for game developers.
4
4
 
5
- ## 安装
5
+ It gives you a terminal-first agent experience out of the box, while staying modular enough to embed into other runtimes and products. Pie is designed for teams that want a small surface area, strong defaults, persistent sessions, tool use, and a clean path from CLI usage to deeper integration.
6
+
7
+ Pie is heavily inspired by `pi`, while evolving in its own direction around modularity, embeddability, and a compact developer-facing workflow.
8
+
9
+ Pie is developed by [cydream](https://cydream.tech).
10
+
11
+ ## Why Pie
12
+
13
+ - Minimal interface, low ceremony
14
+ - Powerful coding-agent workflow in the terminal
15
+ - Embeddable architecture built on reusable `@pie/*` packages
16
+ - Persistent sessions, slash commands, and skill loading
17
+ - Works well as both a daily CLI and a building block for custom agent products
18
+
19
+ ## Install
6
20
 
7
21
  ```bash
8
22
  npm install -g @cydm/pie
9
23
  ```
10
24
 
11
- ## 使用
12
-
13
- ### 环境变量
25
+ ## Quick Start
14
26
 
15
- 设置 API Key:
27
+ Set an API key for the provider you want to use:
16
28
 
17
29
  ```bash
18
30
  export KIMI_API_KEY="your-kimi-api-key"
19
- #
31
+ # or
20
32
  export BIGMODEL_API_KEY="your-bigmodel-api-key"
21
33
  ```
22
34
 
23
- 或创建配置文件 `~/.pie/config.json`:
35
+ You can also configure defaults in:
24
36
 
25
- ```json
26
- {
27
- "provider": "kimi-cn",
28
- "modelId": "kimi-k2.5"
29
- }
30
- ```
37
+ - `~/.pie/settings.json`
38
+ - `~/.pie/models.json`
39
+ - `~/.pie/config.json` for legacy-compatible defaults
31
40
 
32
- 也可以在 `~/.pie/models.json` `providers.<provider>.apiKey` 中为特定 provider 配置 API Key。
41
+ Start Pie in interactive mode:
33
42
 
34
- ### 命令
43
+ ```bash
44
+ pie
45
+ ```
35
46
 
36
- #### Print 模式(默认)
47
+ Or pass an initial prompt:
48
+
49
+ ```bash
50
+ pie chat "Summarize this repository"
51
+ ```
37
52
 
38
- 直接输入 prompt,获取结果后退出:
53
+ Use Pie in one-shot mode:
39
54
 
40
55
  ```bash
41
- pie "请列出当前目录的文件"
42
- pie chat "帮我写一个快速排序的 Python 代码"
56
+ pie "List the files in the current directory"
57
+ pie chat "Write a quick Python script for merge sort"
43
58
  ```
44
59
 
45
- #### Interactive 模式
60
+ ## Core Ideas
46
61
 
47
- 启动交互式 TUI 界面:
62
+ Pie is not just a chat CLI. It is a compact agent suite with a terminal UI on top of a reusable runtime.
63
+
64
+ - The CLI is intentionally small and fast to learn
65
+ - The agent can work with files, shell commands, sessions, and skills
66
+ - The architecture is modular, so the same foundation can be embedded into other apps and environments
67
+
68
+ If you want an agent that feels lightweight but still has serious capability, that is the design target for Pie.
69
+
70
+ ## Interactive Experience
71
+
72
+ Run:
48
73
 
49
74
  ```bash
50
75
  pie
51
- #
76
+ # or
52
77
  pie chat
53
78
  ```
54
79
 
55
- 快捷键:
56
- - `Enter` - 提交消息
57
- - `Shift+Enter` / `Ctrl+Enter` - 换行(需 CSI u 支持的终端)
58
- - `\` + `Enter` - 换行(兼容所有终端)
59
- - `Ctrl+C` - 退出
80
+ Main key bindings:
60
81
 
61
- #### 帮助
82
+ - `Enter` submit message
83
+ - `Shift+Enter` insert a new line
84
+ - `\` + `Enter` insert a new line in terminals without modified-enter support
85
+ - `Ctrl+C` exit
86
+ - `Ctrl+D` exit
87
+ - `Ctrl+O` expand or collapse tool output
88
+ - `/` open the slash command menu
62
89
 
63
- ```bash
64
- pie help
65
- pie --help
90
+ Direct shell mode:
91
+
92
+ ```text
93
+ !!git status
94
+ !!npm test
66
95
  ```
67
96
 
68
- ## 功能特性
97
+ Commands prefixed with `!!` run directly in the shell without going through the agent.
69
98
 
70
- - **Print 模式**:快速单次查询,适合脚本调用
71
- - **Interactive TUI**:完整的终端交互界面
72
- - 实时流式响应显示
73
- - 多行编辑器(Shift+Enter 换行)
74
- - 工具执行状态透明展示
75
- - Thinking 过程显示
76
- - 主题系统(dark/light)
77
- - **工具支持**:read、write、edit、ls、grep、find、bash
78
- - **Session 管理**:自动保存对话历史
99
+ ## Slash Commands
79
100
 
80
- ### Session 管理
101
+ Pie uses a hierarchical slash-command menu. The current built-in commands include:
81
102
 
82
- Session 文件保存在 `~/.pie/sessions/` 目录。
103
+ | Command | Description |
104
+ | --- | --- |
105
+ | `/sessions/compact` | Summarize history and create a compact checkpoint |
106
+ | `/sessions/new` | Start a new session |
107
+ | `/sessions/resume` | Resume a different session |
108
+ | `/sessions/tree` | Navigate the session tree |
109
+ | `/sessions/info` | Show session information |
110
+ | `/sessions/fork` | Fork from an earlier message |
111
+ | `/settings` | Open the settings menu |
112
+ | `/settings/model` | Choose a model |
113
+ | `/settings/theme` | Change the theme |
114
+ | `/settings/thinking` | Set reasoning depth |
115
+ | `/settings/yolo` | Toggle less restricted filesystem mode |
116
+ | `/settings/hotkeys` | Show keyboard shortcuts |
117
+ | `/settings/quit` | Exit Pie |
118
+ | `/skills/list` | List available skills |
119
+ | `/skills/use` | Use a skill |
120
+ | `/skills/reload` | Reload skills from disk |
121
+ | `/tools/subagent` | Spawn a subagent for a task |
122
+ | `/debugs/cache-test` | Test context caching |
123
+ | `/debugs/context` | Dump raw context for debugging |
124
+ | `/debugs/package` | Dump raw request and response payloads |
83
125
 
84
- #### Slash 命令
126
+ Pie can also load extension-provided commands at runtime.
85
127
 
86
- Interactive 模式下输入 `/` 显示命令菜单:
128
+ ## Sessions
87
129
 
88
- | 命令 | 说明 |
89
- |------|------|
90
- | `/new` | 创建新 Session(保存当前并开启新的对话) |
91
- | `/resume` | 恢复之前的 Session(显示交互式选择器) |
92
- | `/session` | 显示当前 Session 信息 |
93
- | `/fork` | 从当前 Session 分叉创建新 Session |
94
- | `/tree` | 显示 Session 树状结构 |
95
- | `/settings` | 设置菜单(主题、思考级别) |
96
- | `/hotkeys` | 显示键盘快捷键 |
97
- | `/quit` | 退出 |
130
+ Pie keeps persistent sessions so you can come back to earlier work.
98
131
 
99
- #### 使用示例
132
+ - Sessions are stored in `~/.pie/sessions/`
133
+ - You can switch sessions from the command menu
134
+ - You can fork a session to branch off a previous line of work
135
+ - You can compact long sessions to keep context focused
100
136
 
101
- ```bash
102
- # 启动交互模式
103
- pie chat
137
+ This makes Pie useful for ongoing coding tasks, not just one-off prompts.
104
138
 
105
- # 聊几句...
106
- > 你好,我叫 Bob
107
- > 我喜欢用 TypeScript
139
+ ## Skills And Extensibility
108
140
 
109
- # 创建新 Session(之前的对话会被保存)
110
- /new
141
+ Pie supports Markdown-based skills and built-in extensions.
111
142
 
112
- # 在新 Session 中聊天
113
- > 你好
143
+ - Built-in skills ship with the CLI
144
+ - User skills can live under `~/.pie/skills`
145
+ - Project-local skills can live under `.pie/skills`
146
+ - Extensions can register additional commands and workflows
114
147
 
115
- # 恢复之前的 Session
116
- /resume
117
- # 使用 ↑↓ 选择,Enter 确认
148
+ That is part of what makes Pie embeddable: the CLI is only one interface on top of a broader agent toolkit.
118
149
 
119
- # AI 会记得之前的对话内容
120
- > 我叫什么名字?
121
- # AI: 你叫 Bob,之前告诉过我你喜欢 TypeScript
122
- ```
150
+ ## Output Modes
123
151
 
124
- #### 快捷键
152
+ For non-interactive usage, Pie supports structured output options:
153
+
154
+ ```bash
155
+ pie "summarize this file" --raw-output
156
+ pie "summarize this file" --json-output
157
+ pie "continue previous task" --session-id my-session
158
+ ```
125
159
 
126
- | 快捷键 | 说明 |
127
- |--------|------|
128
- | `Enter` | 发送消息 |
129
- | `Shift+Enter` | 换行(需 CSI u 支持) |
130
- | `Ctrl+C` (按一次) | 清空编辑器 |
131
- | `Ctrl+C` (快速按两次) | 退出 |
132
- | `ESC` | 取消 / 返回上一级 |
133
- | `/` | 显示命令菜单 |
160
+ ## Terminal Notes
134
161
 
135
- ## 终端要求
162
+ For the best multiline editing experience, use a terminal with good modified-key support, such as:
136
163
 
137
- 对于完整的按键支持(Shift/Ctrl+Enter),推荐使用:
138
164
  - [Kitty](https://sw.kovidgoyal.net/kitty/)
139
- - [iTerm2](https://iterm2.com/)(启用 "Report modifier keys using CSI u")
165
+ - [iTerm2](https://iterm2.com/)
140
166
  - [Ghostty](https://ghostty.org/)
141
167
 
142
- ## 开发
168
+ ## Development
143
169
 
144
170
  ```bash
145
171
  cd products/cli
146
172
  npm install
147
173
  npm run build
148
- npm test
174
+ npm run test:offline
149
175
  ```
150
176
 
151
- ## 许可证
177
+ ## License
152
178
 
153
179
  MIT
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cydm/pie",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "Pie AI Agent CLI",
5
5
  "type": "module",
6
6
  "bin": {