Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/feat-cn-subcommand.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"cvmi": minor
---

Introduced the `cn` sub-command, including `init`, `add`, and `update` commands. Ported and adapted tests for the cn module, stabilized the integration testing environment, and updated corresponding documentation in README and AGENTS roadmap.
2 changes: 2 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ This file provides guidance to AI coding agents working on the `cvmi` CLI codeba
| `cvmi add <pkg>` | Install skills from git repos, URLs, or local paths |
| `cvmi check` | Check for available skill updates |
| `cvmi update` | Update all skills to latest versions |
| `cvmi pn` / `cn` | Compile a server to TypeScript code |
| `cvmi generate-lock` | Match installed skills to sources via API |

Aliases: `cvmi a`, `cvmi i`, `cvmi install` all work for `add`.
Expand All @@ -26,6 +27,7 @@ src/
├── cli.test.ts # CLI tests
├── add.ts # Core add command logic
├── add.test.ts # Add command tests
├── cn/ # Client generation (ctxcn) module
├── list.ts # List installed skills command
├── list.test.ts # List command tests
├── agents.ts # Agent definitions and detection
Expand Down
22 changes: 21 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ npx cvmi add --skill overview
- [x] `cvmi serve` - Expose a server (gateway)
- [x] `cvmi use` - Use a server from nostr as stdio (proxy)
- [x] `cvmi discover` - Discover announced servers on relays
- [ ] `cvmi cn` - Compile a server to code (ctxcn)
- [x] `cvmi cn` - Compile a server to code (ctxcn)
- [x] `cvmi call` - Call methods from a server
- [ ] `cvmi inspect` - Inspect server schema

Expand Down Expand Up @@ -122,6 +122,26 @@ cvmi call weather tool:weather.get_current city=Lisbon
cvmi call weather tool:weather.get_current city=Lisbon --config ./custom.cvmi.json
```

### `cvmi cn`

[`cvmi cn`](src/cn/index.ts) is fully integrated into `cvmi` (formerly `ctxcn`). It allows you to generate type-safe TypeScript clients directly from a Nostr MCP server.

Examples:

```bash
# Initialize a new client generation environment
cvmi cn init

# Connect to a server and generate client code
cvmi cn add <pubkey>

# Update client code for a specific server
cvmi cn update <pubkey>

# Update all existing clients
cvmi cn update
```

### `cvmi discover`

[`cvmi discover`](src/discover.ts) queries relay-stored server announcement events so you can find public ContextVM servers before using [`cvmi call`](src/call.ts:329).
Expand Down
932 changes: 0 additions & 932 deletions bun.lock

This file was deleted.

6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
],
"scripts": {
"build": "obuild",
"dev": "node src/cli.ts",
"exec:test": "node scripts/execute-tests.ts",
"dev": "tsx src/cli.ts",
"exec:test": "tsx scripts/execute-tests.ts",
"prepublishOnly": "npm run build",
"format": "prettier --write .",
"format:check": "prettier --check .",
Expand Down Expand Up @@ -95,6 +95,7 @@
"dependencies": {
"@contextvm/sdk": "^0.8.0",
"@modelcontextprotocol/sdk": "^1.27.1",
"json-schema-to-typescript": "15.0.4",
"nostr-tools": "^2.23.3",
"xdg-basedir": "^5.1.0",
"zod": "^4.3.6"
Expand All @@ -111,6 +112,7 @@
"picocolors": "^1.1.1",
"prettier": "^3.8.1",
"simple-git": "^3.33.0",
"tsx": "^4.21.0",
"typescript": "^5.9.3",
"vitest": "^4.1.0"
},
Expand Down
Loading
Loading