@vertesia/memory-cli 0.80.0-dev-20251118 → 0.80.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.
Files changed (2) hide show
  1. package/README.md +94 -14
  2. package/package.json +45 -45
package/README.md CHANGED
@@ -1,32 +1,112 @@
1
- # Composable Prompts CLI
1
+ # @vertesia/memory-cli
2
2
 
3
- # Composite Prompts CLI
3
+ A command-line tool for building and managing Vertesia memory packs. Memory packs are archives containing structured data for LLM context.
4
4
 
5
- This is a command line application that can be used to access your composable prompts projects.
6
- It was designed to fulfil the following main use cases:
5
+ ## Features
7
6
 
8
- * List and switch between your Composable Prompts projects
9
- * List the existing interactions and execution environments
10
- * Run interactions once or multiple times over a set of different data inputs.
11
- * Generate data inputs to run the interactions against.
12
- * Search through the history of runs to inspect detailed results.
7
+ - **Build Memory Packs**: Create memory archives from recipe scripts
8
+ - **Export Data**: Extract JSON objects from memory packs using mappings
9
+ - **Gzip Compression**: Optionally compress output files
10
+ - **Custom Variables**: Pass variables to recipe scripts via command line
13
11
 
14
12
  ## Requirements
15
13
 
16
- A TTY terminal and Node.js version 18 or higher is required.
14
+ Node.js version 18 or higher is required.
17
15
 
18
16
  ## Installation
19
17
 
20
18
  ```bash
21
- npm -g install @vertesia/cli
19
+ npm install -g @vertesia/memory-cli
20
+ # or
21
+ pnpm add -g @vertesia/memory-cli
22
22
  ```
23
23
 
24
- ## Basic Usage
24
+ ## Usage
25
+
26
+ ### Build a Memory Pack
27
+
28
+ Build a memory pack from a recipe script:
29
+
30
+ ```bash
31
+ memo build <recipe>
32
+ ```
33
+
34
+ #### Options
35
+
36
+ | Option | Description |
37
+ |--------|-------------|
38
+ | `-o, --out <file>` | Output file (default: `memory.tar`) |
39
+ | `-z, --gzip` | Compress output with gzip |
40
+ | `-i, --indent <spaces>` | JSON indentation (default: 2) |
41
+ | `-q, --quiet` | Suppress console output |
42
+ | `-t, --test` | Test recipe without building |
43
+
44
+ #### Passing Variables
45
+
46
+ Pass custom variables to your recipe script using `--var-<name>`:
47
+
48
+ ```bash
49
+ memo build recipe.ts --var-version 1.0.0 --var-env production
50
+ ```
51
+
52
+ Variables are available in your recipe script via the `vars` object.
53
+
54
+ ### Export from Memory Pack
55
+
56
+ Export a JSON object from a memory pack using a mapping:
57
+
58
+ ```bash
59
+ memo export <pack> --map <mapping>
60
+ ```
61
+
62
+ #### Examples
25
63
 
26
64
  ```bash
27
- composable help
65
+ # Export with inline JSON mapping
66
+ memo export memory.tar --map '{"title": "$.metadata.title", "content": "$.files[0].content"}'
67
+
68
+ # Export with mapping file
69
+ memo export memory.tar --map @mapping.json
70
+
71
+ # Export with custom indentation
72
+ memo export memory.tar --map @mapping.json --indent 4
73
+ ```
74
+
75
+ ## Recipe Scripts
76
+
77
+ Recipe scripts are TypeScript files that define how to build a memory pack. They use the `@vertesia/memory` API to collect and structure data.
78
+
79
+ Example recipe (`recipe.ts`):
80
+
81
+ ```typescript
82
+ import { MemoryBuilder } from '@vertesia/memory';
83
+
84
+ const builder = new MemoryBuilder();
85
+
86
+ // Add files, metadata, and structured data
87
+ builder.addFile('README.md', readFileSync('README.md'));
88
+ builder.setMetadata({ version: vars.version });
89
+
90
+ export default builder;
91
+ ```
92
+
93
+ ## API
94
+
95
+ The CLI can also be used programmatically:
96
+
97
+ ```typescript
98
+ import { setupMemoCommand } from '@vertesia/memory-cli';
99
+ import { Command } from 'commander';
100
+
101
+ const program = new Command();
102
+ setupMemoCommand(program);
103
+ program.parse();
28
104
  ```
