@llamaventures/cli 1.26.0 → 2.0.0

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.zh-CN.md CHANGED
@@ -1,253 +1,160 @@
1
- <p align="center">
2
- <img src="assets/llama-ventures-logo.svg" alt="Llama Ventures" width="280">
3
- </p>
4
-
5
- <h1 align="center">@llamaventures/cli</h1>
6
-
7
- <p align="center">
8
- <strong>Llama Ventures 的 CLI 与 MCP server。</strong><br/>
9
- 一个包、两个可执行文件:<code>llama</code>——给人和脚本用的 CLI;
10
- <code>llama-mcp</code>——带 55 个类型化工具的 stdio MCP server,任何
11
- MCP 原生 agent 都能接。两者共享同一认证链、同一 HTTP 客户端、同一错误格式,
12
- 连接 <a href="https://command.llamaventures.vc">command.llamaventures.vc</a>。
13
- </p>
14
-
15
- <p align="center">
16
- <a href="https://www.npmjs.com/package/@llamaventures/cli"><img alt="npm" src="https://img.shields.io/npm/v/@llamaventures/cli?label=npm&color=cb3837&logo=npm&logoColor=white"></a>
17
- <a href="https://github.com/Llama-Ventures/llama-cli/actions/workflows/ci.yml"><img alt="CI" src="https://github.com/Llama-Ventures/llama-cli/actions/workflows/ci.yml/badge.svg"></a>
18
- <a href="LICENSE"><img alt="License: MIT" src="https://img.shields.io/badge/license-MIT-blue.svg"></a>
19
- </p>
20
-
21
- <p align="center">
22
- <a href="README.md">English</a> · <strong>简体中文</strong>
23
- </p>
24
-
25
- <p align="center">
26
- <a href="#给华人创业者向-llama-pitch">🚀 向 Llama pitch(无需账号)</a> ·
27
- <a href="#安装">安装</a> ·
28
- <a href="#认证">认证</a> ·
29
- <a href="#接入你的-ai-系统">接入你的 AI</a> ·
30
- <a href="#cli">CLI</a> ·
31
- <a href="#mcp-server">MCP</a> ·
32
- <a href="CHANGELOG.md">更新日志</a>
33
- </p>
34
-
35
- > **公开源码、低摩擦安装;不是开源产品。** 大多数命令需要 Llama Ventures
36
- > 团队账号(token 由团队管理员在 `/settings/tokens` 签发)。
37
- > **唯一例外是公开的 `pitch` 命令族**——见下一节。
38
-
39
- ## 给华人创业者:向 Llama pitch
40
-
41
- 如果你是创业者、EA、或者帮老板探索的助理,**不需要 token、不需要找人介绍**——
42
- 我们专门为外部 pitch 留了一条公开通道。它跟
43
- [command.llamaventures.vc/external-agent](https://command.llamaventures.vc/external-agent)
44
- 网页版聊的是同一个 intake agent,结构化提取、12 维投资判断都是同一套,
45
- 只是入口换成了你的终端,或者你自己的 AI 助手。
1
+ # Llama Command CLI 2
46
2
 
47
- ```bash
48
- npm i -g @llamaventures/cli # 不需要 Llama 账号
49
- llama pitch start --name "张三" --email "you@yourstartup.com"
50
- llama pitch say "我们做 X,目标 Y,团队背景 Z..."
51
- llama pitch upload ./deck.pdf
52
- llama pitch # 或直接进交互式 REPL
53
- ```
3
+ 这是 Llama Command 给 Agent 使用的最小、可审计工具界面。
54
4
 
55
- **也可以让你自己的 AI agent 帮你 pitch(A2A)**:把本包的 MCP server 挂到
56
- Claude / Cursor / 任何 MCP 客户端上(配置见 [MCP server](#mcp-server)),
57
- 告诉它"帮我 pitch Llama Ventures",它会用 `pitch_*` 工具跟我们的 intake
58
- agent 对话。服务端有速率限制(单 IP / 单邮箱 / 单 session)。
59
- Pitch 完成后档案自动进我们团队的 inbox,我们会主动联系你。
5
+ CLI 2 不再保留分裂的 Deal 命令。Core 负责数据库写入、Google Drive
6
+ 文件夹、Event、provenance 和幂等;Agent 不直接操作 PostgreSQL。
60
7
 
61
- > Llama Ventures 投什么?看 [llamaventures.vc](https://llamaventures.vc)——
62
- > AI、Pre-seed 到 Series A、$3-5M 票,跨美中。**懂得让 AI 帮你干活的
63
- > founder,我们爱看。**
64
-
65
- ## 安装
8
+ ## 安装或升级
66
9
 
67
10
  ```bash
68
- npm i -g @llamaventures/cli # Node 18+;llama-mcp 也会一起装上 PATH
11
+ npm i -g @llamaventures/cli@latest
69
12
  llama --version
70
- llama version --json # 包版本、源码 commit 与固定的 Core API 契约
71
- llama auth status # 会跑一次 /api/me 验证
13
+ llama auth status
72
14
  ```
73
15
 
74
- ## 认证
16
+ 服务端要求 CLI 2。任何 1.x CLI/MCP 请求都会收到
17
+ `426 CLI_VERSION_UNSUPPORTED` 和升级命令,不会自动退回旧 Deal API。
18
+
19
+ 认证按以下顺序发现:
75
20
 
76
- 客户端按下面的顺序找凭证,每次调用都查一遍:
21
+ 1. `llama auth login` 保存的 OAuth 凭证;
22
+ 2. `gcloud auth login` 的本机 Google 身份;
23
+ 3. `LLAMA_TOKEN`;
24
+ 4. `~/.llama/token`。
77
25
 
78
- | # | 来源 | 适合谁 |
79
- |---|------|--------|
80
- | 1 | `llama auth login`(OAuth,存 OS Keychain,自动刷新) | **所有人的推荐方式** |
81
- | 2 | `gcloud auth print-identity-token` | 已配好 gcloud 的机器 |
82
- | 3 | `$LLAMA_TOKEN` 环境变量 | CI、云上 sandbox agent |
83
- | 4 | `~/.llama/token`(mode `0600`) | 长期 PAT |
84
- | 5 | `~/.llama-command/config.json` | v0.1 老路径,自动迁移 |
26
+ ## Deal 只有四个动作
85
27
 
86
28
  ```bash
87
- llama auth login # 浏览器登录;token 自动刷新、重启不丢
88
- llama auth logout # 服务端吊销 + 清空本地
89
- llama token set llc_… # /settings/tokens 签发的 PAT——落盘前先验证
90
- llama auth status # 看当前身份和生效的认证方式
29
+ llama deal search "Acme" --limit 10
30
+ llama deal read <dealId> --detail overview
31
+ llama deal create --json create.json
32
+ llama deal write --json write.json
91
33
  ```
92
34
 
93
- > **没账号?** 找你在 Llama Ventures 的对接人——任何邮箱都可以被签发 token。
94
-
95
- ## 接入你的 AI 系统
96
-
97
- 这个包是 Llama Command 的**官方集成面**。自研 agent、LLM 应用都从这里接——
98
- **不要直接调 HTTP API**:CLI/MCP 层负责认证链、稳定的 `Error[…]` 错误契约、
99
- 以及 schema 变化时的前向兼容([SemVer](#稳定性));裸 API 没有这些承诺。
100
-
101
- 1. **拿凭证**——`llama auth login`;无人值守系统用 PAT(`llama token set`
102
- 或 `$LLAMA_TOKEN`)。
103
- 2. **安装**——`npm i -g @llamaventures/cli`。
104
- 3. **接线**——MCP 原生 agent 指向 `llama-mcp`([各客户端配置](#mcp-server));
105
- 其它形态子进程调用 `llama …`。
106
- 4. **让 agent 自我入职**——会话开始跑一次 `llama agent-onboard`(或 MCP 的
107
- `agent_briefing` prompt),拿到服务端下发的 Agent Runtime Contract,
108
- 与线上永远同步。
109
- 5. **验证**——`llama auth status`,然后 `llama deal search "<随便什么>"`。
110
-
111
- ## CLI
112
-
113
- CLI 是 canonical 接口——认证、错误格式、schema 前向兼容都由它处理。
114
- 写脚本也优先用 CLI。
35
+ `read` 是渐进式读取:
115
36
 
116
37
  ```bash
117
- llama deal search "acme ai" # 找 deal(deal list 用同一套过滤参数)
118
- llama deal show <dealId>
119
- llama deal feed <dealId> # deal 的全部贡献,最新在前
120
- llama activity new-deals --since 24h # 最近新建的 deal
121
- llama activity updated-deals --since 7d # 按 deal 聚合的实质更新
122
- llama deal create "Acme AI" --source alex --deal-owner owner@llamaventures.vc --source-direction Outbound --status Interested
123
- llama deal ingest <dealId> --file packet.json # 多条 facts + 可选 Feed note,一次提交且可安全重试
124
- llama deal fact add <dealId> --category funding --claim "Raised a seed round" --source "deck p3" --source-url https://...
125
- llama workflow show <dealId>
126
- llama workflow initialize <dealId> --reason "迁移旧状态,不改变当前阶段"
127
- llama workflow proceed <dealId> --transition begin_preliminary --reason "开始初步研究"
128
- llama workflow execution-status <dealId> invested --reason "已确认打款"
129
- llama post <dealId> "备注内容"
130
- llama post <dealId> "@name 请回复" --cue # 仅在用户明确授权后使用
131
- llama brief add-text <dealId> --heading "..." --body "..."
132
- llama wiki search "<查询词>"
133
- llama wiki save <slug> --title "..." --content "..."
134
- llama mentions
135
- llama agent-onboard # 服务端下发的 agent 工作契约
38
+ llama deal read <dealId> --detail memory
39
+ llama deal read <dealId> --detail files
40
+ llama deal read <dealId> --detail conversation
41
+ llama deal read <dealId> --detail history
42
+ llama deal read <dealId> --detail all
136
43
  ```
137
44
 
138
- 系统管理员可以只读审计一个 Workflow V2 deal,或审计全部已持久化的 V2 快照:
45
+ Live Deal Page 永远返回;只有任务需要时才展开其他内容。
139
46
 
140
- ```bash
141
- llama admin workflow audit --deal <dealId>
142
- llama admin workflow audit --all
143
- ```
47
+ ### 创建 Deal
144
48
 
145
- 对当前支持的两个 intake 假绿检查,修复必须先 preview,并且一次只处理一个 deal。
146
- Apply 必须携带 preview 返回的精确 revision:
49
+ ```json
50
+ {
51
+ "companyName": "Acme",
52
+ "page": {
53
+ "website": "https://example.com",
54
+ "stage": "Diligence"
55
+ },
56
+ "information": [
57
+ {
58
+ "type": "traction.claim",
59
+ "labels": ["founder_reported", "unverified"],
60
+ "subject": {"company": "Acme"},
61
+ "value": {"arrUsd": 320000}
62
+ }
63
+ ],
64
+ "origin": {
65
+ "kind": "user",
66
+ "originalUserUtterance": "Acme 说 ARR 大约是 32 万美元。"
67
+ }
68
+ }
69
+ ```
147
70
 
148
71
  ```bash
149
- llama admin workflow remediate --deal <dealId> --guard intake.reason_why
150
- llama admin workflow remediate --deal <dealId> --guard intake.reason_why \
151
- --apply --expected-revision <revision> --reason "已确认 canonical 证据缺失"
72
+ llama deal create --json create.json
152
73
  ```
153
74
 
154
- 服务端只能把系统生成的绿灯改回未满足;不能推进 deal、把检查改成已满足、修改
155
- status/owner,也不能覆盖人工 resolution
156
-
157
- Status 语义——`Interested`:接触前先记录关注 · `Outreached`:已联系、
158
- 尚无回应 · `Sourced`:已有真实关系信号。`sourceDirection` 是独立维度:
159
- `Inbound` 流入,`Outbound` 我们主动。
160
-
161
- 处理 deck、会议笔记、邮件或研究材料时,优先使用 `deal ingest`,不要循环调用
162
- `deal fact add`。JSON 对象支持 `source`、最多 50 条 `facts`、可选 `note` 和可选
163
- `idempotencyKey`。服务端会原子提交整个材料包、把常见 category 别名归一到固定分类,
164
- 并跳过来源一致的精确重复。只有真正的单条事实才用 `deal fact add`。
75
+ Core 会补上 `operation: deal.create`,创建或复用 Drive 文件夹,并在一个
76
+ 事务里写入初始 Page、Information 和 Events
165
77
 
166
- Facts 的正文用 `claim`。`source` 是人可读来源标签,`sourceUrl` 是 canonical
167
- 证据 URL;两者都会从 API 回显。`dealOwner` 请用 `/api/field-options`
168
- 里的精确 `dealOwner` 值、用户邮箱,或数字 user id。
78
+ ### 写入 Deal
169
79
 
170
- `llama --help` 看分组索引,`llama help all` 看全部 100+ 命令。
171
- 所有删除默认软删除、有审计记录。
80
+ `write` 内部只有四种 operation:
172
81
 
173
- ### 错误码
82
+ - `input.submit`:把完整原始输入保存在 Event Feed;
83
+ - `information.put`:写入一个结构化工作记忆单元;
84
+ - `page.patch`:更新人类直接看到的 Live Deal Page;
85
+ - `artifact.put`:添加不可变的 memo、HTML 或源文件。
174
86
 
175
- | 前缀 | 含义 | 恢复 |
176
- |------|------|------|
177
- | `Error[NO_AUTH]` | 没找到任何凭证 | `llama auth login` 或 `llama token set` |
178
- | `Error[UNAUTHORIZED]` | 服务端拒绝了凭证 | token 被吊销 / 过期 / 账号不对 |
87
+ 原始用户输入示例:
179
88
 
180
- MCP server 在 `isError: true` 内容里返回相同前缀。认证请求会向 Command
181
- 发送有界、脱敏的遥测;`llama eval good|bad --last` 把真实搜索变成评测反馈。
182
-
183
- ## MCP server
184
-
185
- `llama-mcp` 是 stdio MCP server,55 个类型化工具镜像 CLI 最常用的命令面。
186
- 每个工具具名、有边界——**故意不提供**通用 API passthrough。认证链与 CLI
187
- 完全一致。精确工具清单以 `tools/list` 为准:
89
+ ```json
90
+ {
91
+ "operation": "input.submit",
92
+ "dealId": "<uuid>",
93
+ "format": "text",
94
+ "content": "完整原始输入",
95
+ "source": {"kind": "meeting_note"},
96
+ "origin": {
97
+ "kind": "user",
98
+ "originalUserUtterance": "完整原始输入"
99
+ }
100
+ }
101
+ ```
188
102
 
189
103
  ```bash
190
- printf '%s\n' \
191
- '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"dev","version":"1"}}}' \
192
- '{"jsonrpc":"2.0","method":"notifications/initialized"}' \
193
- '{"jsonrpc":"2.0","id":2,"method":"tools/list"}' \
194
- | llama-mcp
104
+ llama deal write --json write.json
195
105
  ```
196
106
 
197
- <details>
198
- <summary><strong>Claude Desktop</strong></summary>
107
+ 任何源自用户的写入,都必须在 `origin.originalUserUtterance` 保存原话,
108
+ 或者引用 `origin.originatingChatRecordId`。Agent 的总结不能替代原始表达。
199
109
 
200
- `~/Library/Application Support/Claude/claude_desktop_config.json`(macOS):
110
+ Chat 和 Event 由系统拥有。Agent 不能自行伪造 Event 类型、顺序、作者、
111
+ 时间,也没有通用的 Chat 写入工具。
201
112
 
202
- ```json
203
- { "mcpServers": { "llama": { "command": "llama-mcp" } } }
204
- ```
205
- </details>
113
+ ## Deal 只有五种业务资源
206
114
 
207
- <details>
208
- <summary><strong>Claude Code</strong></summary>
115
+ 1. Live Deal Page:人类看到的当前状态;
116
+ 2. Deal Information:带标签与 provenance 的结构化 Agent 工作记忆;
117
+ 3. Artifacts:不可变的用户上传材料;
118
+ 4. Chat Records:append-only 的群聊与人机对话;
119
+ 5. Deal Events:append-only、可排序、可重放的完整历史。
209
120
 
210
- ```bash
211
- claude mcp add llama -- llama-mcp
212
- ```
213
- </details>
121
+ Fact、opinion、founder、status、archive、trash、memo section 和 artifact
122
+ kind 都只是这些资源里的字段或标签,不是新的表或新的工具。
214
123
 
215
- <details>
216
- <summary><strong>Cursor / 任何 stdio MCP 客户端</strong></summary>
124
+ ## MCP
217
125
 
218
- 把客户端指向 `llama-mcp` 可执行文件(`which llama-mcp`),JSON 结构同上。
219
- 无需协议扩展、无需 transport flag。
220
- </details>
126
+ ```bash
127
+ llama-mcp
128
+ ```
221
129
 
222
- > agent?跑 `llama agent-onboard`(CLI)或拉 `agent_briefing` prompt
223
- > (MCP),拿服务端的工作契约。包内
224
- > [`AGENT_BRIEFING.md`](AGENT_BRIEFING.md) 只是离线兜底。
130
+ MCP Deal 工具同样恰好四个:
225
131
 
226
- ## 稳定性
132
+ - `search_deals`
133
+ - `read_deal`
134
+ - `create_deal`
135
+ - `write_deal`
227
136
 
228
- - **[SemVer](https://semver.org)**:改名/删命令 major;新工具/命令/flag
229
- minor;修 bug → patch
230
- - **公开契约**:wire format(Bearer / X-Llama-Token)和 `Error[…]` 前缀
231
- 在 major 版本内不变。
232
- - **故意没有裸 API passthrough**——需要的 wrapper 还没有就开 issue,
233
- 不要直接调 HTTP API。
137
+ 认证、skill discovery、Wiki、admin audit、preferences 和 external pitch
138
+ 属于其他独立领域,不会扩大 Deal action space
234
139
 
235
- ## 安全
140
+ ## Agent 启动
236
141
 
237
- - 通过 npm [Trusted Publishers](https://docs.npmjs.com/trusted-publishers)
238
- (OIDC)+ `--provenance` 发布——不存在可泄漏的 npm token。
239
- - CLI 零运行时依赖;MCP server 只依赖 `@modelcontextprotocol/sdk`,pin 死版本。
240
- - main 分支保护、Dependabot、secret scanning、push protection 全开。
241
- - Token:本地 `~/.llama/token` mode `0600`;服务端只存 sha256 hash。
142
+ ```bash
143
+ llama agent bootstrap
144
+ llama skills search "<任务>"
145
+ llama skills show <slug>
146
+ ```
242
147
 
243
- 报告安全漏洞请走
244
- [GitHub 私密通道](https://github.com/Llama-Ventures/llama-cli/security/advisories/new),
245
- 不要发公开 issue。详见 [`SECURITY.md`](SECURITY.md)。
148
+ 服务端实时 briefing 是权威合同;包内 `AGENT_BRIEFING.md` 是相同四动作
149
+ 合同的离线兜底。
246
150
 
247
- ## 贡献与 License
151
+ ## 本地开发
248
152
 
249
- Llama Ventures 内部维护,团队 PR 欢迎(见 [`CONTRIBUTING.md`](CONTRIBUTING.md))。
250
- 外部:文档错漏类 issue 欢迎;想让我们看到你的项目请走
251
- [pitch 通道](#给华人创业者向-llama-pitch)。
153
+ ```bash
154
+ npm install
155
+ npm test
156
+ npm run verify:release
157
+ ```
252
158
 
253
- [MIT](LICENSE) © 2026 Llama Ventures, Inc.
159
+ 发布包会绑定准确 source SHA。npm publish 与生产服务端强制最低版本是两个
160
+ 独立、需要明确授权的 release 动作。