@cometchat/skills-cli 2.4.1 → 3.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.
Files changed (111) hide show
  1. package/README.md +45 -37
  2. package/dist/index.js +1821 -13090
  3. package/dist/utils/error-dictionary.js +0 -69
  4. package/package.json +10 -12
  5. package/dist/registry/schemas/config.schema.json +0 -119
  6. package/dist/registry/schemas/template.schema.json +0 -142
  7. package/dist/registry/v6/experiences/1-conversation-list/astro.template.json +0 -89
  8. package/dist/registry/v6/experiences/1-conversation-list/nextjs-pages.template.json +0 -83
  9. package/dist/registry/v6/experiences/1-conversation-list/nextjs.template.json +0 -83
  10. package/dist/registry/v6/experiences/1-conversation-list/react-router.template.json +0 -102
  11. package/dist/registry/v6/experiences/1-conversation-list/reactjs-dedicated-route.template.json +0 -81
  12. package/dist/registry/v6/experiences/1-conversation-list/reactjs.template.json +0 -86
  13. package/dist/registry/v6/experiences/1-conversation-list/templates/astro/ChatApp.css.tpl +0 -43
  14. package/dist/registry/v6/experiences/1-conversation-list/templates/astro/ChatApp.tsx.tpl +0 -86
  15. package/dist/registry/v6/experiences/1-conversation-list/templates/astro/CometChatSelector.tsx.tpl +0 -40
  16. package/dist/registry/v6/experiences/1-conversation-list/templates/astro/chat.astro.tpl +0 -17
  17. package/dist/registry/v6/experiences/1-conversation-list/templates/nextjs/CometChatNoSSR.css.tpl +0 -43
  18. package/dist/registry/v6/experiences/1-conversation-list/templates/nextjs/CometChatNoSSR.tsx.tpl +0 -86
  19. package/dist/registry/v6/experiences/1-conversation-list/templates/nextjs/CometChatSelector.tsx.tpl +0 -41
  20. package/dist/registry/v6/experiences/1-conversation-list/templates/nextjs/chat-page.tsx.tpl +0 -11
  21. package/dist/registry/v6/experiences/1-conversation-list/templates/nextjs-pages/CometChatNoSSR.css.tpl +0 -43
  22. package/dist/registry/v6/experiences/1-conversation-list/templates/nextjs-pages/CometChatNoSSR.tsx.tpl +0 -88
  23. package/dist/registry/v6/experiences/1-conversation-list/templates/nextjs-pages/CometChatSelector.tsx.tpl +0 -41
  24. package/dist/registry/v6/experiences/1-conversation-list/templates/nextjs-pages/chat-page.tsx.tpl +0 -15
  25. package/dist/registry/v6/experiences/1-conversation-list/templates/react-router/CometChat-route.tsx.tpl +0 -22
  26. package/dist/registry/v6/experiences/1-conversation-list/templates/react-router/CometChatNoSSR.css.tpl +0 -43
  27. package/dist/registry/v6/experiences/1-conversation-list/templates/react-router/CometChatNoSSR.tsx.tpl +0 -87
  28. package/dist/registry/v6/experiences/1-conversation-list/templates/react-router/CometChatSelector.tsx.tpl +0 -40
  29. package/dist/registry/v6/experiences/1-conversation-list/templates/reactjs/App.css.tpl +0 -40
  30. package/dist/registry/v6/experiences/1-conversation-list/templates/reactjs/App.tsx.tpl +0 -55
  31. package/dist/registry/v6/experiences/1-conversation-list/templates/reactjs/CometChatSelector.tsx.tpl +0 -40
  32. package/dist/registry/v6/experiences/1-conversation-list/templates/reactjs/main.tsx.tpl +0 -46
  33. package/dist/registry/v6/experiences/1-conversation-list/templates/reactjs-dedicated-route/ChatPage.tsx.tpl +0 -87
  34. package/dist/registry/v6/experiences/1-conversation-list/templates/reactjs-dedicated-route/CometChatMessenger.css.tpl +0 -20
  35. package/dist/registry/v6/experiences/1-conversation-list/templates/reactjs-dedicated-route/CometChatMessenger.tsx.tpl +0 -54
  36. package/dist/registry/v6/experiences/1-conversation-list/templates/reactjs-dedicated-route/CometChatSelector.tsx.tpl +0 -40
  37. package/dist/registry/v6/experiences/2-one-to-one/astro.template.json +0 -81
  38. package/dist/registry/v6/experiences/2-one-to-one/nextjs.template.json +0 -77
  39. package/dist/registry/v6/experiences/2-one-to-one/react-router.template.json +0 -93
  40. package/dist/registry/v6/experiences/2-one-to-one/reactjs-dedicated-route.template.json +0 -75
  41. package/dist/registry/v6/experiences/2-one-to-one/reactjs.template.json +0 -80
  42. package/dist/registry/v6/experiences/2-one-to-one/templates/astro/ChatApp.css.tpl +0 -21
  43. package/dist/registry/v6/experiences/2-one-to-one/templates/astro/ChatApp.tsx.tpl +0 -66
  44. package/dist/registry/v6/experiences/2-one-to-one/templates/astro/chat.astro.tpl +0 -17
  45. package/dist/registry/v6/experiences/2-one-to-one/templates/nextjs/CometChatNoSSR.css.tpl +0 -21
  46. package/dist/registry/v6/experiences/2-one-to-one/templates/nextjs/CometChatNoSSR.tsx.tpl +0 -66
  47. package/dist/registry/v6/experiences/2-one-to-one/templates/nextjs/chat-page.tsx.tpl +0 -11
  48. package/dist/registry/v6/experiences/2-one-to-one/templates/react-router/CometChat-route.tsx.tpl +0 -21
  49. package/dist/registry/v6/experiences/2-one-to-one/templates/react-router/CometChatNoSSR.css.tpl +0 -21
  50. package/dist/registry/v6/experiences/2-one-to-one/templates/react-router/CometChatNoSSR.tsx.tpl +0 -67
  51. package/dist/registry/v6/experiences/2-one-to-one/templates/reactjs/App.css.tpl +0 -4
  52. package/dist/registry/v6/experiences/2-one-to-one/templates/reactjs/App.tsx.tpl +0 -44
  53. package/dist/registry/v6/experiences/2-one-to-one/templates/reactjs/main.tsx.tpl +0 -46
  54. package/dist/registry/v6/experiences/2-one-to-one/templates/reactjs-dedicated-route/ChatPage.tsx.tpl +0 -84
  55. package/dist/registry/v6/experiences/2-one-to-one/templates/reactjs-dedicated-route/CometChatMessenger.css.tpl +0 -9
  56. package/dist/registry/v6/experiences/2-one-to-one/templates/reactjs-dedicated-route/CometChatMessenger.tsx.tpl +0 -43
  57. package/dist/registry/v6/experiences/3-tab-based/astro.template.json +0 -93
  58. package/dist/registry/v6/experiences/3-tab-based/nextjs.template.json +0 -90
  59. package/dist/registry/v6/experiences/3-tab-based/react-router.template.json +0 -105
  60. package/dist/registry/v6/experiences/3-tab-based/reactjs-dedicated-route.template.json +0 -89
  61. package/dist/registry/v6/experiences/3-tab-based/reactjs.template.json +0 -93
  62. package/dist/registry/v6/experiences/3-tab-based/templates/astro/ChatApp.css.tpl +0 -39
  63. package/dist/registry/v6/experiences/3-tab-based/templates/astro/ChatApp.tsx.tpl +0 -93
  64. package/dist/registry/v6/experiences/3-tab-based/templates/astro/CometChatTabs.css.tpl +0 -43
  65. package/dist/registry/v6/experiences/3-tab-based/templates/astro/CometChatTabs.tsx.tpl +0 -72
  66. package/dist/registry/v6/experiences/3-tab-based/templates/astro/chat.astro.tpl +0 -17
  67. package/dist/registry/v6/experiences/3-tab-based/templates/nextjs/CometChatNoSSR.css.tpl +0 -39
  68. package/dist/registry/v6/experiences/3-tab-based/templates/nextjs/CometChatNoSSR.tsx.tpl +0 -93
  69. package/dist/registry/v6/experiences/3-tab-based/templates/nextjs/CometChatTabs.css.tpl +0 -43
  70. package/dist/registry/v6/experiences/3-tab-based/templates/nextjs/CometChatTabs.tsx.tpl +0 -73
  71. package/dist/registry/v6/experiences/3-tab-based/templates/nextjs/chat-page.tsx.tpl +0 -11
  72. package/dist/registry/v6/experiences/3-tab-based/templates/react-router/CometChat-route.tsx.tpl +0 -21
  73. package/dist/registry/v6/experiences/3-tab-based/templates/react-router/CometChatNoSSR.css.tpl +0 -39
  74. package/dist/registry/v6/experiences/3-tab-based/templates/react-router/CometChatNoSSR.tsx.tpl +0 -94
  75. package/dist/registry/v6/experiences/3-tab-based/templates/react-router/CometChatTabs.css.tpl +0 -43
  76. package/dist/registry/v6/experiences/3-tab-based/templates/react-router/CometChatTabs.tsx.tpl +0 -72
  77. package/dist/registry/v6/experiences/3-tab-based/templates/reactjs/App.css.tpl +0 -7
  78. package/dist/registry/v6/experiences/3-tab-based/templates/reactjs/App.tsx.tpl +0 -62
  79. package/dist/registry/v6/experiences/3-tab-based/templates/reactjs/CometChatTabs.css.tpl +0 -43
  80. package/dist/registry/v6/experiences/3-tab-based/templates/reactjs/CometChatTabs.tsx.tpl +0 -72
  81. package/dist/registry/v6/experiences/3-tab-based/templates/reactjs/main.tsx.tpl +0 -46
  82. package/dist/registry/v6/experiences/3-tab-based/templates/reactjs-dedicated-route/ChatPage.tsx.tpl +0 -84
  83. package/dist/registry/v6/experiences/3-tab-based/templates/reactjs-dedicated-route/CometChatMessenger.css.tpl +0 -11
  84. package/dist/registry/v6/experiences/3-tab-based/templates/reactjs-dedicated-route/CometChatMessenger.tsx.tpl +0 -61
  85. package/dist/registry/v6/experiences/3-tab-based/templates/reactjs-dedicated-route/CometChatTabs.css.tpl +0 -43
  86. package/dist/registry/v6/experiences/3-tab-based/templates/reactjs-dedicated-route/CometChatTabs.tsx.tpl +0 -72
  87. package/dist/registry/v6/features/catalog.json +0 -990
  88. package/dist/registry/v6/production/astro/cometchat-token.ts.tpl +0 -86
  89. package/dist/registry/v6/production/astro.template.json +0 -51
  90. package/dist/registry/v6/production/nextjs/route.ts.tpl +0 -79
  91. package/dist/registry/v6/production/nextjs.template.json +0 -50
  92. package/dist/registry/v6/production/react-router/api.cometchat-token.ts.tpl +0 -73
  93. package/dist/registry/v6/production/react-router.template.json +0 -58
  94. package/dist/registry/v6/user-mgmt/astro/cometchat-user.ts.tpl +0 -164
  95. package/dist/registry/v6/user-mgmt/astro.template.json +0 -33
  96. package/dist/registry/v6/user-mgmt/nextjs/route.ts.tpl +0 -212
  97. package/dist/registry/v6/user-mgmt/nextjs.template.json +0 -57
  98. package/dist/registry/v6/user-mgmt/react-router/api.cometchat-user.ts.tpl +0 -176
  99. package/dist/registry/v6/user-mgmt/react-router.template.json +0 -40
  100. package/dist/registry/v6/widget/astro/CometChatWidget.css.tpl +0 -105
  101. package/dist/registry/v6/widget/astro/CometChatWidget.tsx.tpl +0 -88
  102. package/dist/registry/v6/widget/astro.template.json +0 -38
  103. package/dist/registry/v6/widget/nextjs/CometChatWidget.css.tpl +0 -105
  104. package/dist/registry/v6/widget/nextjs/CometChatWidget.tsx.tpl +0 -88
  105. package/dist/registry/v6/widget/nextjs.template.json +0 -40
  106. package/dist/registry/v6/widget/react-router/CometChatWidget.css.tpl +0 -105
  107. package/dist/registry/v6/widget/react-router/CometChatWidget.tsx.tpl +0 -98
  108. package/dist/registry/v6/widget/react-router.template.json +0 -36
  109. package/dist/registry/v6/widget/reactjs/CometChatWidget.css.tpl +0 -105
  110. package/dist/registry/v6/widget/reactjs/CometChatWidget.tsx.tpl +0 -89
  111. package/dist/registry/v6/widget/reactjs.template.json +0 -36
