1.6.3 • Published 7 months ago

@magicpages/ghost-typesense-cli v1.6.3

Weekly downloads
-
License
MIT
Repository
-
Last release
7 months ago

@magicpages/ghost-typesense-cli

Command-line tool for managing Ghost content in Typesense.

Installation

npm install -g @magicpages/ghost-typesense-cli

Usage

  1. Create ghost-typesense.config.json:

Minimal configuration:

{
  "ghost": {
    "url": "https://your-ghost-blog.com",
    "key": "your-content-api-key",
    "version": "v5.0"
  },
  "typesense": {
    "nodes": [{
      "host": "your-typesense-host",
      "port": 443,
      "protocol": "https"
    }],
    "apiKey": "your-admin-api-key"
  },
  "collection": {
    "name": "ghost"
  }
}

The tool comes with default field configurations optimized for Ghost CMS. These include:

  • Required fields: id, title, url, slug, html, plaintext, excerpt, published_at, updated_at
  • Optional fields: feature_image, tags, authors

The plaintext field is automatically generated from HTML content if not provided by Ghost, ensuring better search quality.

You can override or add additional fields by specifying them in the config:

{
  "collection": {
    "name": "ghost",
    "fields": [
      { "name": "title", "type": "string", "index": true, "sort": true },
      { "name": "plaintext", "type": "string", "index": true },
      { "name": "custom_field", "type": "string", "optional": true }
    ]
  }
}

The tool will ensure all required fields are present with correct types while keeping your custom fields.

  1. Available commands:
# Initialize collection
ghost-typesense init --config ghost-typesense.config.json

# Sync all posts
ghost-typesense sync --config ghost-typesense.config.json

# Clear collection
ghost-typesense clear --config ghost-typesense.config.json

Configuration

OptionDescription
ghost.urlYour Ghost blog URL
ghost.keyContent API key
ghost.versionGhost API version
typesense.nodesArray of Typesense nodes
typesense.apiKeyAdmin API key
collection.nameCollection name

License

MIT © MagicPages

1.6.3

7 months ago

1.6.2

7 months ago

1.6.1

7 months ago

1.6.0

8 months ago

1.5.1

8 months ago

1.5.0

8 months ago

1.4.0

8 months ago

1.3.8

8 months ago

1.3.6

8 months ago

1.3.5

8 months ago

1.3.4

8 months ago

1.3.3

8 months ago

1.3.2

8 months ago

1.3.1

8 months ago

1.3.0

8 months ago

1.2.0

8 months ago

1.1.3

8 months ago

1.1.2

8 months ago

1.1.1

8 months ago

1.1.0

8 months ago

1.0.1

8 months ago

1.0.0

8 months ago

0.0.0

8 months ago