@codemieai/code 0.2.0 → 0.3.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 (258) hide show
  1. package/README.md +38 -7
  2. package/dist/agents/core/session/ensure-session.d.ts.map +1 -1
  3. package/dist/agents/core/session/ensure-session.js +14 -11
  4. package/dist/agents/core/session/ensure-session.js.map +1 -1
  5. package/dist/agents/plugins/claude/plugin/{codemie-statusline.mjs → session-status.mjs} +1 -0
  6. package/dist/agents/plugins/claude/plugin/skills/codemie-analytics/SKILL.md +641 -0
  7. package/dist/agents/plugins/claude/plugin/skills/codemie-analytics/references/leaderboard-dashboard-report.md +225 -0
  8. package/dist/agents/plugins/claude/plugin/skills/codemie-analytics/references/people-spending-dashboard-report.md +746 -0
  9. package/dist/agents/plugins/claude/plugin/skills/codemie-analytics/references/people-spending-dashboard-template.html +3270 -0
  10. package/dist/agents/plugins/claude/plugin/skills/codemie-analytics/scripts/analytics-cli.js +893 -0
  11. package/dist/agents/plugins/claude/plugin/skills/codemie-analytics/scripts/inspect-schema.js +211 -0
  12. package/dist/agents/plugins/claude/plugin/skills/codemie-html-report/README.md +39 -0
  13. package/dist/agents/plugins/claude/plugin/skills/codemie-html-report/SKILL.md +117 -26
  14. package/dist/agents/plugins/claude/plugin/skills/codemie-html-report/scripts/inject-css.js +40 -0
  15. package/dist/agents/plugins/claude/plugin/skills/codemie-html-report/scripts/inject-data.js +68 -0
  16. package/dist/agents/plugins/claude/plugin/skills/codemie-html-report/style-guide/css/bundle.css +1 -0
  17. package/dist/agents/plugins/claude/plugin/skills/codemie-sdk/SKILL.md +240 -0
  18. package/dist/agents/plugins/claude/plugin/skills/codemie-sdk/examples/assistants.md +256 -0
  19. package/dist/agents/plugins/claude/plugin/skills/codemie-sdk/examples/categories.md +101 -0
  20. package/dist/agents/plugins/claude/plugin/skills/codemie-sdk/examples/datasources.md +401 -0
  21. package/dist/agents/plugins/claude/plugin/skills/codemie-sdk/examples/integrations.md +242 -0
  22. package/dist/agents/plugins/claude/plugin/skills/codemie-sdk/examples/skills.md +191 -0
  23. package/dist/agents/plugins/claude/plugin/skills/codemie-sdk/examples/users.md +38 -0
  24. package/dist/agents/plugins/claude/plugin/skills/codemie-sdk/examples/workflows.md +151 -0
  25. package/dist/agents/plugins/claude/plugin/skills/msgraph/scripts/msgraph.js +12 -2
  26. package/dist/agents/plugins/claude/plugin/statusline.mjs +216 -0
  27. package/dist/agents/plugins/claude/statusline-installer.d.ts +8 -0
  28. package/dist/agents/plugins/claude/statusline-installer.d.ts.map +1 -0
  29. package/dist/agents/plugins/claude/statusline-installer.js +127 -0
  30. package/dist/agents/plugins/claude/statusline-installer.js.map +1 -0
  31. package/dist/agents/plugins/codemie-code.plugin.d.ts.map +1 -1
  32. package/dist/agents/plugins/codemie-code.plugin.js +5 -0
  33. package/dist/agents/plugins/codemie-code.plugin.js.map +1 -1
  34. package/dist/cli/commands/assistants/chat/index.d.ts.map +1 -1
  35. package/dist/cli/commands/assistants/chat/index.js +8 -2
  36. package/dist/cli/commands/assistants/chat/index.js.map +1 -1
  37. package/dist/cli/commands/assistants/setup/generators/claude-agent-generator.d.ts +3 -2
  38. package/dist/cli/commands/assistants/setup/generators/claude-agent-generator.d.ts.map +1 -1
  39. package/dist/cli/commands/assistants/setup/generators/claude-agent-generator.js +5 -4
  40. package/dist/cli/commands/assistants/setup/generators/claude-agent-generator.js.map +1 -1
  41. package/dist/cli/commands/assistants/setup/generators/claude-skill-generator.d.ts +3 -2
  42. package/dist/cli/commands/assistants/setup/generators/claude-skill-generator.d.ts.map +1 -1
  43. package/dist/cli/commands/assistants/setup/generators/claude-skill-generator.js +8 -6
  44. package/dist/cli/commands/assistants/setup/generators/claude-skill-generator.js.map +1 -1
  45. package/dist/cli/commands/assistants/setup/helpers.d.ts +3 -2
  46. package/dist/cli/commands/assistants/setup/helpers.d.ts.map +1 -1
  47. package/dist/cli/commands/assistants/setup/helpers.js +3 -2
  48. package/dist/cli/commands/assistants/setup/helpers.js.map +1 -1
  49. package/dist/cli/commands/assistants/setup/index.d.ts.map +1 -1
  50. package/dist/cli/commands/assistants/setup/index.js +7 -13
  51. package/dist/cli/commands/assistants/setup/index.js.map +1 -1
  52. package/dist/cli/commands/assistants/setup/summary/index.d.ts +3 -3
  53. package/dist/cli/commands/assistants/setup/summary/index.d.ts.map +1 -1
  54. package/dist/cli/commands/assistants/setup/summary/index.js +5 -5
  55. package/dist/cli/commands/assistants/setup/summary/index.js.map +1 -1
  56. package/dist/cli/commands/install.d.ts.map +1 -1
  57. package/dist/cli/commands/install.js +40 -0
  58. package/dist/cli/commands/install.js.map +1 -1
  59. package/dist/cli/commands/profile/display.d.ts.map +1 -1
  60. package/dist/cli/commands/profile/display.js +1 -0
  61. package/dist/cli/commands/profile/display.js.map +1 -1
  62. package/dist/cli/commands/proxy/connectors/desktop-managed-mcp-servers.json +0 -6
  63. package/dist/cli/commands/proxy/connectors/desktop.d.ts.map +1 -1
  64. package/dist/cli/commands/proxy/connectors/desktop.js +20 -10
  65. package/dist/cli/commands/proxy/connectors/desktop.js.map +1 -1
  66. package/dist/cli/commands/sdk/assistants.d.ts +3 -0
  67. package/dist/cli/commands/sdk/assistants.d.ts.map +1 -0
  68. package/dist/cli/commands/sdk/assistants.js +211 -0
  69. package/dist/cli/commands/sdk/assistants.js.map +1 -0
  70. package/dist/cli/commands/sdk/categories.d.ts +3 -0
  71. package/dist/cli/commands/sdk/categories.d.ts.map +1 -0
  72. package/dist/cli/commands/sdk/categories.js +186 -0
  73. package/dist/cli/commands/sdk/categories.js.map +1 -0
  74. package/dist/cli/commands/sdk/datasources.d.ts +3 -0
  75. package/dist/cli/commands/sdk/datasources.d.ts.map +1 -0
  76. package/dist/cli/commands/sdk/datasources.js +276 -0
  77. package/dist/cli/commands/sdk/datasources.js.map +1 -0
  78. package/dist/cli/commands/sdk/index.d.ts +3 -0
  79. package/dist/cli/commands/sdk/index.d.ts.map +1 -0
  80. package/dist/cli/commands/sdk/index.js +23 -0
  81. package/dist/cli/commands/sdk/index.js.map +1 -0
  82. package/dist/cli/commands/sdk/integrations.d.ts +3 -0
  83. package/dist/cli/commands/sdk/integrations.d.ts.map +1 -0
  84. package/dist/cli/commands/sdk/integrations.js +220 -0
  85. package/dist/cli/commands/sdk/integrations.js.map +1 -0
  86. package/dist/cli/commands/sdk/llm.d.ts +3 -0
  87. package/dist/cli/commands/sdk/llm.d.ts.map +1 -0
  88. package/dist/cli/commands/sdk/llm.js +48 -0
  89. package/dist/cli/commands/sdk/llm.js.map +1 -0
  90. package/dist/cli/commands/sdk/services/assistants.d.ts +13 -0
  91. package/dist/cli/commands/sdk/services/assistants.d.ts.map +1 -0
  92. package/dist/cli/commands/sdk/services/assistants.js +60 -0
  93. package/dist/cli/commands/sdk/services/assistants.js.map +1 -0
  94. package/dist/cli/commands/sdk/services/categories.d.ts +8 -0
  95. package/dist/cli/commands/sdk/services/categories.d.ts.map +1 -0
  96. package/dist/cli/commands/sdk/services/categories.js +19 -0
  97. package/dist/cli/commands/sdk/services/categories.js.map +1 -0
  98. package/dist/cli/commands/sdk/services/datasources.d.ts +33 -0
  99. package/dist/cli/commands/sdk/services/datasources.d.ts.map +1 -0
  100. package/dist/cli/commands/sdk/services/datasources.js +268 -0
  101. package/dist/cli/commands/sdk/services/datasources.js.map +1 -0
  102. package/dist/cli/commands/sdk/services/index.d.ts +6 -0
  103. package/dist/cli/commands/sdk/services/index.d.ts.map +1 -0
  104. package/dist/cli/commands/sdk/services/index.js +6 -0
  105. package/dist/cli/commands/sdk/services/index.js.map +1 -0
  106. package/dist/cli/commands/sdk/services/integrations.d.ts +27 -0
  107. package/dist/cli/commands/sdk/services/integrations.d.ts.map +1 -0
  108. package/dist/cli/commands/sdk/services/integrations.js +59 -0
  109. package/dist/cli/commands/sdk/services/integrations.js.map +1 -0
  110. package/dist/cli/commands/sdk/services/llm.d.ts +4 -0
  111. package/dist/cli/commands/sdk/services/llm.d.ts.map +1 -0
  112. package/dist/cli/commands/sdk/services/llm.js +7 -0
  113. package/dist/cli/commands/sdk/services/llm.js.map +1 -0
  114. package/dist/cli/commands/sdk/services/skills.d.ts +23 -0
  115. package/dist/cli/commands/sdk/services/skills.d.ts.map +1 -0
  116. package/dist/cli/commands/sdk/services/skills.js +69 -0
  117. package/dist/cli/commands/sdk/services/skills.js.map +1 -0
  118. package/dist/cli/commands/sdk/services/users.d.ts +4 -0
  119. package/dist/cli/commands/sdk/services/users.d.ts.map +1 -0
  120. package/dist/cli/commands/sdk/services/users.js +7 -0
  121. package/dist/cli/commands/sdk/services/users.js.map +1 -0
  122. package/dist/cli/commands/sdk/services/workflows.d.ts +7 -0
  123. package/dist/cli/commands/sdk/services/workflows.d.ts.map +1 -0
  124. package/dist/cli/commands/sdk/services/workflows.js +34 -0
  125. package/dist/cli/commands/sdk/services/workflows.js.map +1 -0
  126. package/dist/cli/commands/sdk/skills.d.ts +3 -0
  127. package/dist/cli/commands/sdk/skills.d.ts.map +1 -0
  128. package/dist/cli/commands/sdk/skills.js +492 -0
  129. package/dist/cli/commands/sdk/skills.js.map +1 -0
  130. package/dist/cli/commands/sdk/users.d.ts +3 -0
  131. package/dist/cli/commands/sdk/users.d.ts.map +1 -0
  132. package/dist/cli/commands/sdk/users.js +81 -0
  133. package/dist/cli/commands/sdk/users.js.map +1 -0
  134. package/dist/cli/commands/sdk/utils/cli-utils.d.ts +35 -0
  135. package/dist/cli/commands/sdk/utils/cli-utils.d.ts.map +1 -0
  136. package/dist/cli/commands/sdk/utils/cli-utils.js +110 -0
  137. package/dist/cli/commands/sdk/utils/cli-utils.js.map +1 -0
  138. package/dist/cli/commands/sdk/utils/datasource-types.d.ts +9 -0
  139. package/dist/cli/commands/sdk/utils/datasource-types.d.ts.map +1 -0
  140. package/dist/cli/commands/sdk/utils/datasource-types.js +61 -0
  141. package/dist/cli/commands/sdk/utils/datasource-types.js.map +1 -0
  142. package/dist/cli/commands/sdk/utils/file-utils.d.ts +8 -0
  143. package/dist/cli/commands/sdk/utils/file-utils.d.ts.map +1 -0
  144. package/dist/cli/commands/sdk/utils/file-utils.js +21 -0
  145. package/dist/cli/commands/sdk/utils/file-utils.js.map +1 -0
  146. package/dist/cli/commands/sdk/utils/render.d.ts +82 -0
  147. package/dist/cli/commands/sdk/utils/render.d.ts.map +1 -0
  148. package/dist/cli/commands/sdk/utils/render.js +149 -0
  149. package/dist/cli/commands/sdk/utils/render.js.map +1 -0
  150. package/dist/cli/commands/sdk/workflows.d.ts +3 -0
  151. package/dist/cli/commands/sdk/workflows.d.ts.map +1 -0
  152. package/dist/cli/commands/sdk/workflows.js +170 -0
  153. package/dist/cli/commands/sdk/workflows.js.map +1 -0
  154. package/dist/cli/commands/setup.js +4 -0
  155. package/dist/cli/commands/setup.js.map +1 -1
  156. package/dist/cli/commands/shared/prompts/storage-scope.d.ts +2 -1
  157. package/dist/cli/commands/shared/prompts/storage-scope.d.ts.map +1 -1
  158. package/dist/cli/commands/shared/prompts/storage-scope.js +4 -3
  159. package/dist/cli/commands/shared/prompts/storage-scope.js.map +1 -1
  160. package/dist/cli/commands/skills/add.d.ts.map +1 -1
  161. package/dist/cli/commands/skills/add.js +28 -9
  162. package/dist/cli/commands/skills/add.js.map +1 -1
  163. package/dist/cli/commands/skills/lib/skills-sh-telemetry.d.ts +5 -0
  164. package/dist/cli/commands/skills/lib/skills-sh-telemetry.d.ts.map +1 -1
  165. package/dist/cli/commands/skills/lib/skills-sh-telemetry.js +22 -4
  166. package/dist/cli/commands/skills/lib/skills-sh-telemetry.js.map +1 -1
  167. package/dist/cli/commands/skills/setup/generators/claude-skill-generator.d.ts +3 -2
  168. package/dist/cli/commands/skills/setup/generators/claude-skill-generator.d.ts.map +1 -1
  169. package/dist/cli/commands/skills/setup/generators/claude-skill-generator.js +29 -14
  170. package/dist/cli/commands/skills/setup/generators/claude-skill-generator.js.map +1 -1
  171. package/dist/cli/commands/skills/setup/helpers.d.ts +3 -2
  172. package/dist/cli/commands/skills/setup/helpers.d.ts.map +1 -1
  173. package/dist/cli/commands/skills/setup/helpers.js +6 -8
  174. package/dist/cli/commands/skills/setup/helpers.js.map +1 -1
  175. package/dist/cli/commands/skills/setup/index.js +8 -16
  176. package/dist/cli/commands/skills/setup/index.js.map +1 -1
  177. package/dist/cli/commands/skills/setup/sync.d.ts.map +1 -1
  178. package/dist/cli/commands/skills/setup/sync.js +6 -5
  179. package/dist/cli/commands/skills/setup/sync.js.map +1 -1
  180. package/dist/cli/commands/uninstall.d.ts.map +1 -1
  181. package/dist/cli/commands/uninstall.js +17 -0
  182. package/dist/cli/commands/uninstall.js.map +1 -1
  183. package/dist/cli/index.js +2 -0
  184. package/dist/cli/index.js.map +1 -1
  185. package/dist/env/types.d.ts +11 -4
  186. package/dist/env/types.d.ts.map +1 -1
  187. package/dist/env/types.js +5 -0
  188. package/dist/env/types.js.map +1 -1
  189. package/dist/migrations/004-skills-assistants-top-level.migration.d.ts +10 -0
  190. package/dist/migrations/004-skills-assistants-top-level.migration.d.ts.map +1 -0
  191. package/dist/migrations/004-skills-assistants-top-level.migration.js +65 -0
  192. package/dist/migrations/004-skills-assistants-top-level.migration.js.map +1 -0
  193. package/dist/migrations/005-skill-slug-format.migration.d.ts +10 -0
  194. package/dist/migrations/005-skill-slug-format.migration.d.ts.map +1 -0
  195. package/dist/migrations/005-skill-slug-format.migration.js +82 -0
  196. package/dist/migrations/005-skill-slug-format.migration.js.map +1 -0
  197. package/dist/migrations/index.d.ts +2 -0
  198. package/dist/migrations/index.d.ts.map +1 -1
  199. package/dist/migrations/index.js +2 -2
  200. package/dist/migrations/index.js.map +1 -1
  201. package/dist/providers/core/codemie-auth-helpers.d.ts +4 -1
  202. package/dist/providers/core/codemie-auth-helpers.d.ts.map +1 -1
  203. package/dist/providers/core/codemie-auth-helpers.js +21 -18
  204. package/dist/providers/core/codemie-auth-helpers.js.map +1 -1
  205. package/dist/providers/plugins/anthropic-subscription/anthropic-subscription.setup-steps.d.ts.map +1 -1
  206. package/dist/providers/plugins/anthropic-subscription/anthropic-subscription.setup-steps.js +4 -2
  207. package/dist/providers/plugins/anthropic-subscription/anthropic-subscription.setup-steps.js.map +1 -1
  208. package/dist/providers/plugins/sso/proxy/plugins/endpoint-blocker.plugin.d.ts.map +1 -1
  209. package/dist/providers/plugins/sso/proxy/plugins/endpoint-blocker.plugin.js +14 -6
  210. package/dist/providers/plugins/sso/proxy/plugins/endpoint-blocker.plugin.js.map +1 -1
  211. package/dist/providers/plugins/sso/proxy/plugins/index.d.ts +1 -0
  212. package/dist/providers/plugins/sso/proxy/plugins/index.d.ts.map +1 -1
  213. package/dist/providers/plugins/sso/proxy/plugins/index.js +3 -0
  214. package/dist/providers/plugins/sso/proxy/plugins/index.js.map +1 -1
  215. package/dist/providers/plugins/sso/proxy/plugins/session-expiry-handler.plugin.d.ts +9 -0
  216. package/dist/providers/plugins/sso/proxy/plugins/session-expiry-handler.plugin.d.ts.map +1 -0
  217. package/dist/providers/plugins/sso/proxy/plugins/session-expiry-handler.plugin.js +23 -0
  218. package/dist/providers/plugins/sso/proxy/plugins/session-expiry-handler.plugin.js.map +1 -0
  219. package/dist/providers/plugins/sso/proxy/proxy-errors.d.ts.map +1 -1
  220. package/dist/providers/plugins/sso/proxy/proxy-errors.js +1 -2
  221. package/dist/providers/plugins/sso/proxy/proxy-errors.js.map +1 -1
  222. package/dist/providers/plugins/sso/proxy/sso.proxy.d.ts +10 -0
  223. package/dist/providers/plugins/sso/proxy/sso.proxy.d.ts.map +1 -1
  224. package/dist/providers/plugins/sso/proxy/sso.proxy.js +77 -2
  225. package/dist/providers/plugins/sso/proxy/sso.proxy.js.map +1 -1
  226. package/dist/providers/plugins/sso/session/processors/metrics/metrics-aggregator.js +1 -1
  227. package/dist/providers/plugins/sso/session/processors/metrics/metrics-aggregator.js.map +1 -1
  228. package/dist/providers/plugins/sso/session/processors/metrics/metrics-api-client.js +2 -2
  229. package/dist/providers/plugins/sso/session/processors/metrics/metrics-api-client.js.map +1 -1
  230. package/dist/providers/plugins/sso/session/processors/metrics/metrics-sync-processor.js +1 -1
  231. package/dist/providers/plugins/sso/session/processors/metrics/metrics-sync-processor.js.map +1 -1
  232. package/dist/providers/plugins/sso/sso.auth.d.ts.map +1 -1
  233. package/dist/providers/plugins/sso/sso.auth.js +10 -2
  234. package/dist/providers/plugins/sso/sso.auth.js.map +1 -1
  235. package/dist/providers/plugins/sso/sso.setup-steps.d.ts.map +1 -1
  236. package/dist/providers/plugins/sso/sso.setup-steps.js +3 -1
  237. package/dist/providers/plugins/sso/sso.setup-steps.js.map +1 -1
  238. package/dist/utils/config.d.ts +16 -11
  239. package/dist/utils/config.d.ts.map +1 -1
  240. package/dist/utils/config.js +87 -82
  241. package/dist/utils/config.js.map +1 -1
  242. package/dist/utils/paths.d.ts +5 -0
  243. package/dist/utils/paths.d.ts.map +1 -1
  244. package/dist/utils/paths.js +14 -0
  245. package/dist/utils/paths.js.map +1 -1
  246. package/dist/utils/profile.d.ts +0 -2
  247. package/dist/utils/profile.d.ts.map +1 -1
  248. package/dist/utils/profile.js +0 -5
  249. package/dist/utils/profile.js.map +1 -1
  250. package/dist/utils/security.d.ts.map +1 -1
  251. package/dist/utils/security.js +18 -8
  252. package/dist/utils/security.js.map +1 -1
  253. package/dist/utils/slug.d.ts +2 -0
  254. package/dist/utils/slug.d.ts.map +1 -0
  255. package/dist/utils/slug.js +6 -0
  256. package/dist/utils/slug.js.map +1 -0
  257. package/package.json +4 -2
  258. package/scripts/postinstall.mjs +52 -0