package/README.md CHANGED
@@ -1,65 +1,73 @@
1
1
  # @cometchat/skills-cli
2
2
 
3
- > CLI for the CometChat Skills v2 architecture. Detect, view, apply, verify, and manage CometChat React UI Kit integrations from the command line.
3
+ > CLI for CometChat dashboard authentication + app-credential provisioning.
4
4
 
5
5
  ```bash
6
- npx @cometchat/skills-cli@latest detect
6
+ npx @cometchat/skills-cli@latest auth login
7
7
  ```
8
8
 
9
9
  ## Why this exists
10
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.
11
+ This CLI is a **pure dashboard/API client**. Its only job is authenticating
12
+ against the CometChat dashboard and fetching your app credentials (App ID /
13
+ Region / Auth Key). It knows nothing about UI Kit, React, frameworks, or
14
+ codegen — the CometChat **skills** own framework detection, env-file writing,
15
+ and all code generation. The CLI just gets you authenticated and hands the
16
+ skills a neutral `.cometchat/config.json` to build on.
17
+
18
+ > **3.0.0 is a breaking re-architecture.** Earlier versions (≤2.x) also did
19
+ > framework detection, integration codegen, and `.env` writing. All of that
20
+ > moved into the skills. Only `auth`, `provision`, and `config` remain.
12
21
 
