@agentmanifest/cli 0.1.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.md ADDED
@@ -0,0 +1,477 @@
1
+ # @agentmanifest/cli
2
+
3
+ Official CLI tool for the Agent Manifest Protocol (AMP). Create, validate, and publish API manifests that enable AI agents to discover and interact with your data APIs.
4
+
5
+ ## Installation
6
+
7
+ ### Global Installation (Recommended)
8
+
9
+ ```bash
10
+ npm install -g @agentmanifest/cli
11
+ ```
12
+
13
+ After installation, the `amp` command will be available globally.
14
+
15
+ ### Local Installation
16
+
17
+ ```bash
18
+ npm install @agentmanifest/cli
19
+ npx amp --help
20
+ ```
21
+
22
+ ## Requirements
23
+
24
+ - Node.js 18.0.0 or higher
25
+ - npm or yarn
26
+
27
+ ## Commands
28
+
29
+ ### `amp init`
30
+
31
+ Interactively create a new `agent-manifest.json` file in the current directory.
32
+
33
+ ```bash
34
+ amp init
35
+ ```
36
+
37
+ This command walks you through all required fields defined in the AMP v0.1 specification:
38
+
39
+ - **Basic Information**: Name, version, description, URLs
40
+ - **Categories**: Primary and secondary categories from controlled vocabulary
41
+ - **Endpoints**: API endpoints with methods, parameters, and responses
42
+ - **Pricing**: Free, usage-based, or subscription models
43
+ - **Authentication**: None, API key, OAuth2, or bearer token
44
+ - **Rate Limits**: Request limits per minute/day (optional)
45
+ - **Reliability**: Uptime and response time metrics (optional)
46
+ - **Contact**: Support email, URLs, GitHub (optional)
47
+ - **Agent Notes**: Implementation guidance for AI agents (min 50 chars)
48
+
49
+ The generated manifest will be saved as `agent-manifest.json` in your current directory.
50
+
51
+ #### Example Session
52
+
53
+ ```bash
54
+ $ amp init
55
+
56
+ 🚀 Agent Manifest Protocol - Interactive Setup
57
+
58
+ 📋 Basic Information
59
+ ? API name: Chemistry Calculator API
60
+ ? Version (semantic versioning): 1.0.0
61
+ ? Description (min 100 characters): A comprehensive chemistry API providing molecular calculations, compound information, and reaction predictions for AI agents working with chemical data
62
+ ? Homepage URL (optional): https://api.chemcalc.com
63
+ ? Documentation URL (optional): https://docs.chemcalc.com
64
+
65
+ 🏷️ Categories
66
+ ? Select categories: chemistry, education
67
+ ? Select primary category: chemistry
68
+
69
+ 🔌 Endpoints
70
+ ? Endpoint path: /calculate/molar-mass
71
+ ? HTTP method: POST
72
+ ? Endpoint description: Calculate molar mass of chemical compounds
73
+ ? Response description: Returns molar mass in g/mol with compound details
74
+ ? Add parameters to this endpoint? Yes
75
+ ...
76
+
77
+ ✅ Success!
78
+ Manifest created at: /path/to/agent-manifest.json
79
+ ```
80
+
81
+ ---
82
+
83
+ ### `amp validate`
84
+
85
+ Validate your `agent-manifest.json` file against the AMP specification.
86
+
87
+ ```bash
88
+ amp validate [options]
89
+ ```
90
+
91
+ #### Options
92
+
93
+ - `-f, --file <path>` - Path to manifest file (default: `./agent-manifest.json`)
94
+
95
+ #### Examples
96
+
97
+ ```bash
98
+ # Validate manifest in current directory
99
+ amp validate
100
+
101
+ # Validate specific file
102
+ amp validate -f ./my-manifest.json
103
+
104
+ # Validate manifest in subdirectory
105
+ amp validate -f ./api/agent-manifest.json
106
+ ```
107
+
108
+ #### Output
109
+
110
+ **Successful validation:**
111
+
112
+ ```bash
113
+ $ amp validate
114
+
115
+ 🔍 Validating Agent Manifest
116
+
117
+ File: /path/to/agent-manifest.json
118
+
119
+ Sending to validator API...
120
+ ✅ Validation Passed
121
+
122
+ Your manifest is compliant with AMP specification v0.1
123
+
124
+ Next step: Run "amp publish" to submit to registry
125
+ ```
126
+
127
+ **Failed validation:**
128
+
129
+ ```bash
130
+ $ amp validate
131
+
132
+ 🔍 Validating Agent Manifest
133
+
134
+ File: /path/to/agent-manifest.json
135
+
136
+ Sending to validator API...
137
+ ❌ Validation Failed
138
+
139
+ Errors:
140
+ 1. description: Must be at least 100 characters (currently 45)
141
+ 2. primary_category: Must be one of the categories in the categories array
142
+ 3. agent_notes: Must be at least 50 characters (currently 20)
143
+
144
+ Please fix the errors and try again.
145
+ ```
146
+
147
+ ---
148
+
149
+ ### `amp publish`
150
+
151
+ Validate and publish your manifest to the AMP registry.
152
+
153
+ ```bash
154
+ amp publish [options]
155
+ ```
156
+
157
+ #### Options
158
+
159
+ - `-f, --file <path>` - Path to manifest file (default: `./agent-manifest.json`)
160
+
161
+ #### How It Works
162
+
163
+ 1. **Validation**: First validates your manifest against the AMP specification
164
+ 2. **Homepage Check**: Ensures your manifest includes a homepage URL (where `/.well-known/agent-manifest.json` is hosted)
165
+ 3. **Submission**: Submits your API to the public registry at `https://agent-manifest.com`
166
+
167
+ #### Examples
168
+
169
+ ```bash
170
+ # Publish manifest in current directory
171
+ amp publish
172
+
173
+ # Publish specific file
174
+ amp publish -f ./my-manifest.json
175
+ ```
176
+
177
+ #### Output
178
+
179
+ **Successful publication:**
180
+
181
+ ```bash
182
+ $ amp publish
183
+
184
+ 📤 Publishing Agent Manifest
185
+
186
+ File: /path/to/agent-manifest.json
187
+
188
+ Step 1/2: Validating manifest...
189
+ ✓ Validation passed
190
+ Step 2/2: Submitting to registry...
191
+
192
+ ✅ Successfully Published!
193
+
194
+ Listing ID: lst_abc123xyz
195
+ View at: https://agent-manifest.com/listings/lst_abc123xyz
196
+
197
+ Your API is now discoverable in the AMP registry!
198
+ AI agents can find and use your API through:
199
+ https://api.example.com/.well-known/agent-manifest.json
200
+ ```
201
+
202
+ **Failed publication:**
203
+
204
+ ```bash
205
+ $ amp publish
206
+
207
+ 📤 Publishing Agent Manifest
208
+
209
+ Step 1/2: Validating manifest...
210
+ ❌ Validation Failed
211
+
212
+ Errors:
213
+ 1. description: Must be at least 100 characters
214
+
215
+ Please fix the errors and try again.
216
+ Run "amp validate" for detailed validation output.
217
+ ```
218
+
219
+ ---
220
+
221
+ ## Workflow
222
+
223
+ ### Complete Setup Flow
224
+
225
+ ```bash
226
+ # 1. Create a new manifest interactively
227
+ amp init
228
+
229
+ # 2. Review the generated file
230
+ cat agent-manifest.json
231
+
232
+ # 3. Validate the manifest
233
+ amp validate
234
+
235
+ # 4. Host the manifest at your API's /.well-known/agent-manifest.json endpoint
236
+
237
+ # 5. Publish to the registry
238
+ amp publish
239
+ ```
240
+
241
+ ---
242
+
243
+ ## Manifest Schema (v0.1)
244
+
245
+ ### Required Fields
246
+
247
+ - `spec_version`: Always `"agentmanifest-0.1"`
248
+ - `name`: API name (string)
249
+ - `version`: Semantic version (e.g., "1.0.0")
250
+ - `description`: Min 100 characters
251
+ - `categories`: Array of categories
252
+ - `primary_category`: Must be in categories array
253
+ - `endpoints`: At least one endpoint required
254
+ - `pricing.model`: "free", "usage_based", or "subscription"
255
+ - `authentication.type`: "none", "api_key", "oauth2", or "bearer"
256
+ - `agent_notes`: Min 50 characters - guidance for AI agents
257
+
258
+ ### Standard Categories
259
+
260
+ ```
261
+ chemistry, biology, physics, mathematics, finance, weather,
262
+ geography, food_science, engineering, legal, medical,
263
+ education, translation, media, general
264
+ ```
265
+
266
+ ### Example Manifest
267
+
268
+ ```json
269
+ {
270
+ "spec_version": "agentmanifest-0.1",
271
+ "name": "Weather Data API",
272
+ "version": "2.1.0",
273
+ "description": "Real-time weather data and forecasts for locations worldwide. Provides current conditions, hourly forecasts, and historical weather data with high accuracy and global coverage.",
274
+ "homepage": "https://api.weather-data.com",
275
+ "documentation": "https://docs.weather-data.com",
276
+ "categories": ["weather", "geography"],
277
+ "primary_category": "weather",
278
+ "endpoints": [
279
+ {
280
+ "path": "/current",
281
+ "method": "GET",
282
+ "description": "Get current weather conditions for a location",
283
+ "parameters": {
284
+ "query": {
285
+ "location": {
286
+ "type": "string",
287
+ "required": true,
288
+ "description": "City name or coordinates (lat,lon)"
289
+ }
290
+ }
291
+ },
292
+ "response": {
293
+ "type": "object",
294
+ "description": "Current weather data including temperature, conditions, and metadata"
295
+ }
296
+ }
297
+ ],
298
+ "pricing": {
299
+ "model": "usage_based",
300
+ "details": "First 1000 requests free per month, then $0.001 per request"
301
+ },
302
+ "authentication": {
303
+ "type": "api_key",
304
+ "config": {
305
+ "header": "X-API-Key",
306
+ "signup_url": "https://api.weather-data.com/signup"
307
+ }
308
+ },
309
+ "rate_limits": {
310
+ "requests_per_minute": 60,
311
+ "requests_per_day": 10000
312
+ },
313
+ "reliability_metrics": {
314
+ "uptime_percentage": 99.9,
315
+ "avg_response_time_ms": 150
316
+ },
317
+ "contact": {
318
+ "email": "support@weather-data.com",
319
+ "support_url": "https://support.weather-data.com"
320
+ },
321
+ "agent_notes": "Use the 'location' parameter with city names for simplicity. Coordinates provide more precise results. Response includes semantic metadata to help interpret weather conditions.",
322
+ "listing_requested": true,
323
+ "last_updated": "2026-02-15T10:30:00Z"
324
+ }
325
+ ```
326
+
327
+ ---
328
+
329
+ ## Validation Rules
330
+
331
+ The validator checks for:
332
+
333
+ 1. **Spec Version**: Must be `"agentmanifest-0.1"`
334
+ 2. **Semantic Versioning**: Version must follow `x.y.z` format
335
+ 3. **Description Length**: Minimum 100 characters
336
+ 4. **Agent Notes Length**: Minimum 50 characters
337
+ 5. **Category Consistency**: Primary category must be in categories array
338
+ 6. **Endpoints**: At least one endpoint required
339
+ 7. **Valid URLs**: All URLs must be HTTPS
340
+ 8. **Required Fields**: All mandatory fields present
341
+ 9. **Type Validation**: Fields match expected types
342
+
343
+ ---
344
+
345
+ ## API Endpoints
346
+
347
+ ### Validator API
348
+
349
+ **POST** `https://validator.agent-manifest.com/validate`
350
+
351
+ Request body:
352
+ ```json
353
+ {
354
+ "manifest": { /* your manifest object */ }
355
+ }
356
+ ```
357
+
358
+ Response:
359
+ ```json
360
+ {
361
+ "valid": true,
362
+ "errors": [],
363
+ "warnings": []
364
+ }
365
+ ```
366
+
367
+ ### Registry API
368
+
369
+ **POST** `https://agent-manifest.com/listings/submit`
370
+
371
+ Request body:
372
+ ```json
373
+ {
374
+ "url": "https://api.example.com",
375
+ "manifest": { /* your manifest object */ }
376
+ }
377
+ ```
378
+
379
+ Response:
380
+ ```json
381
+ {
382
+ "success": true,
383
+ "listing_id": "lst_abc123",
384
+ "url": "https://agent-manifest.com/listings/lst_abc123"
385
+ }
386
+ ```
387
+
388
+ ---
389
+
390
+ ## Troubleshooting
391
+
392
+ ### "File Not Found" Error
393
+
394
+ ```bash
395
+ ❌ File Not Found
396
+ Could not find manifest file at: /path/to/agent-manifest.json
397
+
398
+ Run "amp init" to create a new manifest.
399
+ ```
400
+
401
+ **Solution**: Make sure you're in the correct directory or use the `-f` flag to specify the path.
402
+
403
+ ### "Invalid JSON" Error
404
+
405
+ ```bash
406
+ ❌ Invalid JSON
407
+ The manifest file contains invalid JSON syntax.
408
+ ```
409
+
410
+ **Solution**: Check your JSON syntax. Common issues include:
411
+ - Trailing commas
412
+ - Missing quotes around strings
413
+ - Unescaped special characters
414
+ - Mismatched brackets
415
+
416
+ ### "Connection Error"
417
+
418
+ ```bash
419
+ ❌ Connection Error
420
+ Could not connect to validator API.
421
+ ```
422
+
423
+ **Solution**: Check your internet connection and try again. The validator and registry services may be temporarily unavailable.
424
+
425
+ ### Validation Errors
426
+
427
+ If you get validation errors, review the error messages carefully. Common issues:
428
+
429
+ - **Description too short**: Must be at least 100 characters
430
+ - **Agent notes too short**: Must be at least 50 characters
431
+ - **Invalid version**: Must follow semantic versioning (e.g., "1.0.0")
432
+ - **Category mismatch**: Primary category must be in your categories array
433
+ - **Missing endpoints**: At least one endpoint required
434
+
435
+ ---
436
+
437
+ ## Resources
438
+
439
+ - **Specification**: [Agent Manifest Protocol Docs](https://agent-manifest.com/docs)
440
+ - **Registry**: [Browse AMP-compliant APIs](https://agent-manifest.com/listings)
441
+ - **GitHub**: [AMProtocol Organization](https://github.com/AMProtocol)
442
+ - **Reference Implementation**: [BakeBase API](https://github.com/AMProtocol/BakeBase)
443
+
444
+ ---
445
+
446
+ ## Contributing
447
+
448
+ Contributions are welcome! Please visit our [GitHub repository](https://github.com/AMProtocol/amp-cli) to:
449
+
450
+ - Report bugs
451
+ - Suggest features
452
+ - Submit pull requests
453
+
454
+ ---
455
+
456
+ ## License
457
+
458
+ MIT License - See [LICENSE](LICENSE) file for details
459
+
460
+ ---
461
+
462
+ ## Support
463
+
464
+ - **Email**: brandon@agent-manifest.com
465
+ - **GitHub Issues**: [amp-cli/issues](https://github.com/AMProtocol/amp-cli/issues)
466
+ - **Website**: [agent-manifest.com](https://agent-manifest.com)
467
+
468
+ ---
469
+
470
+ ## About
471
+
472
+ The Agent Manifest Protocol is an open standard for API metadata that enables AI agents to dynamically discover, evaluate, and compensate data APIs at runtime. Created by Brandon Weber ([@brandon-weber](https://github.com/brandon-weber)).
473
+
474
+ **Vision**: Building infrastructure for the AI agent data economy where:
475
+ - Phase 1 (Current): Discovery and manual compensation
476
+ - Phase 2: Automated clearinghouse settlement
477
+ - Phase 3: Domain-expert ecosystem for monetizing specialized knowledge
@@ -0,0 +1,2 @@
1
+ export declare function initCommand(): Promise<void>;
2
+ //# sourceMappingURL=init.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAOA,wBAAsB,WAAW,kBA6chC"}