29
105
 
30
106
  ## Documentation
31
107
 
32
- See https://docs.becomposable.com/cli
108
+ See [Vertesia Documentation](https://docs.vertesiahq.com)
109
+
110
+ ## License
111
+
112
+ Apache-2.0
package/package.json CHANGED
@@ -1,46 +1,46 @@
1
1
  {
2
- "name": "@vertesia/memory-cli",
3
- "description": "Vertesia memory builder CLI",
4
- "version": "0.80.0-dev-20251118",
5
- "type": "module",
6
- "bin": {
7
- "memo": "./bin/memo.js"
8
- },
9
- "main": "./lib/index.js",
10
- "types": "./lib/index.d.ts",
11
- "files": [
12
- "lib",
13
- "bin"
14
- ],
15
- "license": "Apache-2.0",
16
- "homepage": "https://docs.vertesiahq.com",
17
- "keywords": [
18
- "llm",
19
- "code",
20
- "generation",
21
- "interaction",
22
- "composable",
23
- "prompt",
24
- "ai"
25
- ],
26
- "scripts": {
27
- "eslint": "eslint './src/**/*.{jsx,js,tsx,ts}'",
28
- "build": "rm -rf ./lib ./tsconfig.tsbuildinfo && tsc --build",
29
- "clean": "rimraf ./node_modules ./lib ./tsconfig.tsbuildinfo"
30
- },
31
- "dependencies": {
32
- "@vertesia/memory": "workspace:*",
33
- "@vertesia/memory-commands": "workspace:*",
34
- "commander": "^12.1.0"
35
- },
36
- "devDependencies": {
37
- "@types/node": "^22.5.1",
38
- "typescript": "^5.0.2",
39
- "vitest": "^3.1.1"
40
- },
41
- "repository": {
42
- "type": "git",
43
- "url": "https://github.com/vertesia/composableai.git",
44
- "directory": "packages/memory-cli"
45
- }
46
- }
2
+ "name": "@vertesia/memory-cli",
3
+ "description": "Vertesia memory builder CLI",
4
+ "version": "0.80.0",
5
+ "type": "module",
6
+ "bin": {
7
+ "memo": "./bin/memo.js"
8
+ },
9
+ "main": "./lib/index.js",
10
+ "types": "./lib/index.d.ts",
11
+ "files": [
12
+ "lib",
13
+ "bin"
14
+ ],
15
+ "license": "Apache-2.0",
16
+ "homepage": "https://docs.vertesiahq.com",
17
+ "keywords": [
18
+ "vertesia",
19
+ "memory",
20
+ "cli",
21
+ "llm",
22
+ "ai",
23
+ "context",
24
+ "typescript"
25
+ ],
26
+ "dependencies": {
27
+ "commander": "^12.1.0",
28
+ "@vertesia/memory": "0.80.0",
29
+ "@vertesia/memory-commands": "0.80.0"
30
+ },
31
+ "devDependencies": {
32
+ "@types/node": "^22.5.1",
33
+ "typescript": "^5.0.2",
34
+ "vitest": "^3.1.1"
35
+ },
36
+ "repository": {
37
+ "type": "git",
38
+ "url": "https://github.com/vertesia/composableai.git",
39
+ "directory": "packages/memory-cli"
40
+ },
41
+ "scripts": {
42
+ "eslint": "eslint './src/**/*.{jsx,js,tsx,ts}'",
43
+ "build": "rm -rf ./lib ./tsconfig.tsbuildinfo && tsc --build",
44
+ "clean": "rimraf ./node_modules ./lib ./tsconfig.tsbuildinfo"
45
+ }
46
+ }