13
22
  ## Commands
14
23
 
15
24
  | Command | Purpose |
16
25
  |---|---|
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 |
26
+ | `cometchat auth <login\|logout\|status\|signup>` | Dashboard device-auth. Opens your browser at the CometChat dashboard and stores the bearer token in the OS keychain (falling back to a chmod-600 file). |
27
+ | `cometchat provision <run\|list\|create\|use>` | Dashboard app operations. Fetches App ID / Region / Auth Key, prints them as JSON, and writes a neutral `.cometchat/config.json`. Writes **no** framework env file. |
28
+ | `cometchat config <init\|get\|set\|show\|path>` | Manage `.cometchat/config.json` credential/app state only (appId, region, authKey + app metadata). |
25
29
 
26
30
  All commands accept `--json` for machine-readable output.
27
31
 
28
32
  ## Quick start
29
33
 
30
34
  ```bash
31
- # 1. Auto-detect your project
32
- npx @cometchat/skills-cli@latest detect --json
35
+ # 1. Authenticate against the dashboard (opens your browser)
36
+ npx @cometchat/skills-cli@latest auth login
33
37
 
34
- # 2. Preview the integration without writing anything
35
- npx @cometchat/skills-cli@latest view --experience 1 --framework reactjs
38
+ # 2. List the apps on your account
39
+ npx @cometchat/skills-cli@latest provision list --json
36
40
 
37
- # 3. Apply + auto-install in one command
38
- npx @cometchat/skills-cli@latest apply --experience 1 --framework reactjs --auto-install
41
+ # 3. End-to-end: pick/create an app, fetch creds, write .cometchat/config.json
42
+ npx @cometchat/skills-cli@latest provision run --json
39
43
 
40
- # 4. Verify the integration
41
- npx @cometchat/skills-cli@latest verify
44
+ # …or select a specific app by id
45
+ npx @cometchat/skills-cli@latest provision use --app-id <id> --json
42
46
 
43
- # 5. Check status anytime
44
- npx @cometchat/skills-cli@latest info
47
+ # 4. Inspect the local config the skills read
48
+ npx @cometchat/skills-cli@latest config show --json
45
49
  ```
46
50
 
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
51
+ ## What `provision` writes
52
+
53
+ `provision` writes **only** `.cometchat/config.json`, a neutral credential/app
54
+ record:
55
+
56
+ ```json
57
+ {
58
+ "version": 1,
59
+ "appId": "…",
60
+ "region": "us",
61
+ "authKey": "…",
62
+ "appName": "My Chat",
63
+ "plan": "…",
64
+ "industry": "…"
65
+ }
66
+ ```
57
67
 
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.
68
+ It does **not** write any framework env file (`.env` / `VITE_` /
69
+ `NEXT_PUBLIC_` / …) and takes **no** `--framework` flag. The skill reads
70
+ `config.json` and writes the framework-specific env itself.
63
71
 
64
72
  ## License
65
73
 
@@ -67,4 +75,4 @@ MIT — © CometChat
67
75
 
68
76
  ## Repository
69
77
 
70
- Source + tests + roadmap live at <https://github.com/cometchat-team/cometchat-skills>
78
+ Source + tests live at <https://github.com/cometchat/cometchat-skills>