@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.
- package/README.md +56 -16
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,11 +1,20 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Merrai CLI
|
|
2
2
|
|
|
3
|
-
|
|
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
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
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
|
|
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
|
|
63
|
+
Example `.env.prod`:
|
|
34
64
|
|
|
35
65
|
```bash
|
|
36
|
-
MERRAI_BASE_URL=https://api.
|
|
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
|
-
|
|
77
|
+
## Authentication
|
|
48
78
|
|
|
49
|
-
|
|
50
|
-
|
|
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
|
-
|
|
91
|
+
```bash
|
|
92
|
+
merrai add-memory \
|
|
93
|
+
--memory "Met Sarah at lunch" \
|
|
94
|
+
--lobe people
|
|
95
|
+
```
|