@llamaventures/cli 1.25.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/AGENT_BRIEFING.md +125 -336
- package/CHANGELOG.md +32 -0
- package/README.md +116 -213
- package/README.zh-CN.md +112 -205
- package/bin/llama-mcp.mjs +209 -1992
- package/bin/llama.mjs +388 -3609
- package/contracts/core-api.json +4 -4
- package/contracts/required-operations.json +27 -356
- package/lib/build-manifest.json +4 -4
- package/lib/client.mjs +12 -5
- package/lib/deal-actions.mjs +102 -0
- package/package.json +3 -3
- package/contracts/investment-workflow-v2.md +0 -19
- package/lib/workflow-audit.mjs +0 -13
- package/lib/workflow-remediation.mjs +0 -45
package/README.md
CHANGED
|
@@ -1,262 +1,165 @@
|
|
|
1
|
-
|
|
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>The Llama Ventures CLI & MCP server.</strong><br/>
|
|
9
|
-
One package, two binaries: <code>llama</code> — the CLI for humans and scripts —
|
|
10
|
-
and <code>llama-mcp</code> — a stdio MCP server with 55 typed tools for any
|
|
11
|
-
MCP-native agent. Both share the same auth chain, HTTP client, and error
|
|
12
|
-
format, and talk to <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
|
-
<strong>English</strong> · <a href="README.zh-CN.md">简体中文</a>
|
|
23
|
-
</p>
|
|
24
|
-
|
|
25
|
-
<p align="center">
|
|
26
|
-
<a href="#install">Install</a> ·
|
|
27
|
-
<a href="#authenticate">Authenticate</a> ·
|
|
28
|
-
<a href="#integrate-your-ai-system">Integrate your AI</a> ·
|
|
29
|
-
<a href="#cli">CLI</a> ·
|
|
30
|
-
<a href="#mcp-server">MCP</a> ·
|
|
31
|
-
<a href="#external-pitch--no-llama-account-required">External pitch</a> ·
|
|
32
|
-
<a href="CHANGELOG.md">Changelog</a>
|
|
33
|
-
</p>
|
|
34
|
-
|
|
35
|
-
> **Public source for low-friction install — not an open-source product.**
|
|
36
|
-
> Most operations require a Llama Ventures team account (tokens are minted by
|
|
37
|
-
> the team admin at `/settings/tokens`). The one exception is the public
|
|
38
|
-
> [`pitch`](#external-pitch--no-llama-account-required) family.
|
|
39
|
-
|
|
40
|
-
## Install
|
|
1
|
+
# Llama Command CLI 2
|
|
41
2
|
|
|
42
|
-
|
|
43
|
-
npm i -g @llamaventures/cli # Node 18+; also puts `llama-mcp` on your PATH
|
|
44
|
-
llama --version
|
|
45
|
-
llama version --json # package, source commit, and pinned Core API contract
|
|
46
|
-
llama auth status # round-trips against /api/me
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
## Authenticate
|
|
3
|
+
The small authenticated agent interface for Llama Command.
|
|
50
4
|
|
|
51
|
-
|
|
5
|
+
CLI 2 replaces the split Deal command surface with exactly four actions. Core
|
|
6
|
+
owns database writes, Drive provisioning, audit Events, provenance, and
|
|
7
|
+
idempotency. Agents never touch PostgreSQL directly.
|
|
52
8
|
|
|
53
|
-
|
|
54
|
-
|---|--------|----------|
|
|
55
|
-
| 1 | `llama auth login` (OAuth, OS keychain, auto-refresh) | **Recommended for everyone** |
|
|
56
|
-
| 2 | `gcloud auth print-identity-token` | Machines already wired with gcloud |
|
|
57
|
-
| 3 | `$LLAMA_TOKEN` env var | CI, sandboxed cloud agents |
|
|
58
|
-
| 4 | `~/.llama/token` (mode `0600`) | Long-lived PATs |
|
|
59
|
-
| 5 | `~/.llama-command/config.json` | v0.1 legacy — auto-migrates |
|
|
9
|
+
## Install or upgrade
|
|
60
10
|
|
|
61
11
|
```bash
|
|
62
|
-
|
|
63
|
-
llama
|
|
64
|
-
llama
|
|
65
|
-
llama auth status # shows the resolved identity + active method
|
|
12
|
+
npm i -g @llamaventures/cli@latest
|
|
13
|
+
llama --version
|
|
14
|
+
llama auth status
|
|
66
15
|
```
|
|
67
16
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
## Integrate your AI system
|
|
17
|
+
Llama Command requires CLI 2 for authenticated CLI/MCP requests. A 1.x client
|
|
18
|
+
receives `426 CLI_VERSION_UNSUPPORTED` with the upgrade command; it does not
|
|
19
|
+
fall back to legacy Deal APIs.
|
|
72
20
|
|
|
73
|
-
|
|
74
|
-
in-house agents and LLM apps through here — **not the raw HTTP API**: the
|
|
75
|
-
CLI/MCP layer owns the auth chain, the stable `Error[…]` contract, and
|
|
76
|
-
forward-compatibility ([SemVer](#stability)); raw API routes carry no such
|
|
77
|
-
promise.
|
|
21
|
+
Authentication is discovered in this order:
|
|
78
22
|
|
|
79
|
-
1.
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
([per-client config](#mcp-server)); anything else shells out to `llama …`.
|
|
84
|
-
4. **Onboard the agent** — run `llama agent-onboard` (or the MCP
|
|
85
|
-
`agent_briefing` prompt) at session start. It returns the server-owned
|
|
86
|
-
Agent Runtime Contract, always in sync with the live server.
|
|
87
|
-
5. **Verify** — `llama auth status`, then `llama deal search "<anything>"`.
|
|
23
|
+
1. OAuth credentials from `llama auth login`.
|
|
24
|
+
2. A local Google identity from `gcloud auth login`.
|
|
25
|
+
3. `LLAMA_TOKEN`.
|
|
26
|
+
4. `~/.llama/token`.
|
|
88
27
|
|
|
89
|
-
##
|
|
90
|
-
|
|
91
|
-
The CLI is the canonical interface — it handles auth, error formatting, and
|
|
92
|
-
schema forward-compatibility. Prefer it even from scripts.
|
|
28
|
+
## Exactly four Deal actions
|
|
93
29
|
|
|
94
30
|
```bash
|
|
95
|
-
llama deal search "
|
|
96
|
-
llama deal
|
|
97
|
-
llama deal
|
|
98
|
-
llama
|
|
99
|
-
llama activity updated-deals --since 7d # meaningful updates grouped by deal
|
|
100
|
-
llama deal create "Acme AI" --source alex --deal-owner owner@llamaventures.vc --source-direction Outbound --status Interested
|
|
101
|
-
llama deal ingest <dealId> --file packet.json # atomic multi-fact + optional Feed note; retry-safe
|
|
102
|
-
llama deal fact add <dealId> --category funding --claim "Raised a seed round" --source "deck p3" --source-url https://...
|
|
103
|
-
llama workflow show <dealId>
|
|
104
|
-
llama workflow initialize <dealId> --reason "Migrate legacy workflow state without changing stage"
|
|
105
|
-
llama workflow proceed <dealId> --transition begin_preliminary --reason "Ready to begin research"
|
|
106
|
-
llama workflow execution-status <dealId> invested --reason "Wire confirmed"
|
|
107
|
-
llama post <dealId> "note body"
|
|
108
|
-
llama post <dealId> "@name please respond" --cue # only after explicit approval
|
|
109
|
-
llama brief add-text <dealId> --heading "..." --body "..."
|
|
110
|
-
llama wiki search "<query>"
|
|
111
|
-
llama wiki save <slug> --title "..." --content "..."
|
|
112
|
-
llama mentions
|
|
113
|
-
llama agent-onboard # server-owned agent workflow contract
|
|
31
|
+
llama deal search "Acme" --limit 10
|
|
32
|
+
llama deal read <dealId> --detail overview
|
|
33
|
+
llama deal create --json create.json
|
|
34
|
+
llama deal write --json write.json
|
|
114
35
|
```
|
|
115
36
|
|
|
116
|
-
|
|
117
|
-
Workflow V2 deal or every persisted V2 snapshot:
|
|
37
|
+
`read` is progressive:
|
|
118
38
|
|
|
119
39
|
```bash
|
|
120
|
-
llama
|
|
121
|
-
llama
|
|
40
|
+
llama deal read <dealId> --detail memory
|
|
41
|
+
llama deal read <dealId> --detail files
|
|
42
|
+
llama deal read <dealId> --detail conversation
|
|
43
|
+
llama deal read <dealId> --detail history
|
|
44
|
+
llama deal read <dealId> --detail all
|
|
122
45
|
```
|
|
123
46
|
|
|
124
|
-
|
|
125
|
-
and one deal at a time. Apply requires the exact revision returned by preview:
|
|
126
|
-
|
|
127
|
-
```bash
|
|
128
|
-
llama admin workflow remediate --deal <dealId> --guard intake.reason_why
|
|
129
|
-
llama admin workflow remediate --deal <dealId> --guard intake.reason_why \
|
|
130
|
-
--apply --expected-revision <revision> --reason "Confirmed missing canonical evidence"
|
|
131
|
-
```
|
|
132
|
-
|
|
133
|
-
The server can only invalidate a system-generated green. It cannot advance a
|
|
134
|
-
deal, satisfy a check, change status/ownership, or override a human resolution.
|
|
135
|
-
|
|
136
|
-
Status vocabulary — `Interested`: tracked before any contact ·
|
|
137
|
-
`Outreached`: contacted, no response yet · `Sourced`: real relationship
|
|
138
|
-
signal exists. `sourceDirection` is separate: `Inbound` came to the firm,
|
|
139
|
-
`Outbound` we reached out first.
|
|
140
|
-
|
|
141
|
-
Deal stage is controlled only by Investment Workflow V2. Direct
|
|
142
|
-
`deal update ... status ...` and legacy `stage_gates` writes are rejected;
|
|
143
|
-
use `llama workflow show` followed by the matching formal workflow command.
|
|
144
|
-
|
|
145
|
-
For a deck, meeting note, email, or research packet, prefer `deal ingest` over a
|
|
146
|
-
loop of `deal fact add` calls. The JSON object accepts `source`, up to 50
|
|
147
|
-
`facts`, an optional `note`, and an optional `idempotencyKey`. The server commits
|
|
148
|
-
the packet atomically, maps common category aliases into the canonical taxonomy,
|
|
149
|
-
and skips exact source-aware duplicates. `deal fact add` remains the simple path
|
|
150
|
-
for one fact.
|
|
151
|
-
|
|
152
|
-
Facts use `claim` for the fact text. `source` is a readable provenance label
|
|
153
|
-
and `sourceUrl` is the canonical evidence URL; both round-trip from the API.
|
|
154
|
-
For deal owners, use an exact `/api/field-options` `dealOwner` value, a user
|
|
155
|
-
email, or a numeric user id.
|
|
47
|
+
The Live Deal Page is always returned. Expand only what the task needs.
|
|
156
48
|
|
|
157
|
-
|
|
158
|
-
reference (100+ commands). Deletes are soft and audit-logged everywhere.
|
|
49
|
+
### Create
|
|
159
50
|
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
51
|
+
```json
|
|
52
|
+
{
|
|
53
|
+
"companyName": "Acme",
|
|
54
|
+
"page": {
|
|
55
|
+
"website": "https://example.com",
|
|
56
|
+
"stage": "Diligence"
|
|
57
|
+
},
|
|
58
|
+
"information": [
|
|
59
|
+
{
|
|
60
|
+
"type": "traction.claim",
|
|
61
|
+
"labels": ["founder_reported", "unverified"],
|
|
62
|
+
"subject": {"company": "Acme"},
|
|
63
|
+
"value": {"arrUsd": 320000}
|
|
64
|
+
}
|
|
65
|
+
],
|
|
66
|
+
"origin": {
|
|
67
|
+
"kind": "user",
|
|
68
|
+
"originalUserUtterance": "Acme says ARR is about $320k."
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
```
|
|
166
72
|
|
|
167
|
-
|
|
168
|
-
|
|
73
|
+
```bash
|
|
74
|
+
llama deal create --json create.json
|
|
75
|
+
```
|
|
169
76
|
|
|
170
|
-
|
|
77
|
+
Core adds `operation: deal.create`, creates or reuses the Drive folder, writes
|
|
78
|
+
the initial Live Page and Information, and appends Events atomically.
|
|
171
79
|
|
|
172
|
-
|
|
173
|
-
that mirror the most-used CLI surface. Every tool is named and scoped — there
|
|
174
|
-
is deliberately no generic API passthrough. Auth is identical to the CLI's
|
|
175
|
-
chain. For the exact live list, pipe `tools/list` through it:
|
|
80
|
+
### Write
|
|
176
81
|
|
|
177
|
-
|
|
178
|
-
printf '%s\n' \
|
|
179
|
-
'{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"dev","version":"1"}}}' \
|
|
180
|
-
'{"jsonrpc":"2.0","method":"notifications/initialized"}' \
|
|
181
|
-
'{"jsonrpc":"2.0","id":2,"method":"tools/list"}' \
|
|
182
|
-
| llama-mcp
|
|
183
|
-
```
|
|
82
|
+
`write` accepts only four operation choices:
|
|
184
83
|
|
|
185
|
-
|
|
186
|
-
|
|
84
|
+
- `input.submit` — preserve raw input in the Event Feed.
|
|
85
|
+
- `information.put` — add or update one structured memory unit.
|
|
86
|
+
- `page.patch` — update the human-visible Live Deal Page.
|
|
87
|
+
- `artifact.put` — add an immutable memo/HTML/source artifact.
|
|
187
88
|
|
|
188
|
-
|
|
89
|
+
Raw user input example:
|
|
189
90
|
|
|
190
91
|
```json
|
|
191
|
-
{
|
|
92
|
+
{
|
|
93
|
+
"operation": "input.submit",
|
|
94
|
+
"dealId": "<uuid>",
|
|
95
|
+
"format": "text",
|
|
96
|
+
"content": "the complete input",
|
|
97
|
+
"source": {"kind": "meeting_note"},
|
|
98
|
+
"origin": {
|
|
99
|
+
"kind": "user",
|
|
100
|
+
"originalUserUtterance": "the complete input"
|
|
101
|
+
}
|
|
102
|
+
}
|
|
192
103
|
```
|
|
193
|
-
</details>
|
|
194
|
-
|
|
195
|
-
<details>
|
|
196
|
-
<summary><strong>Claude Code</strong></summary>
|
|
197
104
|
|
|
198
105
|
```bash
|
|
199
|
-
|
|
106
|
+
llama deal write --json write.json
|
|
200
107
|
```
|
|
201
|
-
</details>
|
|
202
108
|
|
|
203
|
-
|
|
204
|
-
|
|
109
|
+
For user-originated work, preserve the exact words in
|
|
110
|
+
`origin.originalUserUtterance` or reference the canonical
|
|
111
|
+
`origin.originatingChatRecordId`. An agent summary never replaces the source.
|
|
205
112
|
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
</details>
|
|
113
|
+
Chat and Event are system-owned. There is no caller-controlled Event append or
|
|
114
|
+
general Chat-forging operation.
|
|
209
115
|
|
|
210
|
-
|
|
211
|
-
> pulls the server-owned workflow contract. The bundled
|
|
212
|
-
> [`AGENT_BRIEFING.md`](AGENT_BRIEFING.md) is a fallback copy only.
|
|
116
|
+
## Five Deal resources
|
|
213
117
|
|
|
214
|
-
|
|
118
|
+
1. Live Deal Page — current human-visible state.
|
|
119
|
+
2. Deal Information — structured, labelled, provenance-linked agent memory.
|
|
120
|
+
3. Artifacts — immutable uploaded source material.
|
|
121
|
+
4. Chat Records — append-only group and human-agent conversation.
|
|
122
|
+
5. Deal Events — append-only, ordered, replayable history.
|
|
215
123
|
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
124
|
+
Fact, opinion, founder, status, archive, trash, memo section, and artifact kind
|
|
125
|
+
are labels or fields inside these resources, not extra tools or tables.
|
|
126
|
+
|
|
127
|
+
## MCP
|
|
128
|
+
|
|
129
|
+
Run the bundled stdio server:
|
|
221
130
|
|
|
222
131
|
```bash
|
|
223
|
-
llama
|
|
224
|
-
llama pitch say "We're building an AI dev tool for X..."
|
|
225
|
-
llama pitch upload ./deck.pdf
|
|
226
|
-
llama pitch # interactive REPL
|
|
132
|
+
llama-mcp
|
|
227
133
|
```
|
|
228
134
|
|
|
229
|
-
|
|
135
|
+
Its Deal surface is also exactly four tools:
|
|
230
136
|
|
|
231
|
-
|
|
137
|
+
- `search_deals`
|
|
138
|
+
- `read_deal`
|
|
139
|
+
- `create_deal`
|
|
140
|
+
- `write_deal`
|
|
232
141
|
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
- **Public contract:** the wire format (Bearer / X-Llama-Token) and the
|
|
236
|
-
`Error[…]` prefixes don't change inside a major version.
|
|
237
|
-
- **No raw-API passthrough, by design.** If a wrapper you need hasn't landed,
|
|
238
|
-
open an issue instead of calling the HTTP API directly.
|
|
142
|
+
Authentication, skill discovery, Wiki, admin audit, preferences, and external
|
|
143
|
+
pitch remain separate non-Deal domains.
|
|
239
144
|
|
|
240
|
-
##
|
|
145
|
+
## Agent bootstrap
|
|
241
146
|
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
- Tokens: `~/.llama/token` mode `0600` locally; sha256 hashes server-side.
|
|
248
|
-
|
|
249
|
-
Report vulnerabilities privately via
|
|
250
|
-
[GitHub security advisories](https://github.com/Llama-Ventures/llama-cli/security/advisories/new)
|
|
251
|
-
— not public issues. See [`SECURITY.md`](SECURITY.md).
|
|
147
|
+
```bash
|
|
148
|
+
llama agent bootstrap
|
|
149
|
+
llama skills search "<task>"
|
|
150
|
+
llama skills show <slug>
|
|
151
|
+
```
|
|
252
152
|
|
|
253
|
-
|
|
153
|
+
The live server briefing is authoritative. The bundled
|
|
154
|
+
`AGENT_BRIEFING.md` is an offline fallback with the same four-action contract.
|
|
254
155
|
|
|
255
|
-
|
|
256
|
-
[`CONTRIBUTING.md`](CONTRIBUTING.md). External: issues for doc gaps and broken
|
|
257
|
-
flows are welcome; to get your company in front of us, use the
|
|
258
|
-
[pitch path](#external-pitch--no-llama-account-required).
|
|
156
|
+
## Development
|
|
259
157
|
|
|
260
|
-
|
|
158
|
+
```bash
|
|
159
|
+
npm install
|
|
160
|
+
npm test
|
|
161
|
+
npm run verify:release
|
|
162
|
+
```
|
|
261
163
|
|
|
262
|
-
|
|
164
|
+
Release artifacts are source-SHA certified. Publishing to npm and changing the
|
|
165
|
+
production server's minimum version are separate, explicit release operations.
|