@indemn/cli 1.6.0 → 1.7.1

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 (311) hide show
  1. package/.claude-plugin/marketplace.json +3 -3
  2. package/.claude-plugin/plugin.json +9 -4
  3. package/.github/workflows/ci.yml +10 -0
  4. package/.github/workflows/publish.yml +2 -2
  5. package/.mcp.json +1 -4
  6. package/CONTRIBUTING.md +3 -1
  7. package/README.md +69 -176
  8. package/dist/cli/agents.d.ts.map +1 -1
  9. package/dist/cli/agents.js +226 -18
  10. package/dist/cli/agents.js.map +1 -1
  11. package/dist/cli/analytics.d.ts +3 -0
  12. package/dist/cli/analytics.d.ts.map +1 -0
  13. package/dist/cli/analytics.js +133 -0
  14. package/dist/cli/analytics.js.map +1 -0
  15. package/dist/cli/auth.d.ts.map +1 -1
  16. package/dist/cli/auth.js +62 -17
  17. package/dist/cli/auth.js.map +1 -1
  18. package/dist/cli/billing.d.ts +3 -0
  19. package/dist/cli/billing.d.ts.map +1 -0
  20. package/dist/cli/billing.js +23 -0
  21. package/dist/cli/billing.js.map +1 -0
  22. package/dist/cli/campaigns.d.ts +3 -0
  23. package/dist/cli/campaigns.d.ts.map +1 -0
  24. package/dist/cli/campaigns.js +34 -0
  25. package/dist/cli/campaigns.js.map +1 -0
  26. package/dist/cli/chat.d.ts.map +1 -1
  27. package/dist/cli/chat.js +69 -102
  28. package/dist/cli/chat.js.map +1 -1
  29. package/dist/cli/config.d.ts.map +1 -1
  30. package/dist/cli/config.js +71 -27
  31. package/dist/cli/config.js.map +1 -1
  32. package/dist/cli/conversations.d.ts +3 -0
  33. package/dist/cli/conversations.d.ts.map +1 -0
  34. package/dist/cli/conversations.js +129 -0
  35. package/dist/cli/conversations.js.map +1 -0
  36. package/dist/cli/distribution.d.ts +3 -0
  37. package/dist/cli/distribution.d.ts.map +1 -0
  38. package/dist/cli/distribution.js +122 -0
  39. package/dist/cli/distribution.js.map +1 -0
  40. package/dist/cli/eval.d.ts.map +1 -1
  41. package/dist/cli/eval.js +315 -71
  42. package/dist/cli/eval.js.map +1 -1
  43. package/dist/cli/functions.d.ts.map +1 -1
  44. package/dist/cli/functions.js +109 -38
  45. package/dist/cli/functions.js.map +1 -1
  46. package/dist/cli/index.js +63 -54
  47. package/dist/cli/index.js.map +1 -1
  48. package/dist/cli/init.d.ts +27 -0
  49. package/dist/cli/init.d.ts.map +1 -0
  50. package/dist/cli/init.js +152 -0
  51. package/dist/cli/init.js.map +1 -0
  52. package/dist/cli/kb.d.ts.map +1 -1
  53. package/dist/cli/kb.js +141 -15
  54. package/dist/cli/kb.js.map +1 -1
  55. package/dist/cli/link.d.ts +21 -0
  56. package/dist/cli/link.d.ts.map +1 -0
  57. package/dist/cli/link.js +112 -0
  58. package/dist/cli/link.js.map +1 -0
  59. package/dist/cli/org.d.ts.map +1 -1
  60. package/dist/cli/org.js +79 -67
  61. package/dist/cli/org.js.map +1 -1
  62. package/dist/cli/platform.d.ts +3 -0
  63. package/dist/cli/platform.d.ts.map +1 -0
  64. package/dist/cli/platform.js +133 -0
  65. package/dist/cli/platform.js.map +1 -0
  66. package/dist/cli/tickets.d.ts +3 -0
  67. package/dist/cli/tickets.d.ts.map +1 -0
  68. package/dist/cli/tickets.js +125 -0
  69. package/dist/cli/tickets.js.map +1 -0
  70. package/dist/cli/utils/output.d.ts +15 -9
  71. package/dist/cli/utils/output.d.ts.map +1 -1
  72. package/dist/cli/utils/output.js +53 -46
  73. package/dist/cli/utils/output.js.map +1 -1
  74. package/dist/cli/voice.d.ts +3 -0
  75. package/dist/cli/voice.d.ts.map +1 -0
  76. package/dist/cli/voice.js +206 -0
  77. package/dist/cli/voice.js.map +1 -0
  78. package/dist/core/diff.d.ts +16 -0
  79. package/dist/core/diff.d.ts.map +1 -0
  80. package/dist/core/diff.js +57 -0
  81. package/dist/core/diff.js.map +1 -0
  82. package/dist/core/org-resolver.d.ts +37 -0
  83. package/dist/core/org-resolver.d.ts.map +1 -0
  84. package/dist/core/org-resolver.js +73 -0
  85. package/dist/core/org-resolver.js.map +1 -0
  86. package/dist/core/runtime.d.ts +36 -0
  87. package/dist/core/runtime.d.ts.map +1 -0
  88. package/dist/core/runtime.js +62 -0
  89. package/dist/core/runtime.js.map +1 -0
  90. package/dist/core/scope.d.ts +33 -0
  91. package/dist/core/scope.d.ts.map +1 -0
  92. package/dist/core/scope.js +37 -0
  93. package/dist/core/scope.js.map +1 -0
  94. package/dist/mcp/registry.d.ts +67 -0
  95. package/dist/mcp/registry.d.ts.map +1 -0
  96. package/dist/mcp/registry.js +195 -0
  97. package/dist/mcp/registry.js.map +1 -0
  98. package/dist/mcp/server.d.ts +9 -0
  99. package/dist/mcp/server.d.ts.map +1 -1
  100. package/dist/mcp/server.js +87 -2
  101. package/dist/mcp/server.js.map +1 -1
  102. package/dist/mcp/tool-meta.d.ts +21 -0
  103. package/dist/mcp/tool-meta.d.ts.map +1 -0
  104. package/dist/mcp/tool-meta.js +203 -0
  105. package/dist/mcp/tool-meta.js.map +1 -0
  106. package/dist/mcp/tools.d.ts +2 -1
  107. package/dist/mcp/tools.d.ts.map +1 -1
  108. package/dist/mcp/tools.js +1462 -215
  109. package/dist/mcp/tools.js.map +1 -1
  110. package/dist/sdk/agent-bundle.d.ts +99 -0
  111. package/dist/sdk/agent-bundle.d.ts.map +1 -0
  112. package/dist/sdk/agent-bundle.js +211 -0
  113. package/dist/sdk/agent-bundle.js.map +1 -0
  114. package/dist/sdk/agents.d.ts +54 -1
  115. package/dist/sdk/agents.d.ts.map +1 -1
  116. package/dist/sdk/agents.js +59 -5
  117. package/dist/sdk/agents.js.map +1 -1
  118. package/dist/sdk/analytics.d.ts +158 -0
  119. package/dist/sdk/analytics.d.ts.map +1 -0
  120. package/dist/sdk/analytics.js +185 -0
  121. package/dist/sdk/analytics.js.map +1 -0
  122. package/dist/sdk/auth.d.ts +34 -12
  123. package/dist/sdk/auth.d.ts.map +1 -1
  124. package/dist/sdk/auth.js +62 -79
  125. package/dist/sdk/auth.js.map +1 -1
  126. package/dist/sdk/billing.d.ts +25 -0
  127. package/dist/sdk/billing.d.ts.map +1 -0
  128. package/dist/sdk/billing.js +61 -0
  129. package/dist/sdk/billing.js.map +1 -0
  130. package/dist/sdk/campaigns.d.ts +35 -0
  131. package/dist/sdk/campaigns.d.ts.map +1 -0
  132. package/dist/sdk/campaigns.js +59 -0
  133. package/dist/sdk/campaigns.js.map +1 -0
  134. package/dist/sdk/chat.d.ts +25 -2
  135. package/dist/sdk/chat.d.ts.map +1 -1
  136. package/dist/sdk/chat.js +37 -10
  137. package/dist/sdk/chat.js.map +1 -1
  138. package/dist/sdk/client.d.ts +93 -5
  139. package/dist/sdk/client.d.ts.map +1 -1
  140. package/dist/sdk/client.js +362 -100
  141. package/dist/sdk/client.js.map +1 -1
  142. package/dist/sdk/config-change.d.ts +74 -0
  143. package/dist/sdk/config-change.d.ts.map +1 -0
  144. package/dist/sdk/config-change.js +117 -0
  145. package/dist/sdk/config-change.js.map +1 -0
  146. package/dist/sdk/config.d.ts.map +1 -1
  147. package/dist/sdk/config.js +2 -1
  148. package/dist/sdk/config.js.map +1 -1
  149. package/dist/sdk/conversations.d.ts +101 -0
  150. package/dist/sdk/conversations.d.ts.map +1 -0
  151. package/dist/sdk/conversations.js +155 -0
  152. package/dist/sdk/conversations.js.map +1 -0
  153. package/dist/sdk/credentials.d.ts +25 -0
  154. package/dist/sdk/credentials.d.ts.map +1 -0
  155. package/dist/sdk/credentials.js +44 -0
  156. package/dist/sdk/credentials.js.map +1 -0
  157. package/dist/sdk/distribution.d.ts +94 -0
  158. package/dist/sdk/distribution.d.ts.map +1 -0
  159. package/dist/sdk/distribution.js +100 -0
  160. package/dist/sdk/distribution.js.map +1 -0
  161. package/dist/sdk/eval.d.ts +81 -0
  162. package/dist/sdk/eval.d.ts.map +1 -1
  163. package/dist/sdk/eval.js +117 -0
  164. package/dist/sdk/eval.js.map +1 -1
  165. package/dist/sdk/functions.d.ts +14 -1
  166. package/dist/sdk/functions.d.ts.map +1 -1
  167. package/dist/sdk/functions.js +48 -5
  168. package/dist/sdk/functions.js.map +1 -1
  169. package/dist/sdk/index.d.ts +2 -0
  170. package/dist/sdk/index.d.ts.map +1 -1
  171. package/dist/sdk/index.js +2 -0
  172. package/dist/sdk/index.js.map +1 -1
  173. package/dist/sdk/jarvis-chat.d.ts +28 -0
  174. package/dist/sdk/jarvis-chat.d.ts.map +1 -0
  175. package/dist/sdk/jarvis-chat.js +117 -0
  176. package/dist/sdk/jarvis-chat.js.map +1 -0
  177. package/dist/sdk/kb.d.ts +69 -1
  178. package/dist/sdk/kb.d.ts.map +1 -1
  179. package/dist/sdk/kb.js +111 -24
  180. package/dist/sdk/kb.js.map +1 -1
  181. package/dist/sdk/orgs.d.ts +13 -0
  182. package/dist/sdk/orgs.d.ts.map +1 -0
  183. package/dist/sdk/orgs.js +59 -0
  184. package/dist/sdk/orgs.js.map +1 -0
  185. package/dist/sdk/platform.d.ts +62 -0
  186. package/dist/sdk/platform.d.ts.map +1 -0
  187. package/dist/sdk/platform.js +95 -0
  188. package/dist/sdk/platform.js.map +1 -0
  189. package/dist/sdk/session.d.ts +25 -0
  190. package/dist/sdk/session.d.ts.map +1 -0
  191. package/dist/sdk/session.js +69 -0
  192. package/dist/sdk/session.js.map +1 -0
  193. package/dist/sdk/skills.d.ts +46 -0
  194. package/dist/sdk/skills.d.ts.map +1 -0
  195. package/dist/sdk/skills.js +203 -0
  196. package/dist/sdk/skills.js.map +1 -0
  197. package/dist/sdk/test-chat.d.ts +52 -0
  198. package/dist/sdk/test-chat.d.ts.map +1 -0
  199. package/dist/sdk/test-chat.js +134 -0
  200. package/dist/sdk/test-chat.js.map +1 -0
  201. package/dist/sdk/tickets.d.ts +98 -0
  202. package/dist/sdk/tickets.d.ts.map +1 -0
  203. package/dist/sdk/tickets.js +91 -0
  204. package/dist/sdk/tickets.js.map +1 -0
  205. package/dist/sdk/types.d.ts +91 -6
  206. package/dist/sdk/types.d.ts.map +1 -1
  207. package/dist/sdk/voice.d.ts +147 -0
  208. package/dist/sdk/voice.d.ts.map +1 -0
  209. package/dist/sdk/voice.js +236 -0
  210. package/dist/sdk/voice.js.map +1 -0
  211. package/package.json +21 -4
  212. package/scripts/check-skills.mjs +25 -0
  213. package/skills/agent-builder/SKILL.md +89 -252
  214. package/skills/evaluations/SKILL.md +23 -234
  215. package/skills/evaluations/references/analysis.md +95 -0
  216. package/skills/evaluations/references/cli-reference.md +28 -0
  217. package/skills/evaluations/references/json-formats.md +100 -0
  218. package/src/cli/agents.ts +202 -22
  219. package/src/cli/analytics.ts +138 -0
  220. package/src/cli/auth.ts +56 -18
  221. package/src/cli/billing.ts +25 -0
  222. package/src/cli/campaigns.ts +33 -0
  223. package/src/cli/chat.ts +66 -115
  224. package/src/cli/config.ts +65 -31
  225. package/src/cli/conversations.ts +133 -0
  226. package/src/cli/distribution.ts +116 -0
  227. package/src/cli/eval.ts +254 -70
  228. package/src/cli/functions.ts +105 -39
  229. package/src/cli/index.ts +58 -55
  230. package/src/cli/init.ts +154 -0
  231. package/src/cli/kb.ts +120 -17
  232. package/src/cli/link.ts +117 -0
  233. package/src/cli/org.ts +81 -75
  234. package/src/cli/platform.ts +128 -0
  235. package/src/cli/tickets.ts +130 -0
  236. package/src/cli/utils/output.ts +51 -42
  237. package/src/cli/voice.ts +204 -0
  238. package/src/core/diff.ts +52 -0
  239. package/src/core/org-resolver.ts +113 -0
  240. package/src/core/runtime.ts +73 -0
  241. package/src/core/scope.ts +64 -0
  242. package/src/mcp/registry.ts +236 -0
  243. package/src/mcp/server.ts +84 -2
  244. package/src/mcp/tool-meta.ts +241 -0
  245. package/src/mcp/tools.ts +1529 -265
  246. package/src/sdk/agent-bundle.ts +245 -0
  247. package/src/sdk/agents.ts +74 -5
  248. package/src/sdk/analytics.ts +220 -0
  249. package/src/sdk/auth.ts +89 -109
  250. package/src/sdk/billing.ts +59 -0
  251. package/src/sdk/campaigns.ts +60 -0
  252. package/src/sdk/chat.ts +44 -10
  253. package/src/sdk/client.ts +373 -102
  254. package/src/sdk/config-change.ts +148 -0
  255. package/src/sdk/config.ts +2 -1
  256. package/src/sdk/conversations.ts +199 -0
  257. package/src/sdk/credentials.ts +53 -0
  258. package/src/sdk/distribution.ts +132 -0
  259. package/src/sdk/eval.ts +140 -0
  260. package/src/sdk/functions.ts +52 -6
  261. package/src/sdk/index.ts +2 -0
  262. package/src/sdk/jarvis-chat.ts +112 -0
  263. package/src/sdk/kb.ts +116 -29
  264. package/src/sdk/orgs.ts +62 -0
  265. package/src/sdk/platform.ts +115 -0
  266. package/src/sdk/session.ts +90 -0
  267. package/src/sdk/skills.ts +188 -0
  268. package/src/sdk/test-chat.ts +151 -0
  269. package/src/sdk/tickets.ts +120 -0
  270. package/src/sdk/types.ts +88 -6
  271. package/src/sdk/voice.ts +262 -0
  272. package/test/cli/entry.test.ts +34 -0
  273. package/test/cli/init.test.ts +66 -0
  274. package/test/cli/link.test.ts +57 -0
  275. package/test/core/org-resolver.test.ts +92 -0
  276. package/test/core/runtime.test.ts +30 -0
  277. package/test/core/scope.test.ts +93 -0
  278. package/test/harness.test.ts +24 -0
  279. package/test/helpers/config-home.ts +22 -0
  280. package/test/helpers/fake-middleware.ts +56 -0
  281. package/test/helpers/fetch-recorder.ts +75 -0
  282. package/test/helpers/jwt.ts +9 -0
  283. package/test/helpers/mcp-pair.ts +38 -0
  284. package/test/mcp/__snapshots__/tools-snapshot.test.ts.snap +145 -0
  285. package/test/mcp/askers.test.ts +60 -0
  286. package/test/mcp/elicit-timeout.test.ts +29 -0
  287. package/test/mcp/registry.test.ts +169 -0
  288. package/test/mcp/shaping.test.ts +41 -0
  289. package/test/mcp/tools-snapshot.test.ts +42 -0
  290. package/test/sdk/agents.test.ts +232 -0
  291. package/test/sdk/analytics.test.ts +89 -0
  292. package/test/sdk/auth.test.ts +70 -0
  293. package/test/sdk/billing.test.ts +47 -0
  294. package/test/sdk/campaigns.test.ts +43 -0
  295. package/test/sdk/client.test.ts +80 -0
  296. package/test/sdk/config-change.test.ts +142 -0
  297. package/test/sdk/conversations.test.ts +80 -0
  298. package/test/sdk/credentials.test.ts +33 -0
  299. package/test/sdk/distribution.test.ts +55 -0
  300. package/test/sdk/eval.test.ts +155 -0
  301. package/test/sdk/kb-upload.test.ts +50 -0
  302. package/test/sdk/kb.test.ts +95 -0
  303. package/test/sdk/orgs.test.ts +48 -0
  304. package/test/sdk/platform.test.ts +89 -0
  305. package/test/sdk/renewal.test.ts +115 -0
  306. package/test/sdk/session.test.ts +60 -0
  307. package/test/sdk/skills.test.ts +235 -0
  308. package/test/sdk/test-chat.test.ts +112 -0
  309. package/test/sdk/tickets.test.ts +42 -0
  310. package/test/sdk/voice.test.ts +147 -0
  311. package/vitest.config.ts +11 -0
