@bearplex-technologies/cli
v0.1.3
Published
BearPlex CMS CLI — scan websites and sync content fields
Downloads
34
Maintainers
Readme
@bearplex-technologies/cli
The official CLI for BearPlex CMS — scan your website, extract content, and sync it to the CMS in seconds.
Built for agencies and developers who need to onboard client websites to a headless CMS without manually creating hundreds of content fields.
What it does
- Scans your Next.js / React project's components
- Extracts hardcoded content (titles, descriptions, stats, labels, etc.)
- Generates a
bearplex.content.jsonmanifest - Pushes all fields to BearPlex CMS via the API
- Pulls live CMS content for local fallback data
Quick Start
# Scan your project
npx @bearplex-technologies/cli scan ./src --site-id <your-site-id> --api-key <your-api-key>
# Review the generated manifest
cat bearplex.content.json
# Push to CMS
npx @bearplex-technologies/cli pushThat's it. Your content fields are now live in the CMS admin panel, ready for editing.
Installation
# Run directly with npx (no install needed)
npx @bearplex-technologies/cli <command>
# Or install globally
npm install -g @bearplex-technologies/cli
bearplex <command>Commands
bearplex scan [dir]
Scan a source directory and extract content into a manifest file.
bearplex scan ./src
bearplex scan ./src --site-id abc-123 --api-key bpcms_sk_...
bearplex scan ./src --output my-manifest.json| Option | Default | Description |
|--------|---------|-------------|
| [dir] | ./src | Source directory to scan |
| --site-id <id> | — | Site UUID from BearPlex CMS |
| --api-key <key> | — | API key from BearPlex CMS |
| --api-url <url> | https://cms.oduscloud.com | CMS API base URL |
| -o, --output <path> | bearplex.content.json | Output manifest file |
What the scanner detects:
- JSX text content between tags
- Hardcoded data objects (
{ title: "...", desc: "..." }) - String constants (
const heroTitle = "...") - Content types: text, markdown, image, link, email, phone
What it ignores:
- CSS classes and style values
- Template expressions and code
- Import statements and module references
- Layout and utility files
bearplex push
Push content fields from the manifest to the CMS.
bearplex push # Create/update all fields
bearplex push --dry-run # Preview without making changes| Option | Description |
|--------|-------------|
| -f, --file <path> | Manifest file (default: bearplex.content.json) |
| --dry-run | Show what would be created without making API calls |
The push is idempotent — running it multiple times is safe. New fields are created, existing fields are updated with the manifest values.
bearplex pull
Download current CMS content into a local JSON file.
bearplex pull
bearplex pull -o src/data/cms-fallback.json| Option | Default | Description |
|--------|---------|-------------|
| --api-url <url> | From manifest | CMS API URL |
| --api-key <key> | From manifest | API key |
| --site-id <id> | From manifest | Site UUID |
| -o, --output <path> | cms-content.json | Output file path |
Use this to generate fallback data for your website, so it works even when the CMS is unreachable.
bearplex init
Create a blank manifest template to get started manually.
bearplex init
bearplex init --site-id abc-123 --api-key bpcms_sk_...Typical Workflow
Your Website CLI BearPlex CMS
─────────── ───── ──────────────
components/ ──scan──> manifest.json
│
review & edit
│
──push──────────> Content fields created
↓
Admin UI ready for editing
↓
<──pull───────── Download for fallbacksStep-by-step for a new client site
# 1. Build the website with hardcoded content
# (develop normally, no CMS integration needed yet)
# 2. Scan the source code
npx @bearplex-technologies/cli scan ./src \
--site-id <uuid> \
--api-key bpcms_sk_...
# 3. Review the generated bearplex.content.json
# - Remove fields you don't want in the CMS
# - Fix any labels or keys
# - Adjust field types if needed
# 4. Preview the push
npx @bearplex-technologies/cli push --dry-run
# 5. Push to CMS
npx @bearplex-technologies/cli push
# 6. Pull content for fallback data
npx @bearplex-technologies/cli pull -o src/data/cms-fallback.json
# 7. Wire up your components to read from CMS
# (fetch from the v1 API, fall back to local data)Manifest Format
The bearplex.content.json file:
{
"siteId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"apiUrl": "https://cms.oduscloud.com",
"apiKey": "bpcms_sk_...",
"pages": {
"home": [
{
"key": "hero_title",
"label": "Hero: Title",
"type": "text",
"value": "Welcome to our site",
"sortOrder": 0
},
{
"key": "hero_subtitle",
"label": "Hero: Subtitle",
"type": "markdown",
"value": "We build things that matter.",
"sortOrder": 1
}
],
"about": [
{
"key": "team_heading",
"label": "Team Section Heading",
"type": "text",
"value": "Our Team",
"sortOrder": 0
}
]
}
}Supported Field Types
| Type | Description |
|------|-------------|
| text | Short text (titles, labels, taglines) |
| markdown | Long-form content with formatting |
| image | Image URL (with optional upload hint) |
| link | URL |
| email | Email address |
| phone | Phone number |
Requirements
- Node.js 18+
- A BearPlex CMS account with a site and API key
- Get started at cms.oduscloud.com
About BearPlex CMS
BearPlex CMS is a multi-tenant headless CMS built for agencies. Manage content for all your client websites from a single admin panel.
- Content editing — Key-value fields organized by page
- Collections — Blogs, memos, case studies with rich sections
- Media library — S3-backed uploads with browsing and search
- API keys — Site-scoped read-only access for client websites
- Role-based access — Owner, editor, and viewer roles
Learn more at cms.oduscloud.com
License
MIT
