coherence-cli 0.7.0 → 0.7.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 +106 -1
- package/lib/commands/nodes.mjs +10 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -159,6 +159,35 @@ Every part of the network links to every other. Jump in wherever makes sense for
|
|
|
159
159
|
|
|
160
160
|
---
|
|
161
161
|
|
|
162
|
+
## API key — what it's for and how to get one
|
|
163
|
+
|
|
164
|
+
**No key needed for:** Browsing ideas, searching specs, viewing lineage, checking ledgers, reading node status, exploring the network.
|
|
165
|
+
|
|
166
|
+
**Key needed for:** Updating idea status, recording contributions, linking identities, voting on governance, creating specs, managing federation.
|
|
167
|
+
|
|
168
|
+
Most people start without a key. You only need one when you're ready to contribute.
|
|
169
|
+
|
|
170
|
+
### Get a key (interactive)
|
|
171
|
+
|
|
172
|
+
```bash
|
|
173
|
+
cc setup
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
This walks you through choosing a name, linking an identity (GitHub, Discord, Ethereum, etc.), and generates a key tied to your identity. Stored in `~/.coherence-network/config.json`.
|
|
177
|
+
|
|
178
|
+
### Manual setup
|
|
179
|
+
|
|
180
|
+
```bash
|
|
181
|
+
export COHERENCE_API_KEY=your-key
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
Or set it permanently:
|
|
185
|
+
|
|
186
|
+
```bash
|
|
187
|
+
cc identity set myname
|
|
188
|
+
# Key is auto-generated and stored in ~/.coherence-network/config.json
|
|
189
|
+
```
|
|
190
|
+
|
|
162
191
|
## Configuration
|
|
163
192
|
|
|
164
193
|
By default, `cc` talks to the public API at `https://api.coherencycoin.com`. Override with environment variables:
|
|
@@ -167,7 +196,7 @@ By default, `cc` talks to the public API at `https://api.coherencycoin.com`. Ove
|
|
|
167
196
|
# Point to a local node
|
|
168
197
|
export COHERENCE_API_URL=http://localhost:8000
|
|
169
198
|
|
|
170
|
-
#
|
|
199
|
+
# Set API key for write operations
|
|
171
200
|
export COHERENCE_API_KEY=your-key
|
|
172
201
|
```
|
|
173
202
|
|
|
@@ -175,6 +204,82 @@ Config is stored in `~/.coherence-network/config.json`.
|
|
|
175
204
|
|
|
176
205
|
---
|
|
177
206
|
|
|
207
|
+
## Search, filter, and CRUD
|
|
208
|
+
|
|
209
|
+
Every resource in the network is accessible from the CLI. Here's how to find what you need:
|
|
210
|
+
|
|
211
|
+
### Ideas — the core unit
|
|
212
|
+
|
|
213
|
+
```bash
|
|
214
|
+
cc ideas # Top 20 by free-energy score (ROI × confidence)
|
|
215
|
+
cc ideas 50 # Top 50
|
|
216
|
+
cc idea <id> # Full detail: scores, open questions, children, tasks
|
|
217
|
+
cc idea create <id> <name> # Create a new idea
|
|
218
|
+
--desc "..." # Description
|
|
219
|
+
--value 50 --cost 5 # Potential value and estimated cost
|
|
220
|
+
--parent <parent-id> # Parent idea (fractal hierarchy)
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
### Specs — blueprints linked to ideas
|
|
224
|
+
|
|
225
|
+
```bash
|
|
226
|
+
cc specs # List specs with ROI and value gap
|
|
227
|
+
cc specs 50 # More results
|
|
228
|
+
cc spec <id> # Full spec: summary, pseudocode, implementation status
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
### Tasks — the work queue
|
|
232
|
+
|
|
233
|
+
```bash
|
|
234
|
+
cc tasks # All pending tasks
|
|
235
|
+
cc tasks running # In-progress tasks
|
|
236
|
+
cc tasks completed 20 # Last 20 completed
|
|
237
|
+
cc task <id> # Full task: direction, idea link, output, provider
|
|
238
|
+
cc task next # Claim the highest-priority task
|
|
239
|
+
cc task seed <idea-id> spec # Create a task for an idea
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
### Contributors and identity
|
|
243
|
+
|
|
244
|
+
```bash
|
|
245
|
+
cc identity # Your linked accounts and CC balance
|
|
246
|
+
cc identity lookup github <handle> # Find any contributor by provider identity
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
### Nodes and federation
|
|
250
|
+
|
|
251
|
+
```bash
|
|
252
|
+
cc nodes # All nodes: status, SHA, providers, last seen
|
|
253
|
+
cc inbox # Messages from other nodes
|
|
254
|
+
cc msg <node> <text> # Send a message
|
|
255
|
+
cc cmd <node> status # Remote diagnostics
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
### Searching and filtering
|
|
259
|
+
|
|
260
|
+
Most list commands accept a limit. For deeper filtering, use the API directly:
|
|
261
|
+
|
|
262
|
+
```bash
|
|
263
|
+
# Search ideas by keyword
|
|
264
|
+
curl -s "$CN_API/api/ideas/cards?search=treasury&limit=10" | jq '.items[] | {id, name}'
|
|
265
|
+
|
|
266
|
+
# Search specs by keyword
|
|
267
|
+
curl -s "$CN_API/api/spec-registry/cards?search=auth&limit=10" | jq '.items[] | {spec_id, title}'
|
|
268
|
+
|
|
269
|
+
# Filter tasks by type and status
|
|
270
|
+
curl -s "$CN_API/api/agent/tasks?status=completed&task_type=review&limit=10" | jq '.tasks[] | {id, task_type}'
|
|
271
|
+
|
|
272
|
+
# Contributor ledger
|
|
273
|
+
curl -s "$CN_API/api/contributions/ledger/seeker71" | jq '.balance'
|
|
274
|
+
|
|
275
|
+
# Ideas by parent (fractal drill-down)
|
|
276
|
+
curl -s "$CN_API/api/ideas/<parent-id>" | jq '.child_idea_ids'
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
The full API has 215 endpoints across 20 resource groups — see [api.coherencycoin.com/docs](https://api.coherencycoin.com/docs) for the complete reference. The CLI covers the most common operations; the API covers everything.
|
|
280
|
+
|
|
281
|
+
---
|
|
282
|
+
|
|
178
283
|
## All commands
|
|
179
284
|
|
|
180
285
|
```
|
package/lib/commands/nodes.mjs
CHANGED
|
@@ -119,7 +119,16 @@ export async function listNodes() {
|
|
|
119
119
|
|
|
120
120
|
const ago = ageMin < 1 ? "now" : ageMin < 60 ? `${ageMin}m ago` : `${Math.floor(ageMin / 60)}h ago`;
|
|
121
121
|
|
|
122
|
-
|
|
122
|
+
// Git version from capabilities
|
|
123
|
+
const git = node.capabilities?.git || {};
|
|
124
|
+
const sha = git.local_sha || "?";
|
|
125
|
+
const originSha = git.origin_sha || "?";
|
|
126
|
+
const upToDate = git.up_to_date === "yes";
|
|
127
|
+
const versionTag = upToDate
|
|
128
|
+
? `\x1b[32m${sha}\x1b[0m`
|
|
129
|
+
: `\x1b[31m${sha} (origin: ${originSha})\x1b[0m`;
|
|
130
|
+
|
|
131
|
+
console.log(` ${dot} ${icon} \x1b[1m${node.hostname || "?"}\x1b[0m ${ago} sha:${versionTag}`);
|
|
123
132
|
console.log(` ${providers.join(", ")}`);
|
|
124
133
|
console.log(` id: ${node.node_id}`);
|
|
125
134
|
console.log();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "coherence-cli",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.1",
|
|
4
4
|
"description": "Coherence Network CLI \u2014 trace ideas from inception to payout, with fair attribution, coherence scoring, and 37 identity providers. No signup needed.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|