@magicpages/ghost-typesense-cli 1.1.0 → 1.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 +26 -56
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @magicpages/ghost-typesense-cli
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Command-line tool for managing Ghost content in Typesense.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
@@ -10,36 +10,7 @@ npm install -g @magicpages/ghost-typesense-cli
|
|
|
10
10
|
|
|
11
11
|
## Usage
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
### Initialize Collection
|
|
16
|
-
|
|
17
|
-
Creates or recreates the Typesense collection with the specified schema:
|
|
18
|
-
|
|
19
|
-
```bash
|
|
20
|
-
ghost-typesense init --config ./ghost-typesense.config.json
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
### Sync Content
|
|
24
|
-
|
|
25
|
-
Performs a full sync of all Ghost content to Typesense:
|
|
26
|
-
|
|
27
|
-
```bash
|
|
28
|
-
ghost-typesense sync --config ./ghost-typesense.config.json
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
### Clear Collection
|
|
32
|
-
|
|
33
|
-
Removes all documents from the Typesense collection:
|
|
34
|
-
|
|
35
|
-
```bash
|
|
36
|
-
ghost-typesense clear --config ./ghost-typesense.config.json
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
## Configuration
|
|
40
|
-
|
|
41
|
-
Create a `ghost-typesense.config.json` file in your project:
|
|
42
|
-
|
|
13
|
+
1. Create `ghost-typesense.config.json`:
|
|
43
14
|
```json
|
|
44
15
|
{
|
|
45
16
|
"ghost": {
|
|
@@ -53,39 +24,38 @@ Create a `ghost-typesense.config.json` file in your project:
|
|
|
53
24
|
"port": 443,
|
|
54
25
|
"protocol": "https"
|
|
55
26
|
}],
|
|
56
|
-
"apiKey": "your-
|
|
57
|
-
"connectionTimeoutSeconds": 10,
|
|
58
|
-
"retryIntervalSeconds": 0.1
|
|
27
|
+
"apiKey": "your-admin-api-key"
|
|
59
28
|
},
|
|
60
29
|
"collection": {
|
|
61
|
-
"name": "
|
|
62
|
-
"fields": [
|
|
63
|
-
{ "name": "id", "type": "string" },
|
|
64
|
-
{ "name": "title", "type": "string", "index": true, "sort": true },
|
|
65
|
-
{ "name": "slug", "type": "string", "index": true },
|
|
66
|
-
{ "name": "html", "type": "string", "index": true },
|
|
67
|
-
{ "name": "excerpt", "type": "string", "index": true },
|
|
68
|
-
{ "name": "feature_image", "type": "string", "index": false, "optional": true },
|
|
69
|
-
{ "name": "published_at", "type": "int64", "sort": true },
|
|
70
|
-
{ "name": "updated_at", "type": "int64", "sort": true },
|
|
71
|
-
{ "name": "tags", "type": "string[]", "facet": true, "optional": true },
|
|
72
|
-
{ "name": "authors", "type": "string[]", "facet": true, "optional": true }
|
|
73
|
-
]
|
|
30
|
+
"name": "ghost"
|
|
74
31
|
}
|
|
75
32
|
}
|
|
76
33
|
```
|
|
77
34
|
|
|
78
|
-
|
|
35
|
+
2. Available commands:
|
|
79
36
|
|
|
80
|
-
|
|
37
|
+
```bash
|
|
38
|
+
# Initialize collection
|
|
39
|
+
ghost-typesense init --config ghost-typesense.config.json
|
|
40
|
+
|
|
41
|
+
# Sync all posts
|
|
42
|
+
ghost-typesense sync --config ghost-typesense.config.json
|
|
43
|
+
|
|
44
|
+
# Clear collection
|
|
45
|
+
ghost-typesense clear --config ghost-typesense.config.json
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Configuration
|
|
81
49
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
50
|
+
| Option | Description |
|
|
51
|
+
|--------|-------------|
|
|
52
|
+
| `ghost.url` | Your Ghost blog URL |
|
|
53
|
+
| `ghost.key` | Content API key |
|
|
54
|
+
| `ghost.version` | Ghost API version |
|
|
55
|
+
| `typesense.nodes` | Array of Typesense nodes |
|
|
56
|
+
| `typesense.apiKey` | Admin API key |
|
|
57
|
+
| `collection.name` | Collection name |
|
|
88
58
|
|
|
89
59
|
## License
|
|
90
60
|
|
|
91
|
-
MIT
|
|
61
|
+
MIT © [MagicPages](https://www.magicpages.co)
|