@magicpages/ghost-typesense-cli 1.0.1 → 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.
Files changed (2) hide show
  1. package/README.md +26 -56
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @magicpages/ghost-typesense-cli
2
2
 
3
- A command-line interface for managing Ghost content in Typesense. This tool provides commands for initializing collections, syncing content, and maintaining your search index.
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
- The CLI provides three main commands:
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-typesense-api-key",
57
- "connectionTimeoutSeconds": 10,
58
- "retryIntervalSeconds": 0.1
27
+ "apiKey": "your-admin-api-key"
59
28
  },
60
29
  "collection": {
61
- "name": "posts",
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
- ## Field Configuration
35
+ 2. Available commands:
79
36
 
80
- The `fields` array in your configuration defines the schema for your Typesense collection. Each field object supports:
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
- - `name` (required): Field name
83
- - `type` (required): Data type (`string`, `int32`, `int64`, `float`, `bool`, `string[]`, etc.)
84
- - `index` (optional): Whether the field is searchable
85
- - `sort` (optional): Whether the field can be used for sorting
86
- - `facet` (optional): Whether the field can be used for faceted search
87
- - `optional` (optional): Whether the field is required
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 - see the [LICENSE](../../LICENSE) file for details.
61
+ MIT © [MagicPages](https://www.magicpages.co)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@magicpages/ghost-typesense-cli",
3
- "version": "1.0.1",
3
+ "version": "1.1.1",
4
4
  "description": "CLI tool for managing Ghost content in Typesense",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",