@@ -0,0 +1,191 @@
1
+ # Skills Examples
2
+
3
+ ## List
4
+
5
+ ```bash
6
+ # Default list (first 10)
7
+ codemie sdk skills list
8
+
9
+ # Paginate
10
+ codemie sdk skills list --page 2 --per-page 25
11
+
12
+ # Filter by scope
13
+ codemie sdk skills list --scope marketplace
14
+ codemie sdk skills list --scope project
15
+ codemie sdk skills list --scope project_with_marketplace
16
+
17
+ # JSON output
18
+ codemie sdk skills list --json
19
+ ```
20
+
21
+ **`--scope` values:** `marketplace`, `project`, `project_with_marketplace` (default returns all accessible)
22
+
23
+ **List columns:** ID, Name, Project, Visibility
24
+
25
+ **JSON fields (list):** `id`, `name`, `project`, `visibility`, `description`, `created_by`, `categories`, `createdDate`, `updatedDate`, `is_attached`, `assistants_count`, `user_abilities`, `unique_likes_count`, `unique_dislikes_count`
26
+
27
+ ## Get
28
+
29
+ ```bash
30
+ codemie sdk skills get 3d5b188f-185b-48df-b4b3-e608e4efb1ad
31
+ codemie sdk skills get 3d5b188f-185b-48df-b4b3-e608e4efb1ad --json
32
+ ```
33
+
34
+ **Additional fields in get:** `content` (full skill markdown), `toolkits`, `mcp_servers`
35
+
36
+ ## Create
37
+
38
+ ```bash
39
+ # Minimal required fields
40
+ codemie sdk skills create --data '{
41
+ "name": "my-skill",
42
+ "description": "Does something useful for the team.",
43
+ "content": "# My Skill\n\nInstructions here...",
44
+ "project": "MyProject"
45
+ }'
46
+
47
+ # Full example from file
48
+ codemie sdk skills create --json skill.json
49
+ ```
50
+
51
+ **Field reference:**
52
+
53
+ | Field | Required | Type | Description |
54
+ |-------|----------|------|-------------|
55
+ | `name` | ✅ | string | Kebab-case identifier, 3–64 chars (e.g. `"my-skill"`) |
56
+ | `description` | ✅ | string | 10–1000 chars |
57
+ | `content` | ✅ | string | Markdown skill instructions, minimum 100 chars |
58
+ | `project` | ✅ | string | Project to create the skill in |
59
+ | `visibility` | — | string | `"private"` (default), `"project"`, or `"public"` |
60
+ | `categories` | — | string[] | Max 3 category values (use `list-categories` to get valid values) |
61
+ | `toolkits` | — | array | Integration toolkits |
62
+ | `mcp_servers` | — | array | MCP server connections |
63
+
64
+ **Response:** returns the created `SkillDetail` object including its `id`.
65
+
66
+ ## Update
67
+
68
+ ```bash
69
+ codemie sdk skills update 3d5b188f-185b-48df-b4b3-e608e4efb1ad --data '{"description":"Updated description"}'
70
+ codemie sdk skills update 3d5b188f-185b-48df-b4b3-e608e4efb1ad --json updates.json
71
+ ```
72
+
73
+ All fields are optional on update — only provided fields are changed.
74
+
75
+ ## Delete
76
+
77
+ ```bash
78
+ # Always verify before deleting
79
+ codemie sdk skills get <id>
80
+ codemie sdk skills delete <id>
81
+ ```
82
+
83
+ ## Import / Export
84
+
85
+ ```bash
86
+ # Import a skill from a .md file with YAML frontmatter
87
+ codemie sdk skills import ./my-skill.md --project MyProject
88
+ codemie sdk skills import ./my-skill.md --project MyProject --visibility project
89
+
90
+ # Export a skill as markdown (pipe to file to save)
91
+ codemie sdk skills export <id>
92
+ codemie sdk skills export <id> > my-skill.md
93
+ ```
94
+
95
+ The import file must include YAML frontmatter with `name` and `description`:
96
+ ```markdown
97
+ ---
98
+ name: my-skill
99
+ description: What this skill does
100
+ ---
101
+
102
+ # Instructions
103
+ ...
104
+ ```
105
+
106
+ ## Attach / Detach Skills to Assistants
107
+
108
+ ```bash
109
+ # Attach a skill to an assistant
110
+ codemie sdk skills attach <assistant-id> <skill-id>
111
+
112
+ # Detach a skill from an assistant
113
+ codemie sdk skills detach <assistant-id> <skill-id>
114
+
115
+ # List all skills attached to an assistant
116
+ codemie sdk skills list-assistant-skills <assistant-id>
117
+ codemie sdk skills list-assistant-skills <assistant-id> --json
118
+
119
+ # Bulk attach one skill to multiple assistants
120
+ codemie sdk skills bulk-attach <skill-id> --assistant-ids <id1>,<id2>,<id3>
121
+
122
+ # List all assistants using a skill
123
+ codemie sdk skills get-assistants <skill-id>
124
+ codemie sdk skills get-assistants <skill-id> --json
125
+ ```
126
+
127
+ ## Publish / Unpublish
128
+
129
+ ```bash
130
+ # Publish to marketplace (no categories)
131
+ codemie sdk skills publish <id>
132
+
133
+ # Publish with categories (max 3, use values from list-categories)
134
+ codemie sdk skills publish <id> --categories development,testing
135
+
136
+ # Unpublish from marketplace
137
+ codemie sdk skills unpublish <id>
138
+ ```
139
+
140
+ ## Categories
141
+
142
+ ```bash
143
+ # List available skill categories (value + label)
144
+ codemie sdk skills list-categories
145
+ codemie sdk skills list-categories --json
146
+ ```
147
+
148
+ Use the `value` field from `list-categories` output when setting `categories` on create/update or publish.
149
+
150
+ ## Reactions
151
+
152
+ ```bash
153
+ # Like a skill
154
+ codemie sdk skills react <id> --reaction like
155
+
156
+ # Dislike a skill
157
+ codemie sdk skills react <id> --reaction dislike
158
+
159
+ # Remove all reactions
160
+ codemie sdk skills remove-reactions <id>
161
+ ```
162
+
163
+ ## Users
164
+
165
+ ```bash
166
+ # Get users with access to skills
167
+ codemie sdk skills get-users
168
+ codemie sdk skills get-users --json
169
+ ```
170
+
171
+ ## Scripting
172
+
173
+ ```bash
174
+ # Find skill ID by name
175
+ codemie sdk skills list --json | jq -r '.[] | select(.name == "my-skill") | .id'
176
+
177
+ # List all public skills
178
+ codemie sdk skills list --scope marketplace --json | jq -r '.[] | "\(.id) \(.name)"'
179
+
180
+ # Get skill content
181
+ codemie sdk skills get <id> --json | jq -r '.content'
182
+
183
+ # Create then get new skill ID
184
+ codemie sdk skills create --data '{"name":"my-skill","description":"Does X","content":"# My Skill\n\nInstructions...","project":"Eng"}'
185
+ ID=$(codemie sdk skills list --json | jq -r '.[] | select(.name == "my-skill") | .id')
186
+
187
+ # Attach a skill to all assistants in a project
188
+ codemie sdk assistants list --projects MyProject --json | jq -r '.[].id' | while read id; do
189
+ codemie sdk skills attach "$id" <skill-id>
190
+ done
191
+ ```
@@ -0,0 +1,38 @@
1
+ # Users Examples
2
+
3
+ ## Get current user profile
4
+
5
+ ```bash
6
+ codemie sdk users me
7
+ codemie sdk users me --json
8
+ ```
9
+
10
+ **JSON fields:** `user_id`, `name`, `username`, `email`, `is_admin`, `applications`, `applications_admin`, `picture`, `knowledge_bases`
11
+
12
+ ## Get current user data
13
+
14
+ ```bash
15
+ codemie sdk users data
16
+ codemie sdk users data --json
17
+ ```
18
+
19
+ **JSON fields:** `id`, `user_id`, `date`, `update_date`
20
+
21
+ ## Scripting
22
+
23
+ ```bash
24
+ # Get your username
25
+ codemie sdk users me --json | jq -r '.username'
26
+
27
+ # Get your user UUID
28
+ codemie sdk users me --json | jq -r '.user_id'
29
+
30
+ # Check if you are an admin
31
+ codemie sdk users me --json | jq -r '.is_admin'
32
+
33
+ # Get list of projects you have access to
34
+ codemie sdk users me --json | jq -r '.applications[]'
35
+
36
+ # Get list of projects where you are an admin
37
+ codemie sdk users me --json | jq -r '.applications_admin[]'
38
+ ```
@@ -0,0 +1,151 @@
1
+ # Workflows Examples
2
+
3
+ ## List
4
+
5
+ ```bash
6
+ # Basic list
7
+ codemie sdk workflows list
8
+
9
+ # Search and filter
10
+ codemie sdk workflows list --search 'Pipeline'
11
+ codemie sdk workflows list --projects Engineering
12
+ codemie sdk workflows list --page 0 --per-page 25 --json
13
+ ```
14
+
15
+ **List columns:** ID, Name, Project, Mode, Shared
16
+
17
+ ## Get
18
+
19
+ ```bash
20
+ codemie sdk workflows get 1d3d69bb-3a53-495b-b0e7-61826d10a947
21
+ codemie sdk workflows get 1d3d69bb-3a53-495b-b0e7-61826d10a947 --json
22
+ ```
23
+
24
+ **JSON fields:** `id`, `project`, `name`, `description`, `yaml_config`, `mode`, `shared`, `created_by`, `created_date`, `update_date`
25
+
26
+ ## Create
27
+
28
+ Workflows require both a `--data` JSON payload (metadata) and a `--config` YAML (graph definition).
29
+
30
+ ```bash
31
+ # Minimal required fields
32
+ codemie sdk workflows create \
33
+ --data '{"name":"My Workflow","project":"Engineering","mode":"Sequential","shared":true}' \
34
+ --config path/to/workflow.yaml
35
+
36
+ # All metadata inline
37
+ codemie sdk workflows create \
38
+ --data '{"name":"My Workflow","project":"Engineering","mode":"Sequential","shared":true,"description":"Automates deployment","icon_url":"https://example.com/icon.png"}' \
39
+ --config path/to/workflow.yaml
40
+
41
+ # From JSON file + YAML config
42
+ codemie sdk workflows create --json workflow-meta.json --config path/to/workflow.yaml
43
+ ```
44
+
45
+ **Field reference:**
46
+
47
+ | Field | Required | Type | Description |
48
+ |-------|----------|------|-------------|
49
+ | `name` | ✅ | string | Display name of the workflow |
50
+ | `project` | ✅ | string | Project the workflow belongs to |
51
+ | `yaml_config` | ✅ (via `--config`) | string | Workflow graph definition — pass as `--config` file path or inline YAML string |
52
+ | `mode` | ✅ | string | Execution mode: `"Sequential"` (step-by-step) |
53
+ | `shared` | ✅ | boolean | `true` = visible to all project members; `false` = private |
54
+ | `description` | — | string | Short description of the workflow's purpose |
55
+ | `icon_url` | — | string | URL to an image used as the workflow's icon |
56
+
57
+ > **`mode` values:**
58
+ > - `"Sequential"` — nodes execute in a defined order; each step waits for the previous
59
+
60
+ **`workflow-meta.json` example:**
61
+ ```json
62
+ {
63
+ "name": "Data Pipeline",
64
+ "project": "Analytics",
65
+ "description": "Processes incoming data streams",
66
+ "mode": "Sequential",
67
+ "shared": true
68
+ }
69
+ ```
70
+
71
+ **`workflow.yaml` example (minimal working format):**
72
+ ```yaml
73
+ custom_nodes: []
74
+ tools: []
75
+ assistants:
76
+ - id: my-node
77
+ model: gpt-4.1
78
+ system_prompt: You are a helpful assistant.
79
+ tools: []
80
+ states:
81
+ - id: my-node
82
+ assistant_id: my-node
83
+ task: Help the user with their request.
84
+ next:
85
+ state_id: end
86
+ resolve_dynamic_values_in_prompt: true
87
+ ```
88
+
89
+ > **Important:** Pass the YAML as an **inline string** via `--config`, not as a file path — file-based config is unreliable on some systems:
90
+ > ```bash
91
+ > codemie sdk workflows create \
92
+ > --data '{"name":"My Workflow","project":"MyProject","mode":"Sequential","shared":true}' \
93
+ > --config 'custom_nodes: []
94
+ > tools: []
95
+ > assistants:
96
+ > - id: my-node
97
+ > model: gpt-4.1
98
+ > system_prompt: You are a helpful assistant.
99
+ > tools: []
100
+ > states:
101
+ > - id: my-node
102
+ > assistant_id: my-node
103
+ > task: Help the user with their request.
104
+ > next:
105
+ > state_id: end
106
+ > resolve_dynamic_values_in_prompt: true'
107
+ > ```
108
+
109
+ Get available model names:
110
+ ```bash
111
+ codemie sdk llm list --json | jq -r '.[] | "\(.base_name) (\(.label))"'
112
+ ```
113
+
114
+ ## Update
115
+
116
+ ```bash
117
+ # Update metadata only (no reconfig of graph)
118
+ codemie sdk workflows update <id> --data '{"name":"Updated Pipeline","project":"Engineering","shared":false}'
119
+
120
+ # Update metadata and graph definition
121
+ codemie sdk workflows update <id> --json updates.json --config path/to/new-config.yaml
122
+ ```
123
+
124
+ **Update field reference:**
125
+
126
+ | Field | Required | Description |
127
+ |-------|----------|-------------|
128
+ | `name` | ✅ | Workflow display name |
129
+ | `project` | ✅ | Project the workflow belongs to |
130
+ | `yaml_config` | optional | New graph definition — only if changing the workflow structure |
131
+ | `mode` | optional | Change execution mode: `"Sequential"` |
132
+ | `shared` | optional | Change visibility |
133
+ | `description` | optional | Update description |
134
+ | `icon_url` | optional | Update icon URL |
135
+
136
+ ## Delete
137
+
138
+ ```bash
139
+ codemie sdk workflows get <id>
140
+ codemie sdk workflows delete <id>
141
+ ```
142
+
143
+ ## Scripting
144
+
145
+ ```bash
146
+ # Export workflow config
147
+ codemie sdk workflows get <id> --json > workflow-backup.json
148
+
149
+ # List workflows by project, get IDs
150
+ codemie sdk workflows list --projects DataPipeline --json | jq -r '.[].id'
151
+ ```
@@ -155,6 +155,16 @@ function saveCache(data) {
155
155
  fs.writeFileSync(CACHE_FILE, JSON.stringify(data, null, 2), { mode: 0o600 });
156
156
  }
