@sol-merrai/cli 0.1.0 → 0.1.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.
Files changed (2) hide show
  1. package/README.md +56 -16
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,11 +1,20 @@
1
- # @merrai/cli
1
+ # Merrai CLI
2
2
 
3
- CLI package for calling the Merrai oRPC API over HTTP.
3
+ Command-line client for sending memories to Merrai and calling the Merrai API
4
+ with a personal API key.
5
+
6
+ The npm package is published as `@sol-merrai/cli`; the installed command is
7
+ `merrai`.
8
+
9
+ ## Installation
10
+
11
+ ```bash
12
+ npm install -g @sol-merrai/cli
13
+ ```
4
14
 
5
15
  ## Usage
6
16
 
7
17
  ```bash
8
- npm install -g @merrai/cli
9
18
  merrai health
10
19
  merrai session --api-key "merrai_..."
11
20
  merrai memories --api-key "merrai_..."
@@ -15,14 +24,35 @@ merrai rpc healthCheck
15
24
 
16
25
  ## Configuration
17
26
 
18
- - `packages/cli/.env`
19
- - `packages/cli/.env.prod` when `MERRAI_ENV=prod` or `NODE_ENV=production`
20
- - `packages/cli/.env.local` as the final override
21
- - `--base-url` or `MERRAI_BASE_URL`
22
- - `--api-key` or `MERRAI_API_KEY`
23
- - `--cookie` or `MERRAI_COOKIE`
27
+ You can pass settings as flags:
28
+
29
+ ```bash
30
+ merrai memories --base-url "https://api.example.com" --api-key "merrai_..."
31
+ ```
32
+
33
+ Or use environment variables:
34
+
35
+ ```bash
36
+ export MERRAI_BASE_URL="https://api.example.com"
37
+ export MERRAI_API_KEY="merrai_..."
38
+
39
+ merrai memories
40
+ ```
41
+
42
+ Supported variables:
43
+
44
+ - `MERRAI_BASE_URL`: Merrai API base URL.
45
+ - `MERRAI_API_KEY`: Personal API key. Sent as the `x-api-key` header.
46
+ - `MERRAI_COOKIE`: Optional session cookie fallback.
47
+
48
+ When running from a checked-out repository, the CLI also loads package-local env
49
+ files in this order:
50
+
51
+ - `.env`
52
+ - `.env.prod` when `MERRAI_ENV=prod` or `NODE_ENV=production`
53
+ - `.env.local` as the final override
24
54
 
25
- Example `packages/cli/.env`:
55
+ Example `.env`:
26
56
 
27
57
  ```bash
28
58
  MERRAI_BASE_URL=http://localhost:3000
@@ -30,10 +60,10 @@ MERRAI_API_KEY=
30
60
  MERRAI_COOKIE=
31
61
  ```
32
62
 
33
- Example `packages/cli/.env.prod`:
63
+ Example `.env.prod`:
34
64
 
35
65
  ```bash
36
- MERRAI_BASE_URL=https://api.example.com
66
+ MERRAI_BASE_URL=https://api.merrai.app
37
67
  MERRAI_API_KEY=
38
68
  MERRAI_COOKIE=
39
69
  ```
@@ -44,12 +74,22 @@ Use it with:
44
74
  MERRAI_ENV=prod merrai memories
45
75
  ```
46
76
 
47
- Protected procedures support either:
77
+ ## Authentication
48
78
 
49
- - `x-api-key` auth via `--api-key` / `MERRAI_API_KEY`
50
- - session cookie auth via `--cookie` / `MERRAI_COOKIE`
79
+ Protected commands support either:
80
+
81
+ - API key auth via `--api-key` or `MERRAI_API_KEY`.
82
+ - Session cookie auth via `--cookie` or `MERRAI_COOKIE`.
83
+
84
+ API keys are the recommended option for CLI usage.
85
+
86
+ ## Memory Lobes
51
87
 
52
88
  For `add-memory`, use `--lobe <name>` to keep memories separated by lobe. The
53
89
  legacy `--lobe-key` flag still works.
54
90
 
55
- Load order is `.env`, then `.env.prod` in prod mode, then `.env.local`.
91
+ ```bash
92
+ merrai add-memory \
93
+ --memory "Met Sarah at lunch" \
94
+ --lobe people
95
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sol-merrai/cli",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Command-line client for Merrai",
5
5
  "bin": {
6
6
  "merrai": "dist/cli.mjs"