@attestify/cli 0.1.2 → 0.1.3

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 +296 -29
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -1,74 +1,341 @@
1
1
  # @attestify/cli
2
2
 
3
- Command-line tool for interacting with the Attestify protocol on Hedera testnet.
3
+ Command-line tool for the Attestify protocol on Hedera — 40+ commands covering schemas, attestations, authorities, delegation, resolvers, HCS audit log, scheduled revocations, multi-sig, staking, file service, and AI-powered natural language mode.
4
4
 
5
- ## Setup
5
+ [![npm](https://img.shields.io/npm/v/@attestify/cli)](https://www.npmjs.com/package/@attestify/cli)
6
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
6
7
 
7
- ```bash
8
- # From hedera/ root
9
- pnpm install
8
+ ## Installation
10
9
 
11
- # Build the CLI
12
- pnpm --filter @attestify/cli build
10
+ ```bash
11
+ npm install -g @attestify/cli
12
+ # or
13
+ pnpm add -g @attestify/cli
13
14
  ```
14
15
 
15
- Set your credentials via environment variables or a `.env` file:
16
+ ## Configuration
17
+
18
+ Set credentials via environment variables or a `.env` file:
16
19
 
17
20
  ```bash
18
- export HEDERA_ACCOUNT_ID=0.0.12345
19
- export HEDERA_PRIVATE_KEY=your_ecdsa_private_key_hex
21
+ # Required
22
+ export HEDERA_ACCOUNT_ID="0.0.XXXXX"
23
+ export HEDERA_PRIVATE_KEY="your-ecdsa-private-key-hex"
24
+
25
+ # Optional
26
+ export INDEXER_URL="http://localhost:3001/api"
27
+ export HCS_TOPIC_SCHEMAS="0.0.8221945"
28
+ export HCS_TOPIC_ATTESTATIONS="0.0.8221946"
29
+ export HCS_TOPIC_AUTHORITIES="0.0.8221947"
20
30
  ```
21
31
 
22
- ## Commands
32
+ All commands target Hedera testnet. Append `--json` to any command for machine-readable JSON output.
23
33
 
24
- All commands target Hedera testnet by default. Append `--json` to any command for JSON output.
34
+ ---
25
35
 
26
- ### Schema
36
+ ## Schema Commands
27
37
 
28
38
  ```bash
29
- # Register a schema
30
- attestify schema create --definition "string name, uint256 score, bool passed" --revocable
39
+ # Register a schema (inline)
40
+ attestify schema create \
41
+ --definition "string name, uint256 age, bool verified" \
42
+ --revocable \
43
+ --resolver 0x461349A8aEfB220A48b61923095DfF237465c27A
31
44
 
32
- # Register from a JSON file
45
+ # Register from JSON file
33
46
  attestify schema create --file schema.json
34
47
 
35
48
  # Fetch a schema by UID
36
- attestify schema fetch --uid 0xabc123...
49
+ attestify schema fetch --uid 0x7408a93fa658b219...
50
+
51
+ # List all schemas
52
+ attestify schema list
53
+
54
+ # Filter by authority
55
+ attestify schema list --authority 0x9Bf9a686... --limit 10
37
56
  ```
38
57
 
39
- ### Attestation
58
+ ---
59
+
60
+ ## Attestation Commands
40
61
 
41
62
  ```bash
42
63
  # Create an attestation
43
64
  attestify attestation create \
44
- --schema-uid 0xabc123... \
45
- --subject 0x1234...abcd \
46
- --data 0x... \
47
- --expiration 0
65
+ --schema-uid 0x7408a93f... \
66
+ --subject 0x0F1A0cb4... \
67
+ --data 0x00000000... \
68
+ --expiration 1735689600
48
69
 
49
- # Create from a JSON file
70
+ # Create from file
50
71
  attestify attestation create --file attestation.json
51
72
 
52
73
  # Fetch an attestation
53
- attestify attestation fetch --uid 0xdef456...
74
+ attestify attestation fetch --uid 0xbc72d396...
75
+
76
+ # List by attester
77
+ attestify attestation list --attester 0x9Bf9a686...
78
+
79
+ # List by subject
80
+ attestify attestation list --subject 0x0F1A0cb4...
81
+
82
+ # List by schema + limit
83
+ attestify attestation list --schema-uid 0x7408a93f... --limit 10
54
84
 
55
85
  # Revoke an attestation
56
- attestify attestation revoke --uid 0xdef456...
86
+ attestify attestation revoke --uid 0xbc72d396...
57
87
  ```
58
88
 
59
- ### Authority
89
+ ---
90
+
91
+ ## Authority Commands
60
92
 
61
93
  ```bash
62
94
  # Register as an authority
63
- attestify authority register --metadata "My Organization"
95
+ attestify authority register --metadata "Acme KYC Services"
64
96
 
65
97
  # Fetch authority info
66
- attestify authority fetch --address 0x1234...abcd
98
+ attestify authority fetch --address 0x9Bf9a686...
99
+
100
+ # Verify an authority (admin only)
101
+ attestify authority verify --address 0x9Bf9a686...
102
+
103
+ # Unverify an authority
104
+ attestify authority verify --address 0x9Bf9a686... --revoke
105
+ ```
106
+
107
+ ---
108
+
109
+ ## Profile
110
+
111
+ ```bash
112
+ attestify profile --address 0x9Bf9a686...
113
+
114
+ # JSON output
115
+ attestify --json profile --address 0x9Bf9a686...
116
+ ```
117
+
118
+ ---
119
+
120
+ ## Delegation Commands
121
+
122
+ ```bash
123
+ # Add a delegate
124
+ attestify delegate add --address 0xDelegateAddress...
125
+
126
+ # Remove a delegate
127
+ attestify delegate remove --address 0xDelegateAddress...
128
+
129
+ # Check delegation status
130
+ attestify delegate check --authority 0xAuthority... --delegate 0xDelegate...
131
+
132
+ # List all delegates for an authority
133
+ attestify delegate list --authority 0xAuthority...
134
+
135
+ # Attest on behalf of an authority
136
+ attestify delegate attest \
137
+ --authority 0xAuthorityAddress... \
138
+ --schema-uid 0x7408a93f... \
139
+ --subject 0x0F1A0cb4... \
140
+ --data 0x...
141
+
142
+ # Revoke on behalf
143
+ attestify delegate revoke --uid 0xbc72d396...
144
+ ```
145
+
146
+ ---
147
+
148
+ ## Resolver Commands
149
+
150
+ ### Whitelist Resolver
151
+
152
+ ```bash
153
+ attestify whitelist add --account 0x0F1A0cb4...
154
+ attestify whitelist remove --account 0x0F1A0cb4...
155
+ attestify whitelist check --account 0x0F1A0cb4...
156
+ attestify whitelist owner
157
+ ```
158
+
159
+ ### Fee Resolver
160
+
161
+ ```bash
162
+ attestify fee deposit --amount 10
163
+ attestify fee set-fee --amount 1000000000
164
+ attestify fee withdraw
165
+ attestify fee get-fee
166
+ attestify fee balance --account 0x9Bf9a686...
167
+ attestify fee owner
168
+ ```
169
+
170
+ ### Token-Gated Resolver
171
+
172
+ ```bash
173
+ attestify token-gated set-config \
174
+ --token 0xTokenAddress... \
175
+ --min-balance 1
176
+ attestify token-gated get-config
177
+ attestify token-gated owner
178
+ ```
179
+
180
+ ---
181
+
182
+ ## Token Reward Commands
183
+
184
+ ```bash
185
+ attestify token-reward set-config \
186
+ --resolver 0xResolverAddress... \
187
+ --token 0xTokenAddress... \
188
+ --amount 100
189
+
190
+ attestify token-reward get-config --resolver 0xResolverAddress...
191
+
192
+ attestify token-reward distributed \
193
+ --resolver 0xResolverAddress... \
194
+ --subject 0xSubjectAddress...
195
+ ```
196
+
197
+ ---
198
+
199
+ ## Cross-Contract Resolver Commands
200
+
201
+ ```bash
202
+ attestify cross-contract set-pipeline \
203
+ --resolver 0xResolverAddress... \
204
+ --resolvers 0xWhitelist...,0xFee...,0xTokenGated...
205
+
206
+ attestify cross-contract get-pipeline --resolver 0xResolverAddress...
207
+ ```
208
+
209
+ ---
210
+
211
+ ## NFT Minting
212
+
213
+ ```bash
214
+ attestify nft-mint \
215
+ --subject 0x0F1A0cb4... \
216
+ --attestation-uid 0xbc72d396... \
217
+ --token-id 0.0.12345
218
+ ```
219
+
220
+ ---
221
+
222
+ ## HCS Audit Trail
223
+
224
+ ```bash
225
+ # List HCS topic IDs
226
+ attestify hcs topics
227
+
228
+ # Latest 25 messages from a topic
229
+ attestify hcs messages --topic 0.0.8221946
230
+
231
+ # Oldest first, limit 10
232
+ attestify hcs messages --topic 0.0.8221946 --limit 10 --order asc
233
+
234
+ # Per-schema topic
235
+ attestify hcs messages --topic 0.0.8225001 --limit 50
67
236
  ```
68
237
 
238
+ ---
239
+
240
+ ## Hedera Native Features
241
+
242
+ ### Scheduled Revocation
243
+
244
+ ```bash
245
+ attestify schedule revoke \
246
+ --uid 0xbc72d396... \
247
+ --execute-at 1735689600
248
+
249
+ attestify schedule status --schedule-id 0.0.12345
250
+ ```
251
+
252
+ ### Multi-Sig Authority
253
+
254
+ ```bash
255
+ attestify multisig create \
256
+ --keys 302a300506...,302a300506...,302a300506... \
257
+ --threshold 2 \
258
+ --initial-balance 10
259
+
260
+ attestify multisig info --account 0.0.12345
261
+ ```
262
+
263
+ ### Token Staking
264
+
265
+ ```bash
266
+ attestify staking stake --token 0xTokenAddr... --amount 1000
267
+ attestify staking unstake --token 0xTokenAddr... --amount 500
268
+ attestify staking balance --token 0xTokenAddr... --authority 0.0.12345
269
+ ```
270
+
271
+ ### File Service Schema
272
+
273
+ ```bash
274
+ # Upload a schema definition to Hedera File Service
275
+ attestify file-schema upload \
276
+ --definition "string name, uint256 age, bool verified" \
277
+ --memo "KYC schema v2"
278
+
279
+ # Read a schema from File Service
280
+ attestify file-schema read --file-id 0.0.12345
281
+
282
+ # Register a schema from a File Service file
283
+ attestify file-schema register \
284
+ --file-id 0.0.12345 \
285
+ --revocable \
286
+ --resolver 0x461349...
287
+ ```
288
+
289
+ ---
290
+
291
+ ## AI Mode (`attestify ai`)
292
+
293
+ Natural language interface to the protocol — same 17 tools as `@attestify/sdk/ai`, powered by OpenAI.
294
+
295
+ Requires `OPENAI_API_KEY` environment variable.
296
+
297
+ ### One-Shot Mode
298
+
299
+ ```bash
300
+ attestify ai "List all schemas"
301
+ attestify ai "Register a schema with fields: string name, uint256 age, bool verified"
302
+ attestify ai "Create an attestation for 0x0F1A... using schema 0x7408..."
303
+ ```
304
+
305
+ ### Interactive REPL Mode
306
+
307
+ ```bash
308
+ # Omit the message argument to enter interactive mode
309
+ attestify ai
310
+
311
+ # [Attestify AI] Agent initialized with 17 tools
312
+ # Interactive mode — type your message and press Enter. Type "exit" to quit.
313
+ #
314
+ # You: What schemas are registered?
315
+ # Agent: Found 3 schema(s):
316
+ # 0x7408a93f... — string name, uint256 age, bool verified
317
+ # 0xbc72d396... — string documentType, address issuer
318
+ # ...
319
+ #
320
+ # You: exit
321
+ # Goodbye!
322
+ ```
323
+
324
+ ### AI Options
325
+
326
+ ```bash
327
+ # Use a different model
328
+ attestify ai --model gpt-4o "Explain the attestation with UID 0xbc72d396..."
329
+
330
+ # JSON output (one-shot only)
331
+ attestify --json ai "List all authorities"
332
+ ```
333
+
334
+ ---
335
+
69
336
  ## JSON Output
70
337
 
71
- Use `--json` for machine-readable output:
338
+ Use `--json` for machine-readable output on any command:
72
339
 
73
340
  ```bash
74
341
  attestify schema fetch --uid 0xabc123... --json
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@attestify/cli",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "Attestify CLI — command-line tool for the Hedera attestation protocol",
5
5
  "bin": {
6
6
  "attestify": "./dist/index.js"
@@ -19,7 +19,7 @@
19
19
  "test:watch": "vitest"
20
20
  },
21
21
  "dependencies": {
22
- "@attestify/sdk": "^0.1.0",
22
+ "@attestify/sdk": "^0.1.1",
23
23
  "commander": "^12.1.0",
24
24
  "dotenv": "^16.4.5",
25
25
  "@langchain/core": "^0.3.0",