157
157
 
158
+ // ── HTML helpers ──────────────────────────────────────────────────────────────
159
+ function escapeHtml(str) {
160
+ return String(str)
161
+ .replace(/&/g, '&amp;')
162
+ .replace(/</g, '&lt;')
163
+ .replace(/>/g, '&gt;')
164
+ .replace(/"/g, '&quot;')
165
+ .replace(/'/g, '&#x27;');
166
+ }
167
+
158
168
  // ── PKCE helpers ──────────────────────────────────────────────────────────────
159
169
  function generatePKCE() {
160
170
  const verifier = crypto.randomBytes(32).toString('base64url');
@@ -206,8 +216,8 @@ function startLocalServer() {
206
216
  </body></html>`
207
217
  : `<!DOCTYPE html><html><head><title>Login failed</title></head><body style="font-family:sans-serif;padding:40px">
208
218
  <h2 style="color:#d13438">&#10007; Authentication failed</h2>
209
- <p><strong>${error || 'Unknown error'}</strong></p>
210
- <p>${desc || ''}</p>
219
+ <p><strong>${error ? escapeHtml(error) : 'Unknown error'}</strong></p>
220
+ <p>${desc ? escapeHtml(desc) : ''}</p>
211
221
  </body></html>`;
212
222
 
213
223
  response.writeHead(200, { 'Content-Type': 'text/html; charset=utf-8' });
@@ -0,0 +1,216 @@
1
+ #!/usr/bin/env node
2
+ // CodeMie statusline — shows budget, project, branch, model, and context stats
3
+ // Deployed to ~/.claude/ by `codemie install statusline`. Runs standalone without the project runtime.
4
+ import crypto from 'crypto';
5
+ import { exec } from 'child_process';
6
+ import fs from 'fs/promises';
7
+ import os from 'os';
8
+ import path from 'path';
9
+
10
+ const HOME = process.env.CODEMIE_HOME || path.join(os.homedir(), '.codemie');
11
+ const CACHE_FILE = path.join(HOME, 'budget-cache.json');
12
+ const CONFIG_FILE = path.join(HOME, 'codemie-cli.config.json');
13
+ const CREDS_DIR = path.join(HOME, 'credentials');
14
+ const CACHE_TTL_MS = 60_000;
15
+
16
+ const ENCRYPTION_KEY = (() => {
17
+ const id = os.hostname() + os.platform() + os.arch();
18
+ const hex = crypto.createHash('sha256').update(id).digest('hex');
19
+ return crypto.createHash('sha256').update(hex).digest();
20
+ })();
21
+
22
+ function decrypt(text) {
23
+ const [ivHex, encHex] = text.split(':');
24
+ const iv = Buffer.from(ivHex, 'hex');
25
+ const d = crypto.createDecipheriv('aes-256-cbc', ENCRYPTION_KEY, iv);
26
+ return d.update(encHex, 'hex', 'utf8') + d.final('utf8');
27
+ }
28
+
29
+ function urlHash(rawUrl) {
30
+ const normalized = rawUrl.replace(/\/$/, '').toLowerCase();
31
+ return crypto.createHash('sha256').update(normalized).digest('hex');
32
+ }
33
+
34
+ async function readCredsFile(filePath) {
35
+ try {
36
+ return JSON.parse(decrypt(await fs.readFile(filePath, 'utf8')));
37
+ } catch {
38
+ return null;
39
+ }
40
+ }
41
+
42
+ async function getAuthHeaders(codeMieUrl) {
43
+ const hash = urlHash(codeMieUrl);
44
+
45
+ const sso = await readCredsFile(path.join(CREDS_DIR, `sso-${hash}.enc`));
46
+ if (sso?.cookies) {
47
+ return { cookie: Object.entries(sso.cookies).map(([k, v]) => `${k}=${v}`).join(';') };
48
+ }
49
+
50
+ const jwt = await readCredsFile(path.join(CREDS_DIR, `jwt-sso-${hash}.enc`));
51
+ if (jwt?.token) {
52
+ return { authorization: `Bearer ${jwt.token}` };
53
+ }
54
+
55
+ return null;
56
+ }
57
+
58
+ async function fetchBudget(baseUrl, headers, budgetName) {
59
+ const res = await fetch(`${baseUrl}/v1/analytics/budget_usage`, {
60
+ headers: { 'Content-Type': 'application/json', 'X-CodeMie-Client': 'codemie-cli', ...headers },
61
+ });
62
+ if (!res.ok) throw new Error(`HTTP ${res.status}`);
63
+
64
+ const json = await res.json();
65
+ const row = json?.data?.rows?.find(r => r.project_name === budgetName);
66
+ if (!row) throw new Error('row not found');
67
+
68
+ const pct = Math.round((row.current_spending / row.budget_limit) * 100);
69
+ return {
70
+ text: `$${row.current_spending.toFixed(2)}/$${row.budget_limit.toFixed(0)} (${pct}%)`,
71
+ pct,
72
+ };
73
+ }
74
+
75
+ const C = {
76
+ reset: '\x1b[0m',
77
+ purple: '\x1b[38;2;177;185;249m',
78
+ green: '\x1b[0;32m',
79
+ yellow: '\x1b[0;33m',
80
+ red: '\x1b[0;31m',
81
+ cyan: '\x1b[0;36m',
82
+ blue: '\x1b[0;94m',
83
+ gray: '\x1b[0;37m',
84
+ };
85
+
86
+ const c = (color, text) => `${color}${text}${C.reset}`;
87
+
88
+ function fmt(n) {
89
+ if (n >= 1_000_000) return `${(n / 1_000_000).toFixed(1)}M`;
90
+ if (n >= 1_000) return `${(n / 1_000).toFixed(1)}k`;
91
+ return String(n);
92
+ }
93
+
94
+ function budgetColor(pct) {
95
+ if (pct < 0) return C.yellow;
96
+ return pct > 85 ? C.red : pct > 30 ? C.yellow : C.green;
97
+ }
98
+
99
+ function buildStatusLine({ projectName, branch, model, ctxPct, tokIn, tokOut, budget, budgetPct }) {
100
+ const parts = [];
101
+
102
+ if (projectName) parts.push(c(C.purple, `[${projectName}]`));
103
+ if (budget) parts.push(c(budgetColor(budgetPct), budget));
104
+ if (branch) parts.push(c(C.blue, `(${branch})`));
105
+ if (model) parts.push(c(C.cyan, `[${model}]`));
106
+
107
+ const stats = [];
108
+ if (ctxPct != null) stats.push(`ctx:${ctxPct}%`);
109
+ if (tokIn != null) stats.push(`in:${fmt(tokIn)}`);
110
+ if (tokOut != null) stats.push(`out:${fmt(tokOut)}`);
111
+ if (stats.length) parts.push(c(C.gray, stats.join(' ')));
112
+
113
+ return parts.join(' | ');
114
+ }
115
+
116
+ function readStdin() {
117
+ return new Promise(resolve => {
118
+ let data = '';
119
+ process.stdin.setEncoding('utf8');
120
+ process.stdin.on('data', chunk => { data += chunk; });
121
+ process.stdin.on('end', () => resolve(data));
122
+ process.stdin.on('error', () => resolve(data));
123
+ });
124
+ }
125
+
126
+ function gitBranch(cwd) {
127
+ return new Promise(resolve => {
128
+ exec(
129
+ 'git --no-optional-locks symbolic-ref --short HEAD 2>/dev/null || git --no-optional-locks rev-parse --short HEAD 2>/dev/null',
130
+ { cwd, timeout: 2000 },
131
+ (_, stdout) => resolve(stdout.trim() || '')
132
+ );
133
+ });
134
+ }
135
+
136
+ async function main() {
137
+ const [stdinRaw, cacheRaw] = await Promise.all([
138
+ readStdin(),
139
+ fs.readFile(CACHE_FILE, 'utf8').catch(() => null),
140
+ ]);
141
+
142
+ let projectName = '', cwd = '', model = '', ctxPct = null, tokIn = null, tokOut = null;
143
+ try {
144
+ const ctx = JSON.parse(stdinRaw);
145
+ cwd = ctx?.workspace?.current_dir ?? ctx?.cwd ?? '';
146
+ projectName = path.basename(cwd);
147
+ model = ctx?.model?.display_name ?? '';
148
+ ctxPct = ctx?.context_window?.used_percentage ?? null;
149
+ tokIn = ctx?.context_window?.total_input_tokens ?? null;
150
+ tokOut = ctx?.context_window?.total_output_tokens ?? null;
151
+ } catch {}
152
+
153
+ const branchPromise = cwd ? gitBranch(cwd) : Promise.resolve('');
154
+
155
+ if (cacheRaw) {
156
+ try {
157
+ const cache = JSON.parse(cacheRaw);
158
+ if (Date.now() - cache.ts < CACHE_TTL_MS) {
159
+ const branch = await branchPromise;
160
+ process.stdout.write(buildStatusLine({
161
+ projectName, branch, model, ctxPct, tokIn, tokOut,
162
+ budget: cache.value, budgetPct: cache.pct ?? 0,
163
+ }));
164
+ return;
165
+ }
166
+ } catch {}
167
+ }
168
+
169
+ let budget = '', budgetPct = 0;
170
+
171
+ do {
172
+ let config;
173
+ try {
174
+ config = JSON.parse(await fs.readFile(CONFIG_FILE, 'utf8'));
175
+ } catch {
176
+ budget = '⚠ no config'; budgetPct = -1; break;
177
+ }
178
+
179
+ const profile = config.profiles?.[config.activeProfile];
180
+ if (!profile) { budget = '⚠ no profile'; budgetPct = -1; break; }
181
+
182
+ const { codeMieUrl, baseUrl, statuslineBudgetName } = profile;
183
+ if (!codeMieUrl || !baseUrl) {
184
+ budget = '⚠ incomplete profile'; budgetPct = -1; break;
185
+ }
186
+ if (!statuslineBudgetName) {
187
+ budget = '⚠ run: codemie install statusline'; budgetPct = -1; break;
188
+ }
189
+
190
+ const headers = await getAuthHeaders(codeMieUrl);
191
+ if (!headers) { budget = '⚠ Reauthenticate'; budgetPct = -1; break; }
192
+
193
+ const budgetResult = await fetchBudget(baseUrl, headers, statuslineBudgetName).catch(e => ({ error: e.message }));
194
+ if (budgetResult.error) {
195
+ budget = `⚠ ${budgetResult.error}`; budgetPct = -1; break;
196
+ }
197
+
198
+ await fs.writeFile(
199
+ CACHE_FILE,
200
+ JSON.stringify({ ts: Date.now(), value: budgetResult.text, pct: budgetResult.pct }),
201
+ 'utf8'
202
+ );
203
+
204
+ budget = budgetResult.text;
205
+ budgetPct = budgetResult.pct;
206
+ } while (false);
207
+
208
+ const branch = await branchPromise;
209
+
210
+ process.stdout.write(buildStatusLine({
211
+ projectName, branch, model, ctxPct, tokIn, tokOut,
212
+ budget, budgetPct,
213
+ }));
214
+ }
215
+
216
+ main();
@@ -0,0 +1,8 @@
1
+ export declare const STATUSLINE_NAME = "statusline";
2
+ export declare const STATUSLINE_DISPLAY_NAME = "CodeMie Statusline";
3
+ export declare const STATUSLINE_DESCRIPTION = "Budget usage, project, branch, model, context & token stats for Claude Code";
4
+ export declare function installStatusline(): Promise<string>;
5
+ export declare function uninstallStatusline(): Promise<void>;
6
+ export declare function isStatuslineInstalled(): boolean;
7
+ export declare function promptBudgetSelection(): Promise<boolean>;
8
+ //# sourceMappingURL=statusline-installer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"statusline-installer.d.ts","sourceRoot":"","sources":["../../../../src/agents/plugins/claude/statusline-installer.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,eAAe,eAAe,CAAC;AAC5C,eAAO,MAAM,uBAAuB,uBAAuB,CAAC;AAC5D,eAAO,MAAM,sBAAsB,gFAAgF,CAAC;AAKpH,wBAAsB,iBAAiB,IAAI,OAAO,CAAC,MAAM,CAAC,CA0CzD;AAED,wBAAsB,mBAAmB,IAAI,OAAO,CAAC,IAAI,CAAC,CA2BzD;AAED,wBAAgB,qBAAqB,IAAI,OAAO,CAE/C;AAED,wBAAsB,qBAAqB,IAAI,OAAO,CAAC,OAAO,CAAC,CAwD9D"}