codequill 0.8.1-beta.4 → 0.9.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 +365 -118
- package/dist/commands/attest.js +248 -210
- package/dist/commands/attest.js.map +1 -1
- package/dist/commands/backup.js +1 -1
- package/dist/commands/backup.js.map +1 -1
- package/dist/commands/why.js +107 -87
- package/dist/commands/why.js.map +1 -1
- package/dist/launcher.js +0 -0
- package/dist/services/fs.js +56 -0
- package/dist/services/fs.js.map +1 -1
- package/dist/services/ui.js +12 -11
- package/dist/services/ui.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,121 +1,368 @@
|
|
|
1
|
-
CodeQuill CLI
|
|
1
|
+
# CodeQuill CLI
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
> Secure snapshots, authorship, and code preservation
|
|
4
|
+
|
|
5
|
+
Command-line interface for CodeQuill — memory infrastructure for software. Create snapshots, claim repositories, publish releases, attest artifacts, and preserve source code with zero-custody encryption.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
### From npm
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm install -g codequill
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
### From source
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
git clone https://github.com/codequill/codequill-cli.git
|
|
19
|
+
cd codequill-cli
|
|
20
|
+
npm install
|
|
21
|
+
npm run build
|
|
22
|
+
npm link
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Requirements
|
|
4
26
|
|
|
5
|
-
Requirements
|
|
6
27
|
- Node.js 18+
|
|
7
|
-
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
- `
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
-
|
|
118
|
-
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
28
|
+
- Git (for repository detection)
|
|
29
|
+
|
|
30
|
+
## Quick Start
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
# Authenticate with CodeQuill
|
|
34
|
+
codequill login
|
|
35
|
+
|
|
36
|
+
# Claim authorship of current repository
|
|
37
|
+
codequill claim
|
|
38
|
+
|
|
39
|
+
# Create a snapshot of your latest commit
|
|
40
|
+
codequill snapshot
|
|
41
|
+
|
|
42
|
+
# Publish a release
|
|
43
|
+
codequill publish
|
|
44
|
+
|
|
45
|
+
# Create an encrypted preservation
|
|
46
|
+
codequill preserve <snapshot-id>
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Commands
|
|
50
|
+
|
|
51
|
+
### Authentication
|
|
52
|
+
|
|
53
|
+
#### `codequill login`
|
|
54
|
+
|
|
55
|
+
Authenticate via device-code flow. Opens your browser to authorize the CLI.
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
codequill login
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
#### `codequill who`
|
|
62
|
+
|
|
63
|
+
Show the current authenticated user.
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
codequill who
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
#### `codequill quota`
|
|
70
|
+
|
|
71
|
+
Display your subscription plan and usage:
|
|
72
|
+
- Claimed repositories
|
|
73
|
+
- Snapshots created
|
|
74
|
+
- Preservations stored
|
|
75
|
+
- Attestations made
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
codequill quota
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### Repository Management
|
|
82
|
+
|
|
83
|
+
#### `codequill claim`
|
|
84
|
+
|
|
85
|
+
Claim authorship of a repository on-chain.
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
# Auto-detect from current git repository
|
|
89
|
+
codequill claim
|
|
90
|
+
|
|
91
|
+
# Skip confirmation prompt
|
|
92
|
+
codequill claim --no-confirm
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
**Options:**
|
|
96
|
+
- `--no-confirm` - Skip interactive confirmation
|
|
97
|
+
- `--confirmations <n>` - Wait for N confirmations (default: 1)
|
|
98
|
+
- `--timeout <ms>` - Timeout for confirmation
|
|
99
|
+
- `--no-wait` - Submit transaction and return immediately
|
|
100
|
+
- `--json` - Output in JSON format
|
|
101
|
+
|
|
102
|
+
#### `codequill status`
|
|
103
|
+
|
|
104
|
+
Show repository status and recent snapshots.
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
codequill status
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
#### `codequill log`
|
|
111
|
+
|
|
112
|
+
View snapshot history for the current repository.
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
codequill log
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### Snapshots
|
|
119
|
+
|
|
120
|
+
#### `codequill snapshot`
|
|
121
|
+
|
|
122
|
+
Create a deterministic snapshot (Merkle tree) of the repository at a specific commit.
|
|
123
|
+
|
|
124
|
+
```bash
|
|
125
|
+
# Snapshot current HEAD
|
|
126
|
+
codequill snapshot
|
|
127
|
+
|
|
128
|
+
# Snapshot specific commit
|
|
129
|
+
codequill snapshot --commit abc123
|
|
130
|
+
|
|
131
|
+
# Custom concurrency
|
|
132
|
+
codequill snapshot --concurrency 16
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
**Options:**
|
|
136
|
+
- `--commit <hash>` - Commit hash to snapshot (default: HEAD)
|
|
137
|
+
- `--concurrency <n>` - Number of concurrent file reads (default: 8)
|
|
138
|
+
- `--salt <hex>` - Custom salt for path hashing (64 hex chars)
|
|
139
|
+
- `--print-salt` - Display the salt in output
|
|
140
|
+
|
|
141
|
+
#### `codequill pull`
|
|
142
|
+
|
|
143
|
+
Download all published snapshot manifests for the current repository.
|
|
144
|
+
|
|
145
|
+
```bash
|
|
146
|
+
codequill pull
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
Manifests are stored in `.codequill/snapshots/`.
|
|
150
|
+
|
|
151
|
+
### Publishing
|
|
152
|
+
|
|
153
|
+
#### `codequill publish`
|
|
154
|
+
|
|
155
|
+
Publish a snapshot by anchoring its Merkle root on-chain and storing the manifest on IPFS.
|
|
156
|
+
|
|
157
|
+
```bash
|
|
158
|
+
# Publish latest snapshot
|
|
159
|
+
codequill publish
|
|
160
|
+
|
|
161
|
+
# Publish specific commit
|
|
162
|
+
codequill publish <commit-hash>
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
**Options:**
|
|
166
|
+
- `--no-confirm` - Skip confirmation prompt
|
|
167
|
+
- `--confirmations <n>` - Wait for N confirmations (default: 1)
|
|
168
|
+
- `--timeout <ms>` - Timeout for confirmation
|
|
169
|
+
- `--no-wait` - Submit and return immediately
|
|
170
|
+
- `--json` - Output in JSON format
|
|
171
|
+
|
|
172
|
+
**Note:** Releases (named, governed versions) are created in the web app at app.codequill.xyz. The CLI publishes snapshots.
|
|
173
|
+
|
|
174
|
+
#### `codequill wait`
|
|
175
|
+
|
|
176
|
+
Wait for a transaction to confirm.
|
|
177
|
+
|
|
178
|
+
```bash
|
|
179
|
+
codequill wait <tx-hash>
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
### Attestations
|
|
183
|
+
|
|
184
|
+
#### `codequill attest`
|
|
185
|
+
|
|
186
|
+
Create an attestation linking a build artifact to a published release.
|
|
187
|
+
|
|
188
|
+
```bash
|
|
189
|
+
codequill attest <artifact> <release-id>
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
**Arguments:**
|
|
193
|
+
- `<artifact>` - Path to the build artifact
|
|
194
|
+
- `<release-id>` - Release ID to attest against
|
|
195
|
+
|
|
196
|
+
**Options:**
|
|
197
|
+
- `--subject-name <name>` - Artifact name
|
|
198
|
+
- `--subject-version <ver>` - Artifact version
|
|
199
|
+
- `--upstream <purl>` - Upstream dependency (repeatable)
|
|
200
|
+
- `--no-confirm` - Skip confirmation
|
|
201
|
+
- `--confirmations <n>` - Wait for N confirmations
|
|
202
|
+
- `--json` - Output in JSON format
|
|
203
|
+
|
|
204
|
+
**Note:** Attestations require an **accepted release**. The release must pass governance approval before attestation.
|
|
205
|
+
|
|
206
|
+
#### `codequill verify-attestation`
|
|
207
|
+
|
|
208
|
+
Verify an attestation (offline operation).
|
|
209
|
+
|
|
210
|
+
```bash
|
|
211
|
+
codequill verify-attestation <attestation-file>
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
### Proofs
|
|
215
|
+
|
|
216
|
+
#### `codequill prove`
|
|
217
|
+
|
|
218
|
+
Generate a Merkle proof that a specific file was included in a snapshot.
|
|
219
|
+
|
|
220
|
+
```bash
|
|
221
|
+
codequill prove <file> <snapshot-id>
|
|
222
|
+
|
|
223
|
+
# Include plaintext path in proof
|
|
224
|
+
codequill prove <file> <snapshot-id> --disclose
|
|
225
|
+
|
|
226
|
+
# Custom output path
|
|
227
|
+
codequill prove LICENSE <snapshot-id> --out evidence/license-proof.json
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
**Arguments:**
|
|
231
|
+
- `<file>` - Path to file to prove inclusion for
|
|
232
|
+
- `<snapshot-id>` - Snapshot ID to prove against
|
|
233
|
+
|
|
234
|
+
**Options:**
|
|
235
|
+
- `--disclose` - Include plaintext path in proof (privacy tradeoff)
|
|
236
|
+
- `--out <file>` - Output path for proof file
|
|
237
|
+
|
|
238
|
+
#### `codequill verify-proof`
|
|
239
|
+
|
|
240
|
+
Verify a proof of inclusion (offline operation).
|
|
241
|
+
|
|
242
|
+
```bash
|
|
243
|
+
codequill verify-proof <proof-file>
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
### Preservations
|
|
247
|
+
|
|
248
|
+
#### `codequill preserve`
|
|
249
|
+
|
|
250
|
+
Create an encrypted preservation (backup) of source code tied to a published snapshot.
|
|
251
|
+
|
|
252
|
+
```bash
|
|
253
|
+
codequill preserve <snapshot-id>
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
**Arguments:**
|
|
257
|
+
- `<snapshot-id>` - Published snapshot ID to preserve
|
|
258
|
+
|
|
259
|
+
**Options:**
|
|
260
|
+
- `--no-confirm` - Skip confirmation
|
|
261
|
+
- `--confirmations <n>` - Wait for N confirmations
|
|
262
|
+
- `--timeout <ms>` - Timeout for confirmation
|
|
263
|
+
- `--no-wait` - Submit and return immediately
|
|
264
|
+
- `--json` - Output in JSON format
|
|
265
|
+
|
|
266
|
+
**Encryption:** Uses AES-256-GCM with passkey-derived keys (zero-custody). CodeQuill never sees plaintext source code.
|
|
267
|
+
|
|
268
|
+
### Learning
|
|
269
|
+
|
|
270
|
+
#### `codequill why`
|
|
271
|
+
|
|
272
|
+
Learn about CodeQuill concepts.
|
|
273
|
+
|
|
274
|
+
```bash
|
|
275
|
+
# Overview
|
|
276
|
+
codequill why
|
|
277
|
+
|
|
278
|
+
# Specific topics
|
|
279
|
+
codequill why claim
|
|
280
|
+
codequill why snapshot
|
|
281
|
+
codequill why publish
|
|
282
|
+
codequill why prove
|
|
283
|
+
codequill why attest
|
|
284
|
+
codequill why preserve
|
|
285
|
+
```
|
|
286
|
+
|
|
287
|
+
**Options:**
|
|
288
|
+
- `--short` - Brief explanation
|
|
289
|
+
- `--ci` - CI-friendly explanation
|
|
290
|
+
|
|
291
|
+
## Configuration
|
|
292
|
+
|
|
293
|
+
### API Endpoint
|
|
294
|
+
|
|
295
|
+
Set the CodeQuill API base URL:
|
|
296
|
+
|
|
297
|
+
```bash
|
|
298
|
+
export CODEQUILL_API_BASE_URL=https://api.codequill.xyz
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
Default: `https://api.codequill.xyz`
|
|
302
|
+
|
|
303
|
+
### Config Directory
|
|
304
|
+
|
|
305
|
+
Authentication tokens are stored at `~/.config/codequill/config.json` with `0600` permissions.
|
|
306
|
+
|
|
307
|
+
Override for testing:
|
|
308
|
+
|
|
309
|
+
```bash
|
|
310
|
+
export CODEQUILL_CONFIG_DIR=/custom/path
|
|
311
|
+
```
|
|
312
|
+
|
|
313
|
+
### Session Management
|
|
314
|
+
|
|
315
|
+
- Access tokens auto-refresh using your refresh token
|
|
316
|
+
- Refresh tokens valid for ~30 days
|
|
317
|
+
- Run `codequill login` to re-authenticate when expired
|
|
318
|
+
|
|
319
|
+
## How It Works
|
|
320
|
+
|
|
321
|
+
The CLI is a lightweight client that communicates with the CodeQuill backend:
|
|
322
|
+
|
|
323
|
+
1. **Snapshots** - Created locally by hashing files and building a Merkle tree. No source code is uploaded.
|
|
324
|
+
2. **Privacy** - File paths are salted before hashing (passkey-derived salt). Enables selective disclosure.
|
|
325
|
+
3. **Publishing** - Anchors snapshot Merkle roots on Ethereum and stores manifests on IPFS.
|
|
326
|
+
4. **Releases** - Created in the web app. Named, governed versions that group snapshots and enable attestations.
|
|
327
|
+
5. **Attestations** - Links build artifacts to accepted releases. Records who, what, and when on-chain.
|
|
328
|
+
6. **Preservations** - Encrypts full source archives client-side. Zero-custody (passkey-derived encryption).
|
|
329
|
+
7. **Proofs** - Merkle proofs of file inclusion. Verifiable by anyone, created with authority.
|
|
330
|
+
|
|
331
|
+
## Architecture
|
|
332
|
+
|
|
333
|
+
- **CLI** - Evidence production (snapshots, attestations, proofs)
|
|
334
|
+
- **Web App** - Configuration and governance (app.codequill.xyz)
|
|
335
|
+
- **Smart Contracts** - Immutable on-chain records (Ethereum)
|
|
336
|
+
- **IPFS** - Decentralized storage (manifests, preservations)
|
|
337
|
+
|
|
338
|
+
Even if CodeQuill servers are compromised, the evidence layer remains independently verifiable.
|
|
339
|
+
|
|
340
|
+
## Development
|
|
341
|
+
|
|
342
|
+
### Build
|
|
343
|
+
|
|
344
|
+
```bash
|
|
345
|
+
npm run build
|
|
346
|
+
```
|
|
347
|
+
|
|
348
|
+
### Watch mode
|
|
349
|
+
|
|
350
|
+
```bash
|
|
351
|
+
npm run dev
|
|
352
|
+
```
|
|
353
|
+
|
|
354
|
+
### Testing
|
|
355
|
+
|
|
356
|
+
```bash
|
|
357
|
+
npm test
|
|
358
|
+
npm run test:watch
|
|
359
|
+
npm run coverage
|
|
360
|
+
```
|
|
361
|
+
|
|
362
|
+
## Documentation
|
|
363
|
+
|
|
364
|
+
Full documentation: [docs.codequill.xyz](https://docs.codequill.xyz)
|
|
365
|
+
|
|
366
|
+
## License
|
|
367
|
+
|
|
368
|
+
MIT © CodeQuill
|