@@ -5,12 +5,12 @@
5
5
  "name": "Indemn",
6
6
  "email": "support@indemn.com"
7
7
  },
8
- "version": "1.0.0",
8
+ "version": "1.7.1",
9
9
  "plugins": [
10
10
  {
11
11
  "name": "indemn-cli",
12
- "description": "Manage Indemn AI agents — create, configure, evaluate, and chat with agents programmatically",
13
- "version": "1.0.0",
12
+ "description": "Manage Indemn AI agents \u2014 create, configure, evaluate, and chat with agents programmatically",
13
+ "version": "1.7.1",
14
14
  "author": {
15
15
  "name": "Indemn",
16
16
  "email": "support@indemn.com"
@@ -1,13 +1,18 @@
1
1
  {
2
2
  "name": "indemn-cli",
3
- "version": "1.0.0",
4
- "description": "Manage Indemn AI agents — create, configure, evaluate, and chat with agents programmatically",
3
+ "version": "1.7.1",
4
+ "description": "Manage Indemn AI agents \u2014 create, configure, evaluate, and chat with agents programmatically",
5
5
  "author": {
6
6
  "name": "Indemn",
7
7
  "email": "support@indemn.com"
8
8
  },
9
- "homepage": "https://docs.indemn.com/cli",
9
+ "homepage": "https://github.com/indemn-ai/indemn-cli#readme",
10
10
  "repository": "https://github.com/indemn-ai/indemn-cli",
11
11
  "license": "MIT",
12
- "keywords": ["ai-agents", "insurance", "evaluations", "indemn"]
12
+ "keywords": [
13
+ "ai-agents",
14
+ "insurance",
15
+ "evaluations",
16
+ "indemn"
17
+ ]
13
18
  }
@@ -18,3 +18,13 @@ jobs:
18
18
  - run: npm ci
19
19
  - run: npm run build
20
20
  - run: npm test
21
+ - run: npm run check:skills
22
+ - uses: actions/setup-python@v5
23
+ with:
24
+ python-version: '3.12'
25
+ - name: Validate skills (Agent Skills reference validator)
26
+ run: |
27
+ pip install skills-ref==0.1.1
28
+ for dir in skills/*/; do agentskills validate "$dir"; done
29
+ - name: CLI starts and reports its version
30
+ run: node dist/cli/index.js --version
@@ -9,6 +9,7 @@ jobs:
9
9
  runs-on: ubuntu-latest
10
10
  permissions:
11
11
  contents: read
12
+ id-token: write # npm trusted publishing (OIDC), no NPM_TOKEN needed
12
13
  steps:
13
14
  - uses: actions/checkout@v4
14
15
  - uses: actions/setup-node@v4
@@ -16,9 +17,8 @@ jobs:
16
17
  node-version: 22
17
18
  cache: npm
18
19
  registry-url: https://registry.npmjs.org
20
+ - run: npm install -g npm@11 # trusted publishing needs npm >= 11.5.1; pinned to major
19
21
  - run: npm ci
20
22
  - run: npm run build
21
23
  - run: npm test
22
24
  - run: npm publish --access public
23
- env:
24
- NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
package/.mcp.json CHANGED
@@ -1,9 +1,6 @@
1
1
  {
2
2
  "indemn": {
3
3
  "command": "npx",
4
- "args": ["@indemn/cli", "mcp", "serve"],
5
- "env": {
6
- "INDEMN_API_KEY": "${INDEMN_API_KEY}"
7
- }
4
+ "args": ["@indemn/cli", "mcp", "serve"]
8
5
  }
9
6
  }
package/CONTRIBUTING.md CHANGED
@@ -57,4 +57,6 @@ Open GitHub issues for bugs, feature requests, or questions. Include:
57
57
 
58
58
  ## Publishing
59
59
 
60
- CI/CD handles publishing to npm on merge to main (once set up). Do not publish manually unless necessary.
60
+ CI/CD publishes `@indemn/cli` to npm on every push to the `prod` branch (`.github/workflows/publish.yml`, through npm Trusted Publishing (OIDC); there is no npm token). Bump `version` in `package.json`, `.claude-plugin/plugin.json` and `.claude-plugin/marketplace.json` (a test keeps them equal) before releasing; npm rejects republishing an existing version, so a push to `prod` without a bump fails. Do not publish manually from a laptop.
61
+
62
+ The package is owned by the `@indemn` npm organization, not an individual account.
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @indemn/cli
2
2
 
3
- CLI, MCP server, and Claude Code plugin for managing Indemn AI agents. Create, configure, evaluate, and chat with agents programmatically.
3
+ CLI, MCP server and Claude Code plugin for Indemn AI agents. Create and configure agents, test them by chatting, run evaluations, and reach every area of the platform from a terminal or from an AI assistant.
4
4
 
5
5
  ## Install
6
6
 
@@ -8,224 +8,117 @@ CLI, MCP server, and Claude Code plugin for managing Indemn AI agents. Create, c
8
8
  npm install -g @indemn/cli
9
9
  ```
10
10
 
11
- ## Authenticate
11
+ ## Log in
12
12
 
13
13
  ```bash
14
- indemn login --env dev
15
- # Enter your Indemn email and password
16
- # MFA code will be sent to your email if enabled
14
+ indemn login --env dev # or --env production
15
+ indemn whoami
17
16
  ```
18
17
 
19
- This does a one-time Firebase login, generates a persistent API key, and saves it to `~/.indemn/config.json`. You won't need to log in again.
18
+ Login keeps the same session the dashboard uses; no API key is created. The session is stored in `~/.indemn/config.json` (readable only by you). It renews itself when it nears its expiry (if the platform sets one) or when the platform rejects it; accounts with MFA are asked for the emailed code at renewal. `indemn whoami` shows when the session ends, if it has an end. When renewal is impossible (password changed, access removed), commands stop with exit code 3 and ask you to log in again. `indemn logout` revokes the session on the server.
20
19
 
21
- ## Verify
20
+ The platform (dev or production) is the one you logged in to. There is no per-command switch.
22
21
 
23
- ```bash
24
- indemn whoami # shows your user, org, environment
25
- indemn agents list # lists your agents
26
- ```
27
-
28
- ## Quick Start
29
-
30
- ```bash
31
- # Create an agent
32
- indemn agents create --name "My Insurance Bot"
33
-
34
- # Set its prompt
35
- indemn config set <agent-id> --prompt "You are a helpful insurance assistant."
36
-
37
- # Chat with it
38
- indemn chat <agent-id>
39
-
40
- # Run evaluations
41
- indemn eval run <agent-id> --test-set <id> --rubric <id> --wait
42
- ```
22
+ ## Organizations
43
23
 
44
- ## Command Reference
24
+ You may belong to several organizations. Commands never guess which one:
45
25
 
46
- ### Authentication
47
- ```bash
48
- indemn login [--env dev|production] # Authenticate via Firebase
49
- indemn logout # Clear stored credentials
50
- indemn whoami # Show current user/org/env
51
- ```
26
+ 1. `--org <id>` on the command, or `org_id` on an MCP tool;
27
+ 2. otherwise the folder's link, made with `indemn link --org <id> [agent-ids...]` (writes `.indemn/project.json`; linked folders refuse agents not on the list);
28
+ 3. otherwise your only org;
29
+ 4. otherwise the CLI asks, or exits with code 2 and lists your orgs.
52
30
 
53
- ### Agent Management
54
31
  ```bash
55
- indemn agents list [--json] [--limit N]
56
- indemn agents get <id> [--json]
57
- indemn agents create --name "..." [--channels WEB,VOICE]
58
- indemn agents update <id> [--name] [--description] [--webhook-url]
59
- indemn agents delete <id>
60
- indemn agents clone <id>
32
+ indemn org list | current | members
33
+ indemn link --org <org-id> <agent-id>
34
+ indemn unlink
61
35
  ```
62
36
 
63
- ### Configuration
64
- ```bash
65
- indemn config get <agent-id> [--field prompt|greeting|model] [--json]
66
- indemn config set <agent-id> [--prompt "..."] [--prompt-file path] [--model "..."]
67
- ```
37
+ ## Safety
68
38
 
69
- ### Functions
70
- ```bash
71
- indemn functions list <agent-id> [--json]
72
- indemn functions create <agent-id> --type rest_api --description "..."
73
- indemn functions update <agent-id> <func-id> [--description "..."]
74
- indemn functions delete <agent-id> <func-id>
75
- indemn functions test <agent-id> <func-id>
76
- indemn functions export <agent-id>
77
- indemn functions import <agent-id> --url "..."
78
- indemn functions master-list # list master function templates
79
- indemn functions params list <agent-id> <func-id>
80
- indemn functions params add <agent-id> <func-id> --name "..." --type string [--required]
81
- indemn functions params update <agent-id> <func-id> <param-id> [--description "..."]
82
- indemn functions params delete <agent-id> <func-id> <param-id>
83
- ```
84
-
85
- ### Knowledge Bases
86
- ```bash
87
- indemn kb list [--json] [--limit N] [--page N]
88
- indemn kb create --name "..." --type qna
89
- indemn kb get <kb-id>
90
- indemn kb update <kb-id> [--name "..."]
91
- indemn kb delete <kb-id>
92
- indemn kb data list <kb-id>
93
- indemn kb data add <kb-id> --question "..." --answer "..." # QnA data
94
- indemn kb data add <kb-id> --source-url "https://..." # URL scraping
95
- indemn kb data add <kb-id> --file /path/to/file.pdf # file upload
96
- indemn kb link <agent-id> <kb-id> [kb-id...]
97
- indemn kb unlink <agent-id> <kb-id>
98
- indemn kb export <kb-id> [--format csv]
99
- ```
39
+ - **Every chat is a test conversation.** `indemn chat` and the MCP `chat_with_agent` mark the conversation as a test, show the tester's name in the dashboard, and read the stored conversation back before the first message; if it was stored as live or in another org, nothing is sent.
40
+ - **Changes ask first.** Deleting, importing, replacing a prompt or model, changing lifecycle, attaching numbers and starting paid runs show what would happen and ask. Scripts pass `--yes`. Published agents also need `--confirm-published`, and an agent whose status cannot be read is treated as published. Changing a skill or the webhook of an agent that may be live asks first too. MCP tools return a dry run until the user agrees; hosts that support elicitation ask the user directly.
41
+ - **Read-only areas.** Billing and campaigns are read-only. Phone numbers are bought only after a person confirms that exact number (`agents numbers buy`, or the approval form in MCP; an AI cannot confirm a purchase itself); searching is free. Shared V2 catalogs (components, connectors) are read-only.
42
+ - **Exit codes.** 0 success, 1 error, 2 a choice is needed, 3 log in again.
100
43
 
101
- ### Evaluations
102
- ```bash
103
- indemn eval run <agent-id> --test-set <id> [--rubric <id>] [--wait] [--eval-model gpt-4o] [--limit N]
104
- indemn eval list [--agent-id <id>] [--json] [--limit N]
105
- indemn eval status <run-id> [--json]
106
- indemn eval results <run-id> [--json]
107
- indemn eval bot-context <agent-id> [--json]
108
- ```
44
+ ## Commands
109
45
 
110
- ### Rubrics & Test Sets
111
- ```bash
112
- indemn rubric list [--agent-id <id>]
113
- indemn rubric create --file rubric.json
114
- indemn rubric get <id> [--revision N]
115
- indemn rubric update <id> --file rubric.json
116
- indemn rubric delete <id>
117
- indemn rubric versions <id>
118
-
119
- indemn testset list --agent-id <id> # --agent-id required
120
- indemn testset create --file testset.json
121
- indemn testset get <id> [--revision N]
122
- indemn testset update <id> --file testset.json
123
- indemn testset delete <id>
124
- indemn testset versions <id>
125
- ```
46
+ | Area | Commands |
47
+ |---|---|
48
+ | Login and orgs | `login`, `logout`, `whoami`, `org list\|current\|members\|switch\|config`, `link`, `unlink`, `channels list` |
49
+ | Agents | `agents list\|get\|create\|update\|delete\|clone\|summary\|stats\|lifecycle\|owner\|export\|import\|embed\|card` |
50
+ | Prompt and model | `config get\|set` (diff, `--dry-run`, `--yes`), `models` |
51
+ | Skills | `skills list\|create\|update\|delete\|test\|export\|import\|generate\|bulk-create\|params` (alias `functions`) |
52
+ | Knowledge bases | `kb list\|get\|create\|update\|delete\|link\|unlink\|export\|import\|status\|gaps\|check`, `kb data list\|add\|update\|delete\|chunks\|reimport` |
53
+ | Chat and conversations | `chat`, `conversations list\|get\|export [--as-testset]\|mark-test` |
54
+ | Voice | `voices list\|filters\|play`, `voice-models list`, `agents voice get\|set\|play`, `agents numbers list\|attach\|detach`, `agents voice-preview` |
55
+ | Website | `distributions list\|create\|update`, `templates list\|create\|update\|delete`, `solutions list` |
56
+ | Analytics and settings | `analytics metrics\|performance\|volume\|handoffs\|feedback\|conversations\|charts\|chart`, `org config get\|timezone\|business-hours\|holidays`, `audit list` |
57
+ | Tickets | `tickets list\|get\|create\|update\|assign\|resolve\|link\|archive`, `tickets rules list\|create\|update\|delete` |
58
+ | Billing (read-only) | `billing status\|invoices\|usage-forecast\|plans` |
59
+ | Campaigns (read-only) | `campaigns list\|get\|counts\|forecast\|next-touchpoints\|versions`, `campaigns templates list\|get\|skills` |
60
+ | Evaluations | `eval run\|status\|results\|list\|trends\|compare\|report\|export\|metrics\|transcript\|prod-calls\|datasets\|evaluators`, `rubric ...`, `testset ...` |
61
+ | V2 platform and Jarvis | `platform agents\|templates\|components\|connectors\|bindings\|scenarios\|simulations\|org-evaluations`, `jarvis chat`, `jarvis jobs create\|list\|get` |
126
62
 
127
- ### Chat
128
- ```bash
129
- indemn chat <agent-id> [--session <session-id>] # interactive
130
- indemn chat <agent-id> --message "Hello" # single message
131
- ```
63
+ Global flags: `--org <id>`, `--debug` (prints every request and status, never credentials), `--no-banner`, and `--json` on most commands.
132
64
 
133
- ### Models
134
- ```bash
135
- indemn models # list available LLM providers and models
136
- ```
65
+ ### CI evaluation gate
137
66
 
138
- ### MCP Server
139
67
  ```bash
140
- indemn mcp serve # Start MCP server on stdio
68
+ indemn eval run <agent-id> --test-set <id> --min-pass-rate 0.9 --max-p95-ms 6000 --fail-on-error --yes
141
69
  ```
142
70
 
143
- ## Claude Code Integration
144
-
145
- ### MCP Server (tools)
71
+ Exits 1 when the run misses the bar (same rules as the evaluations repo's gate script).
146
72
 
147
- Add the MCP server so Claude Code can manage agents directly:
73
+ ## Claude Code
148
74
 
149
75
  ```bash
150
- claude mcp add -s user \
151
- -e INDEMN_API_KEY=ind_dev_... \
152
- -e INDEMN_ENV=dev \
153
- -- indemn npx @indemn/cli mcp serve
76
+ indemn init
154
77
  ```
155
78
 
156
- Or add manually to your Claude Code MCP settings:
157
- ```json
158
- {
159
- "indemn": {
160
- "command": "npx",
161
- "args": ["@indemn/cli", "mcp", "serve"],
162
- "env": {
163
- "INDEMN_API_KEY": "ind_dev_...",
164
- "INDEMN_ENV": "dev"
165
- }
166
- }
167
- }
168
- ```
169
-
170
- The MCP server exposes 55 tools: `list_agents`, `create_agent`, `set_prompt`, `run_evaluation`, `chat_with_agent`, etc.
79
+ Writes the skills and rules into `.claude/`, adds the MCP server to `.mcp.json`, and adds permission rules to `.claude/settings.json`: read-only tools run without asking, tools that change things ask every time. `indemn init --status` shows what is set up. Existing files are merged, not overwritten.
171
80
 
172
- ### Plugin (skills)
81
+ The MCP server (`indemn mcp serve`) exposes the same actions as tools. Each tool has a title and read-only or destructive labels; list tools take `limit` and `page`; large results are trimmed with a hint instead of failing.
173
82
 
174
- Install the plugin to get workflow skills in Claude Code:
83
+ Plugin install:
175
84
 
176
85
  ```bash
177
86
  claude plugins marketplace add https://github.com/indemn-ai/indemn-cli
178
87
  claude plugins install indemn-cli
179
88
  ```
180
89
 
181
- | Skill | Purpose |
182
- |-------|---------|
183
- | `eval-orchestration` | Full evaluation lifecycle with directive allocation |
184
- | `test-set-creation` | Design test sets with scenarios and diagnostics |
185
- | `rubric-creation` | Create universal behavioral rubrics (3-6 rules) |
186
- | `agent-setup` | End-to-end agent creation workflow |
187
-
188
- ## Global Flags
90
+ Skills: `agent-builder` (create, configure and test agents) and `evaluations` (rubrics, test sets, runs, analysis, reports).
189
91
 
190
- ```bash
191
- indemn --env dev agents list # override environment for a single command
192
- indemn agents list --json # JSON output (available on most commands)
193
- indemn agents list --limit 5 # limit results
194
- indemn agents list --limit 5 --page 2 # pagination
195
- ```
92
+ ## Environment variables
196
93
 
197
- ## Environment Variables
198
-
199
- | Variable | Description |
200
- |----------|-------------|
201
- | `INDEMN_API_KEY` | API key (alternative to `indemn login`) |
202
- | `INDEMN_ENV` | Environment: `dev` or `production` (default: `dev`) |
203
- | `INDEMN_ORG_ID` | Organization ID (alternative to config file) |
94
+ | Variable | Meaning |
95
+ |---|---|
96
+ | `INDEMN_TOKEN` + `INDEMN_ENV` | A session token supplied by a host (for example Darwin starting the toolbox for Jarvis), and its platform |
97
+ | `INDEMN_ORG_ID` | Org for a host-supplied session; same as `--org` |
98
+ | `INDEMN_API_KEY` | An existing dev API key for pipelines; login no longer creates keys |
99
+ | `INDEMN_DEBUG=1` | Same as `--debug` |
100
+ | `INDEMN_NON_INTERACTIVE=1` | Never prompt (also automatic under Claude Code, CI, or without a terminal) |
101
+ | `INDEMN_COPILOT_URL`, `INDEMN_EVALS_URL`, `INDEMN_MIDDLEWARE_URL`, `INDEMN_PLATFORM_URL` | Override service hosts (local development) |
204
102
 
205
103
  ## Architecture
206
104
 
207
105
  ```
208
- @indemn/cli
209
- ├── SDK (TypeScript API client)
210
- │ ├── Copilot Server → Agents, Functions, KBs, Config
211
- │ ├── Evaluations Service → Rubrics, Test Sets, Runs
212
- │ └── Middleware → Chat via Socket.IO
213
- ├── CLI (Commander.js terminal interface)
214
- ├── MCP Server (55 tools for Claude Code)
215
- └── Skills (workflow guides for Claude)
106
+ src/
107
+ core/ runtime rules (exit codes, non-interactive), org resolver, per-call org scope, diff
108
+ sdk/ one client per backend path: copilot-server (REST), middleware (Socket.IO chat),
109
+ evaluations (REST), Darwin V2 platform (REST + WebSocket for Jarvis)
110
+ cli/ Commander commands, one module per area
111
+ mcp/ MCP server: tool registry (titles, annotations, org_id, confirmation, result shaping)
112
+ report/ PDF and Markdown reports
216
113
  ```
217
114
 
115
+ Every request names the client (`User-Agent: indemn-cli/<version>`, `X-Indemn-Client: cli|mcp`), retries reads only, and re-reads the saved login so a new login in another terminal is picked up.
116
+
218
117
  ## Development
219
118
 
220
119
  ```bash
221
- git clone https://github.com/indemn-ai/indemn-cli.git
222
- cd indemn-cli
223
- npm install
224
- npm run build # Compile TypeScript
225
- npm run dev # Watch mode
226
- npm test # Run tests
120
+ npm ci
121
+ npm run build
122
+ npm test
123
+ npm run check:skills
227
124
  ```
228
-
229
- ## License
230
-
231
- MIT
@@ -1 +1 @@
1
- {"version":3,"file":"agents.d.ts","sourceRoot":"","sources":["../../src/cli/agents.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAcpC,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAqN5D"}
1
+ {"version":3,"file":"agents.d.ts","sourceRoot":"","sources":["../../src/cli/agents.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAwBpC,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA+X5D"}