@cometchat/skills-cli 2.0.0
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 +70 -0
- package/bin/cometchat.mjs +7 -0
- package/dist/index.js +4395 -0
- package/dist/registry/schemas/template.schema.json +142 -0
- package/dist/registry/v6/experiences/1-conversation-list/astro.template.json +89 -0
- package/dist/registry/v6/experiences/1-conversation-list/nextjs-pages.template.json +83 -0
- package/dist/registry/v6/experiences/1-conversation-list/nextjs.template.json +83 -0
- package/dist/registry/v6/experiences/1-conversation-list/react-router.template.json +102 -0
- package/dist/registry/v6/experiences/1-conversation-list/reactjs.template.json +86 -0
- package/dist/registry/v6/experiences/1-conversation-list/templates/astro/ChatApp.css.tpl +39 -0
- package/dist/registry/v6/experiences/1-conversation-list/templates/astro/ChatApp.tsx.tpl +86 -0
- package/dist/registry/v6/experiences/1-conversation-list/templates/astro/CometChatSelector.tsx.tpl +40 -0
- package/dist/registry/v6/experiences/1-conversation-list/templates/astro/chat.astro.tpl +17 -0
- package/dist/registry/v6/experiences/1-conversation-list/templates/nextjs/CometChatNoSSR.css.tpl +39 -0
- package/dist/registry/v6/experiences/1-conversation-list/templates/nextjs/CometChatNoSSR.tsx.tpl +86 -0
- package/dist/registry/v6/experiences/1-conversation-list/templates/nextjs/CometChatSelector.tsx.tpl +41 -0
- package/dist/registry/v6/experiences/1-conversation-list/templates/nextjs/chat-page.tsx.tpl +11 -0
- package/dist/registry/v6/experiences/1-conversation-list/templates/nextjs-pages/CometChatNoSSR.css.tpl +39 -0
- package/dist/registry/v6/experiences/1-conversation-list/templates/nextjs-pages/CometChatNoSSR.tsx.tpl +88 -0
- package/dist/registry/v6/experiences/1-conversation-list/templates/nextjs-pages/CometChatSelector.tsx.tpl +41 -0
- package/dist/registry/v6/experiences/1-conversation-list/templates/nextjs-pages/chat-page.tsx.tpl +15 -0
- package/dist/registry/v6/experiences/1-conversation-list/templates/react-router/CometChat-route.tsx.tpl +22 -0
- package/dist/registry/v6/experiences/1-conversation-list/templates/react-router/CometChatNoSSR.css.tpl +39 -0
- package/dist/registry/v6/experiences/1-conversation-list/templates/react-router/CometChatNoSSR.tsx.tpl +87 -0
- package/dist/registry/v6/experiences/1-conversation-list/templates/react-router/CometChatSelector.tsx.tpl +40 -0
- package/dist/registry/v6/experiences/1-conversation-list/templates/reactjs/App.css.tpl +32 -0
- package/dist/registry/v6/experiences/1-conversation-list/templates/reactjs/App.tsx.tpl +55 -0
- package/dist/registry/v6/experiences/1-conversation-list/templates/reactjs/CometChatSelector.tsx.tpl +40 -0
- package/dist/registry/v6/experiences/1-conversation-list/templates/reactjs/main.tsx.tpl +46 -0
- package/dist/registry/v6/experiences/2-one-to-one/astro.template.json +81 -0
- package/dist/registry/v6/experiences/2-one-to-one/nextjs.template.json +77 -0
- package/dist/registry/v6/experiences/2-one-to-one/react-router.template.json +93 -0
- package/dist/registry/v6/experiences/2-one-to-one/reactjs.template.json +77 -0
- package/dist/registry/v6/experiences/2-one-to-one/templates/astro/ChatApp.css.tpl +21 -0
- package/dist/registry/v6/experiences/2-one-to-one/templates/astro/ChatApp.tsx.tpl +66 -0
- package/dist/registry/v6/experiences/2-one-to-one/templates/astro/chat.astro.tpl +17 -0
- package/dist/registry/v6/experiences/2-one-to-one/templates/nextjs/CometChatNoSSR.css.tpl +21 -0
- package/dist/registry/v6/experiences/2-one-to-one/templates/nextjs/CometChatNoSSR.tsx.tpl +66 -0
- package/dist/registry/v6/experiences/2-one-to-one/templates/nextjs/chat-page.tsx.tpl +11 -0
- package/dist/registry/v6/experiences/2-one-to-one/templates/react-router/CometChat-route.tsx.tpl +21 -0
- package/dist/registry/v6/experiences/2-one-to-one/templates/react-router/CometChatNoSSR.css.tpl +21 -0
- package/dist/registry/v6/experiences/2-one-to-one/templates/react-router/CometChatNoSSR.tsx.tpl +67 -0
- package/dist/registry/v6/experiences/2-one-to-one/templates/reactjs/App.css.tpl +4 -0
- package/dist/registry/v6/experiences/2-one-to-one/templates/reactjs/App.tsx.tpl +44 -0
- package/dist/registry/v6/experiences/2-one-to-one/templates/reactjs/main.tsx.tpl +46 -0
- package/dist/registry/v6/experiences/3-tab-based/astro.template.json +93 -0
- package/dist/registry/v6/experiences/3-tab-based/nextjs.template.json +90 -0
- package/dist/registry/v6/experiences/3-tab-based/react-router.template.json +105 -0
- package/dist/registry/v6/experiences/3-tab-based/reactjs.template.json +90 -0
- package/dist/registry/v6/experiences/3-tab-based/templates/astro/ChatApp.css.tpl +39 -0
- package/dist/registry/v6/experiences/3-tab-based/templates/astro/ChatApp.tsx.tpl +93 -0
- package/dist/registry/v6/experiences/3-tab-based/templates/astro/CometChatTabs.css.tpl +43 -0
- package/dist/registry/v6/experiences/3-tab-based/templates/astro/CometChatTabs.tsx.tpl +72 -0
- package/dist/registry/v6/experiences/3-tab-based/templates/astro/chat.astro.tpl +17 -0
- package/dist/registry/v6/experiences/3-tab-based/templates/nextjs/CometChatNoSSR.css.tpl +39 -0
- package/dist/registry/v6/experiences/3-tab-based/templates/nextjs/CometChatNoSSR.tsx.tpl +93 -0
- package/dist/registry/v6/experiences/3-tab-based/templates/nextjs/CometChatTabs.css.tpl +43 -0
- package/dist/registry/v6/experiences/3-tab-based/templates/nextjs/CometChatTabs.tsx.tpl +73 -0
- package/dist/registry/v6/experiences/3-tab-based/templates/nextjs/chat-page.tsx.tpl +11 -0
- package/dist/registry/v6/experiences/3-tab-based/templates/react-router/CometChat-route.tsx.tpl +21 -0
- package/dist/registry/v6/experiences/3-tab-based/templates/react-router/CometChatNoSSR.css.tpl +39 -0
- package/dist/registry/v6/experiences/3-tab-based/templates/react-router/CometChatNoSSR.tsx.tpl +94 -0
- package/dist/registry/v6/experiences/3-tab-based/templates/react-router/CometChatTabs.css.tpl +43 -0
- package/dist/registry/v6/experiences/3-tab-based/templates/react-router/CometChatTabs.tsx.tpl +72 -0
- package/dist/registry/v6/experiences/3-tab-based/templates/reactjs/App.css.tpl +7 -0
- package/dist/registry/v6/experiences/3-tab-based/templates/reactjs/App.tsx.tpl +62 -0
- package/dist/registry/v6/experiences/3-tab-based/templates/reactjs/CometChatTabs.css.tpl +43 -0
- package/dist/registry/v6/experiences/3-tab-based/templates/reactjs/CometChatTabs.tsx.tpl +72 -0
- package/dist/registry/v6/experiences/3-tab-based/templates/reactjs/main.tsx.tpl +46 -0
- package/dist/registry/v6/features/catalog.json +344 -0
- package/dist/registry/v6/production/astro/cometchat-token.ts.tpl +86 -0
- package/dist/registry/v6/production/astro.template.json +51 -0
- package/dist/registry/v6/production/nextjs/route.ts.tpl +79 -0
- package/dist/registry/v6/production/nextjs.template.json +50 -0
- package/dist/registry/v6/production/react-router/api.cometchat-token.ts.tpl +73 -0
- package/dist/registry/v6/production/react-router.template.json +58 -0
- package/dist/registry/v6/user-mgmt/astro/cometchat-user.ts.tpl +164 -0
- package/dist/registry/v6/user-mgmt/astro.template.json +33 -0
- package/dist/registry/v6/user-mgmt/nextjs/route.ts.tpl +212 -0
- package/dist/registry/v6/user-mgmt/nextjs.template.json +57 -0
- package/dist/registry/v6/user-mgmt/react-router/api.cometchat-user.ts.tpl +176 -0
- package/dist/registry/v6/user-mgmt/react-router.template.json +40 -0
- package/dist/registry/v6/widget/astro/CometChatWidget.css.tpl +105 -0
- package/dist/registry/v6/widget/astro/CometChatWidget.tsx.tpl +88 -0
- package/dist/registry/v6/widget/astro.template.json +38 -0
- package/dist/registry/v6/widget/nextjs/CometChatWidget.css.tpl +105 -0
- package/dist/registry/v6/widget/nextjs/CometChatWidget.tsx.tpl +88 -0
- package/dist/registry/v6/widget/nextjs.template.json +40 -0
- package/dist/registry/v6/widget/react-router/CometChatWidget.css.tpl +105 -0
- package/dist/registry/v6/widget/react-router/CometChatWidget.tsx.tpl +98 -0
- package/dist/registry/v6/widget/react-router.template.json +36 -0
- package/dist/registry/v6/widget/reactjs/CometChatWidget.css.tpl +105 -0
- package/dist/registry/v6/widget/reactjs/CometChatWidget.tsx.tpl +89 -0
- package/dist/registry/v6/widget/reactjs.template.json +36 -0
- package/package.json +53 -0
package/README.md
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# @cometchat/skills-cli
|
|
2
|
+
|
|
3
|
+
> CLI for the CometChat Skills v2 architecture. Detect, view, apply, verify, and manage CometChat React UI Kit integrations from the command line.
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
npx @cometchat/skills-cli@latest detect
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
## Why this exists
|
|
10
|
+
|
|
11
|
+
CometChat Skills v1 was 5500+ lines of agent-readable Markdown that walked AI assistants through React UI Kit integrations. v2 moves the logic into this CLI, leaving the skill files as ~30-line glue that just calls these commands. Result: 92% smaller skills, deterministic behavior, idempotent re-runs, transactional file writes, and shared logic across every supported AI agent.
|
|
12
|
+
|
|
13
|
+
## Commands
|
|
14
|
+
|
|
15
|
+
| Command | Purpose |
|
|
16
|
+
|---|---|
|
|
17
|
+
| `cometchat detect [path]` | Fingerprint a project: framework, version, router, env prefix, credentials, existing integration |
|
|
18
|
+
| `cometchat experiences` | List the 3 chat experiences and their metadata |
|
|
19
|
+
| `cometchat view --experience N --framework F` | Pure dry-run preview of `apply` |
|
|
20
|
+
| `cometchat apply --experience N --framework F` | Perform the integration. Transactional. Idempotent. |
|
|
21
|
+
| `cometchat install` | Install the deps the integration needs (auto-detects pnpm/npm/yarn/bun) |
|
|
22
|
+
| `cometchat verify` | Run AST checks: css imports, init order, no auth key in source, error UI |
|
|
23
|
+
| `cometchat info` | Drift detection via SHA-256 checksums |
|
|
24
|
+
| `cometchat uninstall [--force]` | Remove only the files this integration owns |
|
|
25
|
+
|
|
26
|
+
All commands accept `--json` for machine-readable output.
|
|
27
|
+
|
|
28
|
+
## Quick start
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
# 1. Auto-detect your project
|
|
32
|
+
npx @cometchat/skills-cli@latest detect --json
|
|
33
|
+
|
|
34
|
+
# 2. Preview the integration without writing anything
|
|
35
|
+
npx @cometchat/skills-cli@latest view --experience 1 --framework reactjs
|
|
36
|
+
|
|
37
|
+
# 3. Apply + auto-install in one command
|
|
38
|
+
npx @cometchat/skills-cli@latest apply --experience 1 --framework reactjs --auto-install
|
|
39
|
+
|
|
40
|
+
# 4. Verify the integration
|
|
41
|
+
npx @cometchat/skills-cli@latest verify
|
|
42
|
+
|
|
43
|
+
# 5. Check status anytime
|
|
44
|
+
npx @cometchat/skills-cli@latest info
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Frameworks supported
|
|
48
|
+
|
|
49
|
+
- React.js (Vite or CRA)
|
|
50
|
+
- Next.js (App Router or Pages Router, 13/14/15/16)
|
|
51
|
+
- React Router (v6 library mode + v7 framework mode)
|
|
52
|
+
- Astro (React islands with `client:only="react"`)
|
|
53
|
+
|
|
54
|
+
Each framework × experience (1-3) ships with a registry template at [@cometchat/skills-registry](https://www.npmjs.com/package/@cometchat/skills-registry).
|
|
55
|
+
|
|
56
|
+
## Safety guarantees
|
|
57
|
+
|
|
58
|
+
- **Transactional writes** — apply either succeeds completely or rolls back. No partial integrations.
|
|
59
|
+
- **Refuse-to-overwrite** — apply will not silently replace files that contain user code. Pass `--force-overwrite` to override.
|
|
60
|
+
- **Idempotency** — re-running apply with the same arguments is a safe no-op.
|
|
61
|
+
- **Drift detection** — `info` re-checksums every owned file and reports user edits.
|
|
62
|
+
- **Clean uninstall** — `uninstall` only removes files in `.cometchat/state.json`'s `files_owned` list.
|
|
63
|
+
|
|
64
|
+
## License
|
|
65
|
+
|
|
66
|
+
MIT — © CometChat
|
|
67
|
+
|
|
68
|
+
## Repository
|
|
69
|
+
|
|
70
|
+
Source + tests + roadmap live at <https://github.com/cometchat-team/cometchat-skills>
|