@aws/agentcore 1.0.0-preview.9 → 1.0.0-rc.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 (389) hide show
  1. package/README.md +978 -145
  2. package/dist/assets/agent-inspector/index.css.asset +1 -0
  3. package/dist/assets/agent-inspector/index.js.asset +289 -0
  4. package/dist/assets/cdk/README.md +3 -0
  5. package/dist/assets/cdk/bin/cdk.ts +109 -59
  6. package/dist/assets/cdk/lib/cdk-stack.ts +30 -19
  7. package/dist/assets/cdk/package.json +9 -9
  8. package/dist/assets/cdk/test/cdk.test.ts +94 -2
  9. package/dist/assets/evaluators/autoevals-lambda/README.md +23 -0
  10. package/dist/assets/evaluators/autoevals-lambda/execution-role-policy.json +15 -0
  11. package/dist/assets/evaluators/autoevals-lambda/lambda_function.py +37 -0
  12. package/dist/assets/evaluators/autoevals-lambda/pyproject.toml +23 -0
  13. package/dist/assets/evaluators/deepeval-lambda/README.md +23 -0
  14. package/dist/assets/evaluators/deepeval-lambda/execution-role-policy.json +15 -0
  15. package/dist/assets/evaluators/deepeval-lambda/lambda_function.py +29 -0
  16. package/dist/assets/evaluators/deepeval-lambda/pyproject.toml +22 -0
  17. package/dist/assets/evaluators/python-lambda/README.md +28 -0
  18. package/dist/assets/evaluators/python-lambda/pyproject.toml +1 -1
  19. package/dist/assets/templates/a2a-python-strands/README.md +31 -0
  20. package/dist/assets/templates/a2a-python-strands/main.py +100 -0
  21. package/dist/assets/templates/a2a-python-strands/memory/session.py +35 -0
  22. package/dist/assets/templates/a2a-python-strands/model/load.py +6 -0
  23. package/dist/assets/templates/a2a-python-strands/pyproject.toml +20 -0
  24. package/dist/assets/templates/agent-python-langchain/README.md +55 -0
  25. package/dist/assets/{python/a2a/googleadk/base → templates/agent-python-langchain}/gitignore.template +1 -1
  26. package/dist/assets/templates/agent-python-langchain/main.py +54 -0
  27. package/dist/assets/templates/agent-python-langchain/model/load.py +9 -0
  28. package/dist/assets/templates/agent-python-langchain/pyproject.toml +21 -0
  29. package/dist/assets/templates/agent-python-minimal/README.md +31 -0
  30. package/dist/assets/templates/agent-python-minimal/main.py +13 -0
  31. package/dist/assets/templates/agent-python-minimal/pyproject.toml +18 -0
  32. package/dist/assets/{container/python/Dockerfile → templates/agent-python-strands/Dockerfile.template} +3 -1
  33. package/dist/assets/templates/agent-python-strands/README.md +46 -0
  34. package/dist/assets/{python/a2a/langchain_langgraph/base → templates/agent-python-strands}/gitignore.template +1 -1
  35. package/dist/assets/templates/agent-python-strands/main.py +106 -0
  36. package/dist/assets/templates/agent-python-strands/memory/__init__.py +0 -0
  37. package/dist/assets/templates/agent-python-strands/memory/session.py +35 -0
  38. package/dist/assets/{python/http/strands/base → templates/agent-python-strands}/model/load.py +46 -0
  39. package/dist/assets/templates/agent-python-strands/pyproject.toml +24 -0
  40. package/dist/assets/templates/agent-typescript-strands/README.md +29 -0
  41. package/dist/assets/templates/agent-typescript-strands/gitignore.template +22 -0
  42. package/dist/assets/templates/agent-typescript-strands/main.ts +86 -0
  43. package/dist/assets/templates/agent-typescript-strands/mcp_client/client.ts +11 -0
  44. package/dist/assets/templates/agent-typescript-strands/memory/memory.ts +44 -0
  45. package/dist/assets/templates/agent-typescript-strands/model/load.ts +5 -0
  46. package/dist/assets/templates/agent-typescript-strands/package.json.template +29 -0
  47. package/dist/assets/templates/agent-typescript-strands/tsconfig.json +19 -0
  48. package/dist/assets/templates/agent-typescript-vercel/README.md +22 -0
  49. package/dist/assets/templates/agent-typescript-vercel/gitignore.template +22 -0
  50. package/dist/assets/templates/agent-typescript-vercel/main.ts +35 -0
  51. package/dist/assets/templates/agent-typescript-vercel/package.json.template +24 -0
  52. package/dist/assets/templates/agent-typescript-vercel/tsconfig.json +19 -0
  53. package/dist/assets/templates/agui-python-strands/README.md +39 -0
  54. package/dist/assets/{python/a2a/strands/base → templates/agui-python-strands}/gitignore.template +1 -1
  55. package/dist/assets/{python/agui/strands/base → templates/agui-python-strands}/main.py +11 -14
  56. package/dist/assets/templates/agui-python-strands/memory/__init__.py +0 -0
  57. package/dist/assets/templates/agui-python-strands/memory/session.py +35 -0
  58. package/dist/assets/templates/agui-python-strands/model/load.py +6 -0
  59. package/dist/assets/templates/agui-python-strands/pyproject.toml +22 -0
  60. package/dist/assets/{python/http/strands/base → templates/export-harness-python}/README.md +15 -8
  61. package/dist/assets/templates/export-harness-python/gitignore.template +41 -0
  62. package/dist/assets/templates/export-harness-python/main.py +584 -0
  63. package/dist/assets/templates/export-harness-python/mcp_client/client.py +63 -0
  64. package/dist/assets/templates/export-harness-python/memory/__init__.py +0 -0
  65. package/dist/assets/templates/export-harness-python/memory/session.py +47 -0
  66. package/dist/assets/templates/export-harness-python/model/load.py +249 -0
  67. package/dist/assets/templates/export-harness-python/model/mantle_compat.py +21 -0
  68. package/dist/assets/templates/export-harness-python/pyproject.toml +22 -0
  69. package/dist/assets/templates/export-harness-python/skills/fetcher.py +279 -0
  70. package/dist/assets/templates/mcp-python-fastmcp/README.md +32 -0
  71. package/dist/assets/templates/mcp-python-fastmcp/gitignore.template +41 -0
  72. package/dist/assets/templates/mcp-python-fastmcp/main.py +83 -0
  73. package/dist/assets/{python/mcp/standalone/base → templates/mcp-python-fastmcp}/pyproject.toml +3 -2
  74. package/dist/assets/templates/shared/env.local.template +11 -0
  75. package/dist/assets/templates/shared/gitignore.template +19 -0
  76. package/dist/index.js +4 -27
  77. package/dist/main.js +1190 -0
  78. package/package.json +75 -149
  79. package/LICENSE +0 -175
  80. package/dist/agent-inspector/index.css +0 -1
  81. package/dist/agent-inspector/index.js +0 -279
  82. package/dist/assets/README.md +0 -104
  83. package/dist/assets/__tests__/__snapshots__/assets.snapshot.test.ts.snap +0 -5673
  84. package/dist/assets/__tests__/__snapshots__/dockerfile-render.test.ts.snap +0 -77
  85. package/dist/assets/__tests__/assets.snapshot.test.ts +0 -125
  86. package/dist/assets/__tests__/dockerfile-render.test.ts +0 -24
  87. package/dist/assets/agents/AGENTS.md +0 -141
  88. package/dist/assets/harness/invoke.py.template +0 -74
  89. package/dist/assets/mcp/python/README.md +0 -27
  90. package/dist/assets/mcp/python/pyproject.toml +0 -22
  91. package/dist/assets/mcp/python/server.py +0 -117
  92. package/dist/assets/mcp/python-lambda/README.md +0 -22
  93. package/dist/assets/mcp/python-lambda/handler.py +0 -144
  94. package/dist/assets/mcp/python-lambda/pyproject.toml +0 -15
  95. package/dist/assets/python/a2a/googleadk/base/README.md +0 -22
  96. package/dist/assets/python/a2a/googleadk/base/main.py +0 -110
  97. package/dist/assets/python/a2a/googleadk/base/model/load.py +0 -41
  98. package/dist/assets/python/a2a/googleadk/base/pyproject.toml +0 -20
  99. package/dist/assets/python/a2a/langchain_langgraph/base/README.md +0 -22
  100. package/dist/assets/python/a2a/langchain_langgraph/base/main.py +0 -130
  101. package/dist/assets/python/a2a/langchain_langgraph/base/model/load.py +0 -123
  102. package/dist/assets/python/a2a/langchain_langgraph/base/pyproject.toml +0 -25
  103. package/dist/assets/python/a2a/strands/base/README.md +0 -22
  104. package/dist/assets/python/a2a/strands/base/main.py +0 -107
  105. package/dist/assets/python/a2a/strands/base/model/load.py +0 -123
  106. package/dist/assets/python/a2a/strands/base/pyproject.toml +0 -23
  107. package/dist/assets/python/a2a/strands/capabilities/memory/session.py +0 -43
  108. package/dist/assets/python/agui/googleadk/base/README.md +0 -30
  109. package/dist/assets/python/agui/googleadk/base/gitignore.template +0 -41
  110. package/dist/assets/python/agui/googleadk/base/main.py +0 -31
  111. package/dist/assets/python/agui/googleadk/base/model/load.py +0 -41
  112. package/dist/assets/python/agui/googleadk/base/pyproject.toml +0 -24
  113. package/dist/assets/python/agui/langchain_langgraph/base/README.md +0 -22
  114. package/dist/assets/python/agui/langchain_langgraph/base/gitignore.template +0 -41
  115. package/dist/assets/python/agui/langchain_langgraph/base/main.py +0 -74
  116. package/dist/assets/python/agui/langchain_langgraph/base/model/load.py +0 -123
  117. package/dist/assets/python/agui/langchain_langgraph/base/pyproject.toml +0 -30
  118. package/dist/assets/python/agui/strands/base/README.md +0 -22
  119. package/dist/assets/python/agui/strands/base/gitignore.template +0 -41
  120. package/dist/assets/python/agui/strands/base/model/__init__.py +0 -1
  121. package/dist/assets/python/agui/strands/base/model/load.py +0 -123
  122. package/dist/assets/python/agui/strands/base/pyproject.toml +0 -27
  123. package/dist/assets/python/agui/strands/capabilities/memory/__init__.py +0 -1
  124. package/dist/assets/python/agui/strands/capabilities/memory/session.py +0 -43
  125. package/dist/assets/python/http/autogen/base/README.md +0 -39
  126. package/dist/assets/python/http/autogen/base/gitignore.template +0 -41
  127. package/dist/assets/python/http/autogen/base/main.py +0 -112
  128. package/dist/assets/python/http/autogen/base/mcp_client/__init__.py +0 -1
  129. package/dist/assets/python/http/autogen/base/mcp_client/client.py +0 -28
  130. package/dist/assets/python/http/autogen/base/model/__init__.py +0 -1
  131. package/dist/assets/python/http/autogen/base/model/load.py +0 -136
  132. package/dist/assets/python/http/autogen/base/pyproject.toml +0 -34
  133. package/dist/assets/python/http/googleadk/base/README.md +0 -39
  134. package/dist/assets/python/http/googleadk/base/gitignore.template +0 -41
  135. package/dist/assets/python/http/googleadk/base/main.py +0 -160
  136. package/dist/assets/python/http/googleadk/base/mcp_client/__init__.py +0 -1
  137. package/dist/assets/python/http/googleadk/base/mcp_client/client.py +0 -75
  138. package/dist/assets/python/http/googleadk/base/model/__init__.py +0 -1
  139. package/dist/assets/python/http/googleadk/base/model/load.py +0 -41
  140. package/dist/assets/python/http/googleadk/base/pyproject.toml +0 -22
  141. package/dist/assets/python/http/langchain_langgraph/base/README.md +0 -39
  142. package/dist/assets/python/http/langchain_langgraph/base/gitignore.template +0 -41
  143. package/dist/assets/python/http/langchain_langgraph/base/main.py +0 -176
  144. package/dist/assets/python/http/langchain_langgraph/base/mcp_client/__init__.py +0 -1
  145. package/dist/assets/python/http/langchain_langgraph/base/mcp_client/client.py +0 -77
  146. package/dist/assets/python/http/langchain_langgraph/base/model/__init__.py +0 -1
  147. package/dist/assets/python/http/langchain_langgraph/base/model/load.py +0 -123
  148. package/dist/assets/python/http/langchain_langgraph/base/pyproject.toml +0 -37
  149. package/dist/assets/python/http/openaiagents/base/README.md +0 -39
  150. package/dist/assets/python/http/openaiagents/base/gitignore.template +0 -41
  151. package/dist/assets/python/http/openaiagents/base/main.py +0 -169
  152. package/dist/assets/python/http/openaiagents/base/mcp_client/__init__.py +0 -1
  153. package/dist/assets/python/http/openaiagents/base/mcp_client/client.py +0 -74
  154. package/dist/assets/python/http/openaiagents/base/model/__init__.py +0 -1
  155. package/dist/assets/python/http/openaiagents/base/model/load.py +0 -37
  156. package/dist/assets/python/http/openaiagents/base/pyproject.toml +0 -21
  157. package/dist/assets/python/http/strands/base/main.py +0 -217
  158. package/dist/assets/python/http/strands/base/mcp_client/__init__.py +0 -1
  159. package/dist/assets/python/http/strands/base/mcp_client/client.py +0 -73
  160. package/dist/assets/python/http/strands/base/model/__init__.py +0 -1
  161. package/dist/assets/python/http/strands/base/pyproject.toml +0 -25
  162. package/dist/assets/python/http/strands/capabilities/memory/__init__.py +0 -1
  163. package/dist/assets/python/http/strands/capabilities/memory/session.py +0 -44
  164. package/dist/assets/python/mcp/standalone/base/README.md +0 -36
  165. package/dist/assets/python/mcp/standalone/base/gitignore.template +0 -41
  166. package/dist/assets/python/mcp/standalone/base/main.py +0 -25
  167. package/dist/cli/index.mjs +0 -1718
  168. package/dist/index.d.ts +0 -9
  169. package/dist/index.d.ts.map +0 -1
  170. package/dist/index.js.map +0 -1
  171. package/dist/lib/constants.d.ts +0 -37
  172. package/dist/lib/constants.d.ts.map +0 -1
  173. package/dist/lib/constants.js +0 -69
  174. package/dist/lib/constants.js.map +0 -1
  175. package/dist/lib/errors/config.d.ts +0 -49
  176. package/dist/lib/errors/config.d.ts.map +0 -1
  177. package/dist/lib/errors/config.js +0 -170
  178. package/dist/lib/errors/config.js.map +0 -1
  179. package/dist/lib/errors/index.d.ts +0 -2
  180. package/dist/lib/errors/index.d.ts.map +0 -1
  181. package/dist/lib/errors/index.js +0 -18
  182. package/dist/lib/errors/index.js.map +0 -1
  183. package/dist/lib/index.d.ts +0 -7
  184. package/dist/lib/index.d.ts.map +0 -1
  185. package/dist/lib/index.js +0 -44
  186. package/dist/lib/index.js.map +0 -1
  187. package/dist/lib/packaging/build-args.d.ts +0 -6
  188. package/dist/lib/packaging/build-args.d.ts.map +0 -1
  189. package/dist/lib/packaging/build-args.js +0 -18
  190. package/dist/lib/packaging/build-args.js.map +0 -1
  191. package/dist/lib/packaging/container.d.ts +0 -10
  192. package/dist/lib/packaging/container.d.ts.map +0 -1
  193. package/dist/lib/packaging/container.js +0 -78
  194. package/dist/lib/packaging/container.js.map +0 -1
  195. package/dist/lib/packaging/errors.d.ts +0 -16
  196. package/dist/lib/packaging/errors.d.ts.map +0 -1
  197. package/dist/lib/packaging/errors.js +0 -36
  198. package/dist/lib/packaging/errors.js.map +0 -1
  199. package/dist/lib/packaging/helpers.d.ts +0 -54
  200. package/dist/lib/packaging/helpers.d.ts.map +0 -1
  201. package/dist/lib/packaging/helpers.js +0 -463
  202. package/dist/lib/packaging/helpers.js.map +0 -1
  203. package/dist/lib/packaging/index.d.ts +0 -40
  204. package/dist/lib/packaging/index.d.ts.map +0 -1
  205. package/dist/lib/packaging/index.js +0 -98
  206. package/dist/lib/packaging/index.js.map +0 -1
  207. package/dist/lib/packaging/node.d.ts +0 -22
  208. package/dist/lib/packaging/node.d.ts.map +0 -1
  209. package/dist/lib/packaging/node.js +0 -109
  210. package/dist/lib/packaging/node.js.map +0 -1
  211. package/dist/lib/packaging/python.d.ts +0 -23
  212. package/dist/lib/packaging/python.d.ts.map +0 -1
  213. package/dist/lib/packaging/python.js +0 -165
  214. package/dist/lib/packaging/python.js.map +0 -1
  215. package/dist/lib/packaging/types/index.d.ts +0 -2
  216. package/dist/lib/packaging/types/index.d.ts.map +0 -1
  217. package/dist/lib/packaging/types/index.js +0 -3
  218. package/dist/lib/packaging/types/index.js.map +0 -1
  219. package/dist/lib/packaging/types/packaging.d.ts +0 -57
  220. package/dist/lib/packaging/types/packaging.d.ts.map +0 -1
  221. package/dist/lib/packaging/types/packaging.js +0 -3
  222. package/dist/lib/packaging/types/packaging.js.map +0 -1
  223. package/dist/lib/packaging/uv.d.ts +0 -7
  224. package/dist/lib/packaging/uv.d.ts.map +0 -1
  225. package/dist/lib/packaging/uv.js +0 -40
  226. package/dist/lib/packaging/uv.js.map +0 -1
  227. package/dist/lib/schemas/io/config-io.d.ts +0 -119
  228. package/dist/lib/schemas/io/config-io.d.ts.map +0 -1
  229. package/dist/lib/schemas/io/config-io.js +0 -323
  230. package/dist/lib/schemas/io/config-io.js.map +0 -1
  231. package/dist/lib/schemas/io/global-config.d.ts +0 -33
  232. package/dist/lib/schemas/io/global-config.d.ts.map +0 -1
  233. package/dist/lib/schemas/io/global-config.js +0 -89
  234. package/dist/lib/schemas/io/global-config.js.map +0 -1
  235. package/dist/lib/schemas/io/index.d.ts +0 -3
  236. package/dist/lib/schemas/io/index.d.ts.map +0 -1
  237. package/dist/lib/schemas/io/index.js +0 -18
  238. package/dist/lib/schemas/io/index.js.map +0 -1
  239. package/dist/lib/schemas/io/path-resolver.d.ts +0 -119
  240. package/dist/lib/schemas/io/path-resolver.d.ts.map +0 -1
  241. package/dist/lib/schemas/io/path-resolver.js +0 -207
  242. package/dist/lib/schemas/io/path-resolver.js.map +0 -1
  243. package/dist/lib/utils/aws-account.d.ts +0 -7
  244. package/dist/lib/utils/aws-account.d.ts.map +0 -1
  245. package/dist/lib/utils/aws-account.js +0 -24
  246. package/dist/lib/utils/aws-account.js.map +0 -1
  247. package/dist/lib/utils/credentials.d.ts +0 -86
  248. package/dist/lib/utils/credentials.d.ts.map +0 -1
  249. package/dist/lib/utils/credentials.js +0 -153
  250. package/dist/lib/utils/credentials.js.map +0 -1
  251. package/dist/lib/utils/env.d.ts +0 -22
  252. package/dist/lib/utils/env.d.ts.map +0 -1
  253. package/dist/lib/utils/env.js +0 -65
  254. package/dist/lib/utils/env.js.map +0 -1
  255. package/dist/lib/utils/index.d.ts +0 -9
  256. package/dist/lib/utils/index.d.ts.map +0 -1
  257. package/dist/lib/utils/index.js +0 -27
  258. package/dist/lib/utils/index.js.map +0 -1
  259. package/dist/lib/utils/json-rpc.d.ts +0 -3
  260. package/dist/lib/utils/json-rpc.d.ts.map +0 -1
  261. package/dist/lib/utils/json-rpc.js +0 -27
  262. package/dist/lib/utils/json-rpc.js.map +0 -1
  263. package/dist/lib/utils/platform.d.ts +0 -63
  264. package/dist/lib/utils/platform.d.ts.map +0 -1
  265. package/dist/lib/utils/platform.js +0 -88
  266. package/dist/lib/utils/platform.js.map +0 -1
  267. package/dist/lib/utils/subprocess.d.ts +0 -29
  268. package/dist/lib/utils/subprocess.d.ts.map +0 -1
  269. package/dist/lib/utils/subprocess.js +0 -116
  270. package/dist/lib/utils/subprocess.js.map +0 -1
  271. package/dist/lib/utils/time-parser.d.ts +0 -11
  272. package/dist/lib/utils/time-parser.d.ts.map +0 -1
  273. package/dist/lib/utils/time-parser.js +0 -47
  274. package/dist/lib/utils/time-parser.js.map +0 -1
  275. package/dist/lib/utils/zod.d.ts +0 -14
  276. package/dist/lib/utils/zod.d.ts.map +0 -1
  277. package/dist/lib/utils/zod.js +0 -32
  278. package/dist/lib/utils/zod.js.map +0 -1
  279. package/dist/schema/constants.d.ts +0 -119
  280. package/dist/schema/constants.d.ts.map +0 -1
  281. package/dist/schema/constants.js +0 -170
  282. package/dist/schema/constants.js.map +0 -1
  283. package/dist/schema/index.d.ts +0 -4
  284. package/dist/schema/index.d.ts.map +0 -1
  285. package/dist/schema/index.js +0 -21
  286. package/dist/schema/index.js.map +0 -1
  287. package/dist/schema/schemas/agent-env.d.ts +0 -186
  288. package/dist/schema/schemas/agent-env.d.ts.map +0 -1
  289. package/dist/schema/schemas/agent-env.js +0 -240
  290. package/dist/schema/schemas/agent-env.js.map +0 -1
  291. package/dist/schema/schemas/agentcore-project.d.ts +0 -838
  292. package/dist/schema/schemas/agentcore-project.d.ts.map +0 -1
  293. package/dist/schema/schemas/agentcore-project.js +0 -335
  294. package/dist/schema/schemas/agentcore-project.js.map +0 -1
  295. package/dist/schema/schemas/auth.d.ts +0 -140
  296. package/dist/schema/schemas/auth.d.ts.map +0 -1
  297. package/dist/schema/schemas/auth.js +0 -114
  298. package/dist/schema/schemas/auth.js.map +0 -1
  299. package/dist/schema/schemas/aws-targets.d.ts +0 -71
  300. package/dist/schema/schemas/aws-targets.d.ts.map +0 -1
  301. package/dist/schema/schemas/aws-targets.js +0 -57
  302. package/dist/schema/schemas/aws-targets.js.map +0 -1
  303. package/dist/schema/schemas/deployed-state.d.ts +0 -725
  304. package/dist/schema/schemas/deployed-state.d.ts.map +0 -1
  305. package/dist/schema/schemas/deployed-state.js +0 -218
  306. package/dist/schema/schemas/deployed-state.js.map +0 -1
  307. package/dist/schema/schemas/index.d.ts +0 -9
  308. package/dist/schema/schemas/index.d.ts.map +0 -1
  309. package/dist/schema/schemas/index.js +0 -26
  310. package/dist/schema/schemas/index.js.map +0 -1
  311. package/dist/schema/schemas/mcp-defs.d.ts +0 -52
  312. package/dist/schema/schemas/mcp-defs.d.ts.map +0 -1
  313. package/dist/schema/schemas/mcp-defs.js +0 -50
  314. package/dist/schema/schemas/mcp-defs.js.map +0 -1
  315. package/dist/schema/schemas/mcp.d.ts +0 -820
  316. package/dist/schema/schemas/mcp.d.ts.map +0 -1
  317. package/dist/schema/schemas/mcp.js +0 -564
  318. package/dist/schema/schemas/mcp.js.map +0 -1
  319. package/dist/schema/schemas/primitives/ab-test.d.ts +0 -141
  320. package/dist/schema/schemas/primitives/ab-test.d.ts.map +0 -1
  321. package/dist/schema/schemas/primitives/ab-test.js +0 -97
  322. package/dist/schema/schemas/primitives/ab-test.js.map +0 -1
  323. package/dist/schema/schemas/primitives/config-bundle.d.ts +0 -31
  324. package/dist/schema/schemas/primitives/config-bundle.d.ts.map +0 -1
  325. package/dist/schema/schemas/primitives/config-bundle.js +0 -38
  326. package/dist/schema/schemas/primitives/config-bundle.js.map +0 -1
  327. package/dist/schema/schemas/primitives/evaluator.d.ts +0 -102
  328. package/dist/schema/schemas/primitives/evaluator.d.ts.map +0 -1
  329. package/dist/schema/schemas/primitives/evaluator.js +0 -84
  330. package/dist/schema/schemas/primitives/evaluator.js.map +0 -1
  331. package/dist/schema/schemas/primitives/harness.d.ts +0 -363
  332. package/dist/schema/schemas/primitives/harness.d.ts.map +0 -1
  333. package/dist/schema/schemas/primitives/harness.js +0 -261
  334. package/dist/schema/schemas/primitives/harness.js.map +0 -1
  335. package/dist/schema/schemas/primitives/http-gateway.d.ts +0 -21
  336. package/dist/schema/schemas/primitives/http-gateway.d.ts.map +0 -1
  337. package/dist/schema/schemas/primitives/http-gateway.js +0 -34
  338. package/dist/schema/schemas/primitives/http-gateway.js.map +0 -1
  339. package/dist/schema/schemas/primitives/index.d.ts +0 -15
  340. package/dist/schema/schemas/primitives/index.d.ts.map +0 -1
  341. package/dist/schema/schemas/primitives/index.js +0 -61
  342. package/dist/schema/schemas/primitives/index.js.map +0 -1
  343. package/dist/schema/schemas/primitives/memory.d.ts +0 -51
  344. package/dist/schema/schemas/primitives/memory.d.ts.map +0 -1
  345. package/dist/schema/schemas/primitives/memory.js +0 -73
  346. package/dist/schema/schemas/primitives/memory.js.map +0 -1
  347. package/dist/schema/schemas/primitives/online-eval-config.d.ts +0 -14
  348. package/dist/schema/schemas/primitives/online-eval-config.d.ts.map +0 -1
  349. package/dist/schema/schemas/primitives/online-eval-config.js +0 -30
  350. package/dist/schema/schemas/primitives/online-eval-config.js.map +0 -1
  351. package/dist/schema/schemas/primitives/policy.d.ts +0 -49
  352. package/dist/schema/schemas/primitives/policy.d.ts.map +0 -1
  353. package/dist/schema/schemas/primitives/policy.js +0 -62
  354. package/dist/schema/schemas/primitives/policy.js.map +0 -1
  355. package/dist/schema/schemas/primitives/tags.d.ts +0 -6
  356. package/dist/schema/schemas/primitives/tags.d.ts.map +0 -1
  357. package/dist/schema/schemas/primitives/tags.js +0 -27
  358. package/dist/schema/schemas/primitives/tags.js.map +0 -1
  359. package/dist/schema/schemas/zod-util.d.ts +0 -10
  360. package/dist/schema/schemas/zod-util.d.ts.map +0 -1
  361. package/dist/schema/schemas/zod-util.js +0 -23
  362. package/dist/schema/schemas/zod-util.js.map +0 -1
  363. package/dist/schema/types/index.d.ts +0 -2
  364. package/dist/schema/types/index.d.ts.map +0 -1
  365. package/dist/schema/types/index.js +0 -18
  366. package/dist/schema/types/index.js.map +0 -1
  367. package/dist/schema/types/path.d.ts +0 -27
  368. package/dist/schema/types/path.d.ts.map +0 -1
  369. package/dist/schema/types/path.js +0 -13
  370. package/dist/schema/types/path.js.map +0 -1
  371. package/scripts/bump-version.ts +0 -393
  372. package/scripts/bundle.mjs +0 -219
  373. package/scripts/check-old-cli.lib.mjs +0 -102
  374. package/scripts/check-old-cli.mjs +0 -10
  375. package/scripts/copy-assets.mjs +0 -64
  376. package/scripts/generate-schema.mjs +0 -40
  377. package/scripts/run-e2e-local.sh +0 -112
  378. package/scripts/start-tui-harness.sh +0 -90
  379. /package/dist/{agent-inspector/favicon.svg → assets/agent-inspector/favicon.svg.asset} +0 -0
  380. /package/dist/{agent-inspector/index.html → assets/agent-inspector/index.html.asset} +0 -0
  381. /package/dist/assets/{python/http/strands/base → templates/a2a-python-strands}/gitignore.template +0 -0
  382. /package/dist/assets/{typescript/.gitkeep → templates/a2a-python-strands/memory/__init__.py} +0 -0
  383. /package/dist/assets/{python/a2a/googleadk/base → templates/a2a-python-strands}/model/__init__.py +0 -0
  384. /package/dist/assets/{python/a2a/langchain_langgraph/base → templates/agent-python-langchain}/model/__init__.py +0 -0
  385. /package/dist/assets/{container/python → templates/agent-python-strands}/dockerignore.template +0 -0
  386. /package/dist/assets/{python/a2a/strands/base → templates/agent-python-strands}/model/__init__.py +0 -0
  387. /package/dist/assets/{python/a2a/strands/capabilities/memory → templates/agui-python-strands/model}/__init__.py +0 -0
  388. /package/dist/assets/{python/agui/googleadk/base/model → templates/export-harness-python/mcp_client}/__init__.py +0 -0
  389. /package/dist/assets/{python/agui/langchain_langgraph/base → templates/export-harness-python}/model/__init__.py +0 -0
package/README.md CHANGED
@@ -1,205 +1,1038 @@
1
- <div align="center">
2
- <h1>AgentCore CLI</h1>
3
- <p><strong>Create, develop, and deploy AI agents to Amazon Bedrock AgentCore</strong></p>
1
+ # AgentCore CLI
4
2
 
5
- <p>
6
- <a href="https://github.com/aws/agentcore-cli/actions/workflows/build-and-test.yml"><img src="https://img.shields.io/github/actions/workflow/status/aws/agentcore-cli/build-and-test.yml?branch=main&label=build" alt="Build Status"></a>
7
- <a href="https://www.npmjs.com/package/@aws/agentcore"><img src="https://img.shields.io/npm/v/@aws/agentcore" alt="npm version"></a>
8
- <a href="LICENSE"><img src="https://img.shields.io/github/license/aws/agentcore-cli" alt="License"></a>
9
- </p>
10
- </div>
3
+ `agentcore` is a command-line tool and interactive terminal UI (TUI) for managing
4
+ **[AWS Bedrock AgentCore](https://aws.amazon.com/bedrock/agentcore/)** — Amazon's
5
+ platform for building and running production AI agents.
11
6
 
12
- ## Overview
7
+ It gives you two ways to work, from the same binary:
13
8
 
14
- Amazon Bedrock AgentCore enables you to deploy and operate AI agents securely at scale using any framework and model.
15
- AgentCore provides tools and capabilities to make agents more effective, purpose-built infrastructure to securely scale
16
- agents, and controls to operate trustworthy agents. This CLI helps you create, develop locally, and deploy agents to
17
- AgentCore with minimal configuration.
9
+ - **A scriptable CLI** — every operation is a flag-driven subcommand that emits
10
+ JSON (`--json`), so it can be used by codeing agents and can drop cleanly into
11
+ scripts, CI, and automation.
12
+ - **An interactive TUI** — bare Harness, Runtime, Memory, Identity, and Gateway
13
+ branches and leaves open their corresponding menus and selection flows, and a
14
+ bare `project create` opens a guided create wizard.
18
15
 
19
- ## 🚀 Jump Into AgentCore
16
+ ```bash
17
+ agentcore # launch the interactive TUI
18
+ agentcore harness list --json # scriptable, machine-readable output
19
+ ```
20
+
21
+ ## What problem does it solve?
22
+
23
+ Bedrock AgentCore is administered through several AWS SDK APIs (a control plane,
24
+ a data plane, and IAM for execution roles). Driving those directly means writing
25
+ a lot of boilerplate, hand-managing IAM roles, and stitching together streaming
26
+ responses. `agentcore` wraps all of that behind one ergonomic tool.
27
+
28
+ ## Command surface
29
+
30
+ Commands with operation flags run headlessly. Bare Harness, Runtime, Memory,
31
+ Identity, and Gateway branches and leaves open their interactive flows, as does
32
+ a bare `project create` in a terminal (any flag, `--json`, or a non-TTY stays
33
+ headless). A bare `project status` opens a Linked Resources view that groups
34
+ the project's resources by agent and forwards to each deployed resource's
35
+ detail page. The harness hub (`harness get`) ends with the same kind of Linked
36
+ Resources tree for the Runtime, Memory, Gateway, Browser, Code Interpreter and
37
+ credential providers wired to that harness, each opening in its own region.
38
+
39
+ ```
40
+ agentcore # interactive TUI
41
+ ├── harness # manage agentcore harnesses
42
+ │ ├── create # create a harness (auto-provisions a role if none given)
43
+ │ ├── get # fetch a harness by id
44
+ │ ├── list # list harnesses (server-side paginated)
45
+ │ ├── update # update a harness
46
+ │ ├── delete # delete a harness
47
+ │ ├── invoke # chat with / prompt a harness (streams the reply)
48
+ │ ├── exec # run a shell command in a harness runtime
49
+ │ ├── version
50
+ │ │ ├── list # list a harness's versions
51
+ │ │ └── get # get a specific version
52
+ │ └── endpoint
53
+ │ ├── create
54
+ │ ├── get
55
+ │ ├── list
56
+ │ ├── update
57
+ │ └── delete
58
+ ├── identity # manage AgentCore Identity resources
59
+ │ ├── api-key-credential-provider
60
+ │ │ ├── create # create an API key credential provider
61
+ │ │ ├── get # get an API key credential provider
62
+ │ │ ├── list # list API key credential providers
63
+ │ │ ├── update # update an API key credential provider
64
+ │ │ └── delete # delete an API key credential provider
65
+ │ └── oauth2-credential-provider
66
+ │ ├── create # create an OAuth2 credential provider
67
+ │ ├── get # get an OAuth2 credential provider
68
+ │ ├── list # list OAuth2 credential providers
69
+ │ ├── update # update an OAuth2 credential provider
70
+ │ └── delete # delete an OAuth2 credential provider
71
+ ├── runtime # inspect deployed AgentCore Runtimes
72
+ │ ├── get # fetch a Runtime by id
73
+ │ ├── list # list Runtimes (server-side paginated)
74
+ │ ├── invoke # invoke a Runtime headlessly or in a persistent console
75
+ │ ├── shell # open a persistent interactive terminal in a Runtime
76
+ │ ├── logs # follow a Runtime's logs live, or search a time window
77
+ │ ├── traces
78
+ │ │ ├── list # list a Runtime's recent traces
79
+ │ │ └── get # download a trace's log records to a JSON file
80
+ │ ├── version
81
+ │ │ ├── get # get a specific Runtime version
82
+ │ │ └── list # list a Runtime's versions
83
+ │ └── endpoint
84
+ │ ├── get # get a Runtime endpoint by qualifier
85
+ │ └── list # list a Runtime's endpoints
86
+ ├── memory # inspect AgentCore Memories
87
+ │ ├── get # fetch a Memory by id
88
+ │ ├── list # list Memories (server-side paginated)
89
+ │ ├── event
90
+ │ │ ├── get # get an Event from a Memory session
91
+ │ │ └── list # list Events from a Memory session
92
+ │ └── record
93
+ │ ├── get # get a long-term Memory record
94
+ │ └── list # list long-term Memory records
95
+ ├── gateway # manage AgentCore Gateways
96
+ │ ├── get # get a Gateway by id
97
+ │ ├── list # list Gateways (server-side paginated)
98
+ │ ├── invoke # invoke a Gateway headlessly or in a persistent console
99
+ │ ├── target
100
+ │ │ ├── get # get a Target under a Gateway
101
+ │ │ └── list # list Targets under a Gateway
102
+ │ ├── connector
103
+ │ │ ├── get # get a connector-backed Target
104
+ │ │ └── list # list connector-backed Targets
105
+ │ ├── rule
106
+ │ │ ├── get # get a Rule under a Gateway
107
+ │ │ └── list # list Rules under a Gateway
108
+ │ └── policy
109
+ │ └── generate # generate Cedar for a Gateway from a prompt (TUI when run bare)
110
+ ├── eval # evaluate and optimize AgentCore agents
111
+ │ └── evaluator # manage AgentCore evaluators
112
+ │ ├── llm-as-a-judge # LLM-as-a-Judge evaluators
113
+ │ │ ├── create # create (instructions + rating scale + model)
114
+ │ │ └── update # update (merged over the existing config)
115
+ │ ├── code-based # code-based (Lambda-backed) evaluators
116
+ │ │ ├── create # create (Lambda ARN + optional timeout)
117
+ │ │ └── update # update (merged over the existing config)
118
+ │ ├── get # get an evaluator by id (type-agnostic)
119
+ │ ├── list # list evaluators (server-side paginated)
120
+ │ └── delete # delete an evaluator by id
121
+ ├── project # manage an AgentCore project (scaffold → deploy)
122
+ │ ├── create # create a project: a managed harness by default,
123
+ │ │ # or scaffolded runtime code via --template;
124
+ │ │ # bare `project create` opens an interactive wizard
125
+ │ ├── add # add a resource to the project (runtime, harness, memory, …)
126
+ │ ├── export
127
+ │ │ └── harness # convert a harness into an editable Strands runtime agent
128
+ │ ├── remove # remove a resource from the project spec (spec-level;
129
+ │ │ # code under app/ is kept). Resource types: harness,
130
+ │ │ # runtime, credential, config-bundle, online-eval,
131
+ │ │ # online-insight, memory, gateway, gateway-target,
132
+ │ │ # gateway-connector, policy-engine, policy,
133
+ │ │ # payment-manager, payment-connector — or `all`, which
134
+ │ │ # empties every resource collection (y/N prompt; --yes
135
+ │ │ # skips it for non-interactive use)
136
+ │ ├── dev # run the project locally
137
+ │ ├── deploy # deploy to AWS (auto-provisions the default target)
138
+ │ ├── invoke # invoke a deployed project resource
139
+ │ │ ├── runtime # use the existing Runtime invoke experience
140
+ │ │ └── harness # use the existing Harness invoke experience
141
+ │ ├── status # inspect deployed project resources (TUI when run bare)
142
+ │ └── build # synthesize the project's CloudFormation templates
143
+ └── config # read/write global config values
144
+ ```
145
+
146
+ `project export harness` "ejects" a harness to code you own: it renders a
147
+ Python Strands agent under `app/<target-agent-name>/` mapping the harness spec
148
+ (model, system prompt, tools, skills, memory, execution limits), registers the
149
+ new runtime in `agentcore.json` (the harness entry stays), and writes an
150
+ `EXPORT_NOTES.md` in the agent directory listing anything that could not be
151
+ mapped mechanically. Pass `--name <harness>` for an in-project harness or
152
+ `--arn <harnessArn>` to fetch a deployed one (the fetch uses the region
153
+ embedded in the ARN); `--target-agent-name` overrides the default
154
+ `<harnessName>Agent`. The exported agent is always a `CodeZip` runtime: it
155
+ declares its own dependencies, so it needs no image build. If the harness used a
156
+ pre-built container image or a custom Dockerfile, that is reported in
157
+ `EXPORT_NOTES.md` rather than rebuilt. Path-based skills are not supported,
158
+ since the exported agent has no container filesystem to read them from.
159
+
160
+ Global flags (declared at the root, available on every command):
161
+
162
+ | Flag | Purpose |
163
+ | ---------------- | -------------------------------------------------------------------- |
164
+ | `--region` | AWS region (falls back to `AWS_REGION`, then the shared AWS config). |
165
+ | `--json` | Emit machine-readable JSON instead of launching the TUI. |
166
+ | `--debug` | Debug logging. |
167
+ | `--endpoint-url` | Override the service endpoint URL (e.g. for testing against a stub). |
168
+
169
+ ### Invoke a project resource
170
+
171
+ Run `agentcore project invoke` from inside a project to choose a deployed
172
+ Runtime or Harness interactively. Headless invocation keeps each resource's
173
+ existing input contract:
174
+
175
+ ```bash
176
+ agentcore project invoke runtime \
177
+ --name checkout \
178
+ --payload '{"prompt":"Check order 123."}' \
179
+ --content-type application/json
180
+
181
+ agentcore project invoke harness \
182
+ --name support \
183
+ --prompt "Help with my account."
184
+ ```
185
+
186
+ Use `--target` to select a deployment target. When a project declares exactly
187
+ one resource of the requested type, `--name` may be omitted.
188
+
189
+ ### Examples
190
+
191
+ ```bash
192
+ # Create a project. The default is a harness project: a managed agent
193
+ # configured by spec, no model-loop code to maintain. Passing only --name
194
+ # scaffolds the default harness.
195
+ agentcore project create --name MyAssistant
196
+ cd MyAssistant && agentcore project deploy
197
+ # … or run `agentcore project create` bare in a terminal for the guided
198
+ # wizard (name → harness or template → confirm), which drives the same
199
+ # creation path.
200
+ agentcore harness invoke --id <id from the deploy outputs> --prompt "hello"
201
+
202
+ # Scaffold runtime code instead by selecting a template. Templates that support
203
+ # a model provider (agent-python-strands) accept --model-provider/--api-key;
204
+ # add the -container suffix for a container build, or use `empty` for a project
205
+ # with no runtime.
206
+ agentcore project create --name MyAgent --template agent-python-strands
207
+ # The same Strands agent built as a container image, with a Dockerfile.
208
+ agentcore project create --name MyAgent --template agent-python-strands-container
209
+ # A LangChain agent on Bedrock, built with create_agent.
210
+ agentcore project create --name MyAgent --template agent-python-langchain
211
+
212
+ # Translate an existing Amazon Bedrock Agent version into editable runtime code
213
+ # with `project add runtime --type import` from inside a project. The selected
214
+ # alias identifies the immutable source version; generated code invokes models
215
+ # and translated tools directly rather than proxying the alias. Use --framework
216
+ # strands (default) or langgraph. The alias must point at a prepared version,
217
+ # not the mutable DRAFT that the built-in test alias (TSTALIASID) routes to.
218
+ # Anything that could not be translated is listed in the generated IMPORT_NOTES.md.
219
+ agentcore project add runtime --name MyImportedAgent --type import \
220
+ --agent-id A1B2C3D4E5 --agent-alias-id XYZ123ABC4 --region us-east-1 \
221
+ --framework strands
222
+ ```
223
+
224
+ ```bash
225
+ # Create a harness; a default execution role is created for you.
226
+ agentcore harness create \
227
+ --name my-agent \
228
+ --system-prompt "You are a helpful assistant." \
229
+ --model '{"bedrockModelConfig":{"modelId":"us.anthropic.claude-sonnet-4-5-20250929-v1:0"}}' \
230
+ --json
231
+
232
+ # List and inspect
233
+ agentcore harness list --json
234
+ agentcore harness get --id <harnessId> --json
235
+
236
+ # One-shot prompt (streams, then prints the full transcript as JSON)
237
+ agentcore harness invoke --id <harnessId> --prompt "Summarize this repo." --json
238
+
239
+ # Interactive chat (no --prompt): opens the TUI chat at that harness/session
240
+ agentcore harness invoke --id <harnessId>
241
+ agentcore harness invoke --id <harnessId> --session-id <session> --qualifier PROD
242
+
243
+ # Run a shell command inside the agent runtime
244
+ agentcore harness exec --id <harnessId> --command "ls -la" --json
245
+
246
+ # Inspect deployed Runtimes without project configuration or deployment
247
+ agentcore runtime get --id <runtimeId>
248
+ agentcore runtime list --max-results 20
249
+ agentcore runtime version get --id <runtimeId> --version <version>
250
+ agentcore runtime version list --id <runtimeId> --max-results 20
251
+ agentcore runtime endpoint get --id <runtimeId> --qualifier DEFAULT
252
+ agentcore runtime endpoint list --id <runtimeId> --max-results 20
253
+
254
+ # Follow a Runtime's logs live (Ctrl+C to stop); inside a project --id is optional
255
+ agentcore runtime logs --id <runtimeId>
256
+ agentcore runtime logs --id <runtimeId> --level error --query "database"
257
+
258
+ # Search a past window instead (--since/--until switch to search mode)
259
+ agentcore runtime logs --id <runtimeId> --since 1h --limit 100
260
+ agentcore runtime logs --id <runtimeId> --since 2026-08-30T12:00:00Z --until now --json
261
+
262
+ # List recent traces (they take 2-3 minutes to appear), then download one
263
+ agentcore runtime traces list --id <runtimeId> --since 30m
264
+ agentcore runtime traces get <traceId> --id <runtimeId> --output trace.json
265
+
266
+ # Inspect AgentCore Memories without project configuration or deployment
267
+ agentcore memory get --id <memoryId>
268
+ agentcore memory get --id <memoryId> --view without_decryption
269
+ agentcore memory list --max-results 20
270
+ agentcore memory event get --id <memoryId> --actor-id <actorId> --session-id <sessionId> --event-id <eventId>
271
+ agentcore memory event list --id <memoryId> --actor-id <actorId> --session-id <sessionId> --max-results 20
272
+ agentcore memory record get --id <memoryId> --record-id <recordId>
273
+ agentcore memory record list --id <memoryId> --namespace <namespace> --max-results 20
274
+
275
+ # Inspect Gateway resources without project configuration or deployment
276
+ agentcore gateway get --id <gatewayId>
277
+ agentcore gateway list --max-results 20
278
+ agentcore gateway invoke --id <gatewayId> --payload file://request.json
279
+ agentcore gateway invoke --id <gatewayId> # open the persistent JSON console
280
+ agentcore gateway target get --gateway-id <gatewayId> --target-id <targetId>
281
+ agentcore gateway target list --gateway-id <gatewayId> --max-results 20
282
+ agentcore gateway connector get --gateway-id <gatewayId> --id <targetId>
283
+ agentcore gateway connector list --gateway-id <gatewayId> --max-results 20
284
+ agentcore gateway rule get --gateway-id <gatewayId> --rule-id <ruleId>
285
+ agentcore gateway rule list --gateway-id <gatewayId> --max-results 20
286
+ agentcore gateway policy generate --gateway-id <gatewayId> --prompt "forbid IAM callers from every tool"
287
+ agentcore gateway policy generate --gateway-id <gatewayArn> --prompt file://policy.txt --json
288
+ # Pipe the generated Cedar into a project (run inside the project)
289
+ agentcore gateway policy generate --gateway-id <gatewayId> --prompt "..." \
290
+ | agentcore project add policy --engine Guardrails --name Generated --statement -
291
+
292
+ # Manage API key credential providers
293
+ agentcore identity api-key-credential-provider create --name my-provider --api-key <key>
294
+ agentcore identity api-key-credential-provider get --name my-provider
295
+ agentcore identity api-key-credential-provider list --max-results 10
296
+ agentcore identity api-key-credential-provider update --name my-provider --api-key <new-key>
297
+ agentcore identity api-key-credential-provider delete --name my-provider
298
+
299
+ # Manage OAuth2 credential providers (guided Custom OAuth2, or --provider-configuration for other vendors)
300
+ agentcore identity oauth2-credential-provider create \
301
+ --name my-oauth-provider \
302
+ --vendor CustomOauth2 \
303
+ --client-id <client-id> \
304
+ --discovery-url https://issuer.example.com/.well-known/openid-configuration \
305
+ --client-secret -
306
+ agentcore identity oauth2-credential-provider get --name my-oauth-provider
307
+ agentcore identity oauth2-credential-provider list --max-results 10
308
+ agentcore identity oauth2-credential-provider delete --name my-oauth-provider
309
+
310
+ # Manage evaluators
311
+ # Create an LLM-as-a-Judge evaluator with a rating-scale preset.
312
+ agentcore eval evaluator llm-as-a-judge create \
313
+ --name order-support-quality \
314
+ --level SESSION \
315
+ --model us.anthropic.claude-sonnet-4-5-20250929-v1:0 \
316
+ --instructions "Judge from {context} whether the order-support agent answered correctly." \
317
+ --rating-scale 1-5-quality \
318
+ --json
319
+
320
+ # Create a code-based (Lambda-backed) evaluator; timeout defaults to the service value.
321
+ agentcore eval evaluator code-based create \
322
+ --name refund-policy-compliance \
323
+ --level SESSION \
324
+ --lambda-arn arn:aws:lambda:us-west-2:123456789012:function:refund-policy \
325
+ --json
326
+
327
+ # Get, list, delete.
328
+ agentcore eval evaluator get --id <evaluatorId> --json
329
+ agentcore eval evaluator list --max-results 20 --json
330
+ agentcore eval evaluator delete --id <evaluatorId> --json
331
+
332
+ # Remove resources from a project's spec (run inside the project)
333
+ agentcore project remove memory --name recall
334
+ agentcore project remove credential --name svc-key # also deletes its .env.local entries
335
+ agentcore project remove gateway-target --gateway tools --name search
336
+ agentcore project remove all # y/N prompt; empties every collection
337
+ agentcore project remove all --yes # non-interactive
338
+ ```
339
+
340
+ Source-aware values: any field flag documented as such accepts the value inline,
341
+ `file://<path>` to read it from a file, or `-` to read it from stdin (the AWS CLI
342
+ `file://` convention). A command reads stdin from at most one flag. For example,
343
+ `--instructions file://order-quality.txt` or `--instructions -`.
344
+
345
+ ### Invoke a Gateway
20
346
 
21
- - **Node.js** 20.x or later
22
- - **uv** for Python agents ([install](https://docs.astral.sh/uv/getting-started/installation/))
347
+ Gateway Invoke is a project-independent HTTP request command with headless and
348
+ interactive modes. It gets the Gateway by ID, uses the returned HTTPS origin,
349
+ selects authentication from the Gateway's authorizer, and preserves the request
350
+ and response bodies.
23
351
 
24
- ## Installation
352
+ ```bash
353
+ # MCP Gateway: use the exact gatewayUrl returned by GetGateway.
354
+ agentcore gateway invoke \
355
+ --id <gatewayId> \
356
+ --payload '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-03-26","capabilities":{},"clientInfo":{"name":"agentcore-cli","version":"1"}}}' \
357
+ --accept 'application/json, text/event-stream' \
358
+ --mcp-protocol-version 2025-03-26
359
+
360
+ # HTTP target: --path is relative to the Gateway origin.
361
+ agentcore gateway invoke \
362
+ --id <gatewayId> \
363
+ --path support-agent/invocations \
364
+ --payload file://request.json \
365
+ --session-id <runtimeSessionId>
366
+
367
+ # Inference target.
368
+ agentcore gateway invoke \
369
+ --id <gatewayId> \
370
+ --path inference/v1/messages \
371
+ --payload file://message.json \
372
+ --json
373
+
374
+ # GET requests do not accept a payload.
375
+ agentcore gateway invoke \
376
+ --id <gatewayId> \
377
+ --method GET \
378
+ --path inference/v1/models
379
+ ```
380
+
381
+ `--path` replaces the path in the returned Gateway URL while retaining its
382
+ origin. It must remain relative to the selected Gateway and may include a query
383
+ string. Omitting it uses the returned `gatewayUrl` exactly. Supported methods
384
+ are `GET`, `POST` (the default), and `DELETE`. POST requires `--payload`; DELETE
385
+ may include one. Payloads accept inline bytes, `file://<path>`, or `-` for stdin.
386
+
387
+ Authentication follows `GetGateway.authorizerType`: `AWS_IAM` and
388
+ `AUTHENTICATE_ONLY` requests use SigV4, `CUSTOM_JWT` requires `--bearer-token`,
389
+ and `NONE` uses unsigned HTTPS. Bearer tokens accept inline, `file://`, or stdin
390
+ sources; payload and token cannot both read stdin.
391
+
392
+ Raw responses stream exact bytes to stdout. `--output-file` streams those bytes
393
+ to disk, while `--json` buffers one envelope containing status, selected session
394
+ and request metadata, body encoding, and body. Binary or unknown output requires
395
+ `--output-file` or `--json` when stdout is a terminal. Response metadata goes to
396
+ stderr in raw and file modes. Redirects are returned without being followed.
397
+ Non-2xx response bodies use the selected output mode before the command exits
398
+ with a failure status.
399
+
400
+ Without `--payload`, Gateway Invoke opens a persistent POST JSON console. Bare
401
+ invoke opens the Gateway picker, while `--id` opens the selected Gateway
402
+ directly. `--path`, `--session-id`, MCP session flags, `--header`, and
403
+ `--bearer-token` seed the console. Interactive bearer tokens may be inline or
404
+ `file://` sources, but not stdin. Explicit headless-only flags such as
405
+ `--method`, `--accept`, `--content-type`, `--output-file`, or `--json` keep the
406
+ command headless.
407
+
408
+ The console generates and displays a Runtime session ID, adopts returned Runtime
409
+ and MCP sessions, and streams textual responses as they arrive. An empty path
410
+ uses the exact `gatewayUrl`; `Ctrl+P` edits the raw Gateway-relative path and
411
+ `Ctrl+T` switches Gateways. Switching Gateways clears request context, while
412
+ changing paths preserves the draft and Gateway authentication but starts fresh
413
+ sessions.
414
+
415
+ | Shortcut | Action |
416
+ | ------------- | -------------------------------------------- |
417
+ | `Enter` | Send the JSON request |
418
+ | `Shift+Enter` | Insert a newline |
419
+ | `Ctrl+P` | Edit the Gateway-relative path |
420
+ | `Ctrl+T` | Change Gateway |
421
+ | `Ctrl+V` | Toggle raw and pretty completed JSON |
422
+ | `Esc` | Interrupt an active request or navigate back |
423
+ | `↑`/`↓` | Scroll response history |
424
+
425
+ Gateway Invoke V1 has no request-type selector, target/path discovery,
426
+ tool/model discovery command, authentication editor, or protocol-specific
427
+ payload builder. Callers provide the Gateway-relative route and protocol payload
428
+ directly. GET and DELETE remain available through headless invoke.
25
429
 
26
- > **Upgrading from the Bedrock AgentCore Starter Toolkit?** If the old Python CLI is still installed, you'll see a
27
- > warning after install asking you to uninstall it. Both CLIs use the `agentcore` command name, so having both can cause
28
- > confusion. Uninstall the old one using whichever tool you originally used:
29
- >
30
- > ```bash
31
- > pip uninstall bedrock-agentcore-starter-toolkit # if installed via pip
32
- > pipx uninstall bedrock-agentcore-starter-toolkit # if installed via pipx
33
- > uv tool uninstall bedrock-agentcore-starter-toolkit # if installed via uv
34
- > ```
430
+ ### Invoke a Runtime
431
+
432
+ Headless invocation accepts inline, file, or stdin payload bytes:
35
433
 
36
434
  ```bash
37
- npm install -g @aws/agentcore
435
+ # Inline
436
+ agentcore runtime invoke \
437
+ --id <runtimeId> \
438
+ --payload '{"action":"status"}' \
439
+ --content-type application/json \
440
+ --accept text/event-stream
441
+
442
+ # File
443
+ agentcore runtime invoke --id <runtimeId> --payload file://request.json
444
+
445
+ # stdin
446
+ cat request.json | agentcore runtime invoke --id <runtimeId> --payload -
38
447
  ```
39
448
 
40
- ## Quick Start
449
+ CUSTOM_JWT Runtimes require `--bearer-token`. The token accepts the same inline,
450
+ `file://`, or stdin sources as the payload; payload and token cannot both read
451
+ stdin.
452
+
453
+ ```bash
454
+ agentcore runtime invoke \
455
+ --id <runtimeId> \
456
+ --payload file://request.json \
457
+ --bearer-token file://$HOME/.config/agentcore/runtime-token
458
+ ```
41
459
 
42
- Use the terminal UI to walk through all commands interactively, or run each command individually:
460
+ For MCP Runtimes, initialize first, then pass the returned Runtime and MCP
461
+ session IDs to later methods. MCP requests accept both JSON and SSE responses.
43
462
 
44
463
  ```bash
45
- # Launch terminal UI
46
- agentcore
464
+ agentcore runtime invoke \
465
+ --id <runtimeId> \
466
+ --payload '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-03-26","capabilities":{},"clientInfo":{"name":"agentcore-cli","version":"1"}}}' \
467
+ --accept 'application/json, text/event-stream' \
468
+ --mcp-protocol-version 2025-03-26 \
469
+ --mcp-method initialize
47
470
 
48
- # Create a new project (wizard guides you through agent setup)
49
- agentcore create
50
- cd my-project
471
+ agentcore runtime invoke \
472
+ --id <runtimeId> \
473
+ --payload '{"jsonrpc":"2.0","id":2,"method":"tools/list","params":{}}' \
474
+ --accept 'application/json, text/event-stream' \
475
+ --session-id <returnedRuntimeSessionId> \
476
+ --mcp-session-id <returnedMcpSessionId> \
477
+ --mcp-protocol-version 2025-03-26 \
478
+ --mcp-method tools/list
479
+ ```
51
480
 
52
- # Test locally
53
- agentcore dev
481
+ Raw stdout always streams exact response bytes as they arrive, regardless of
482
+ content type. `--output-file` streams the same bytes directly to disk. Binary or
483
+ unknown responses require `--output-file` or `--json` when stdout is a terminal.
484
+ Response metadata is written to stderr.
54
485
 
55
- # Deploy to AWS
56
- agentcore deploy
486
+ `--json` buffers the complete response, including streaming representations, and
487
+ emits one metadata envelope without interpreting the customer body. If a raw or
488
+ file response fails, bytes already written remain available and the stderr
489
+ summary reports `complete=false`. A failed JSON response emits no partial
490
+ envelope.
57
491
 
58
- # Test deployed agent
59
- agentcore invoke
492
+ ```bash
493
+ agentcore runtime invoke \
494
+ --id <runtimeId> \
495
+ --payload file://request.bin \
496
+ --content-type application/octet-stream \
497
+ --accept application/octet-stream \
498
+ --output-file response.bin
60
499
 
500
+ agentcore runtime invoke --id <runtimeId> --payload '{"action":"status"}' --json
501
+ # {"statusCode":200,"contentType":"application/json","bodyEncoding":"utf8","body":"{\"ok\":true}","complete":true}
61
502
  ```
62
503
 
63
- ## Supported Frameworks
504
+ Without `--payload`, Runtime Invoke opens a persistent JSON console for repeated
505
+ requests. The console sends inline `application/json` payloads and renders each
506
+ response according to its returned content type. Bare invoke opens the Runtime
507
+ and endpoint pickers; `--id` skips the Runtime picker, and `--id` plus
508
+ `--qualifier` opens the console directly. `--session-id` resumes that Runtime
509
+ session in the console. `--user-id`, `--header`, and `--bearer-token` seed
510
+ request context that persists across sends and endpoint changes within that
511
+ Runtime. The console never displays their values, and switching Runtimes clears
512
+ them. Interactive bearer tokens may be inline or `file://` sources, but not
513
+ stdin.
514
+
515
+ | Shortcut | Action |
516
+ | ------------- | -------------------------------------------- |
517
+ | `Enter` | Send the JSON request |
518
+ | `Shift+Enter` | Insert a newline |
519
+ | `Ctrl+T` | Change Runtime or endpoint |
520
+ | `Ctrl+V` | Toggle raw and pretty completed JSON |
521
+ | `Esc` | Interrupt an active request or navigate back |
522
+ | `↑`/`↓` | Scroll response history |
64
523
 
65
- | Framework | Notes |
66
- | ------------------- | ----------------------------- |
67
- | Strands Agents | AWS-native, streaming support |
68
- | LangChain/LangGraph | Graph-based workflows |
69
- | Google ADK | Gemini models only |
70
- | OpenAI Agents | OpenAI models only |
524
+ Runtime Invoke accepts Runtime IDs from the current account only. It does not
525
+ accept ARNs, `--version`, `--interactive`, cross-account targets, or custom
526
+ request paths. All requests use the Runtime `/invocations` route, including MCP
527
+ Runtimes.
71
528
 
72
- ## Supported Model Providers
529
+ ### Open a Runtime shell
73
530
 
74
- | Provider | API Key Required | Default Model |
75
- | -------------- | ------------------------- | -------------------------------------------- |
76
- | Amazon Bedrock | No (uses AWS credentials) | us.anthropic.claude-sonnet-4-5-20250514-v1:0 |
77
- | Anthropic | Yes | claude-sonnet-4-5-20250514 |
78
- | Google Gemini | Yes | gemini-2.5-flash |
79
- | OpenAI | Yes | gpt-4.1 |
531
+ Runtime Shell opens a persistent interactive terminal in a Runtime session.
532
+ Bare shell opens the Runtime and endpoint pickers. `--id` skips the Runtime
533
+ picker, and `--id` plus `--qualifier` connects directly.
80
534
 
81
- ## Commands
535
+ ```bash
536
+ agentcore runtime shell
537
+ agentcore runtime shell --id <runtimeId>
538
+ agentcore runtime shell --id <runtimeId> --qualifier DEFAULT
539
+ ```
82
540
 
83
- ### Project Lifecycle
541
+ Use `--session-id` to open the shell in a specific Runtime session/VM:
84
542
 
85
- | Command | Description |
86
- | -------- | ------------------------------ |
87
- | `create` | Create a new AgentCore project |
88
- | `dev` | Start local development server |
89
- | `deploy` | Deploy infrastructure to AWS |
90
- | `invoke` | Invoke deployed agents |
543
+ ```bash
544
+ agentcore runtime shell \
545
+ --id <runtimeId> \
546
+ --qualifier DEFAULT \
547
+ --session-id <runtimeSessionId>
548
+ ```
91
549
 
92
- ### Resource Management
550
+ CUSTOM_JWT Runtimes require `--bearer-token`. Interactive bearer tokens may be
551
+ inline or `file://` sources, but not stdin.
93
552
 
94
- | Command | Description |
95
- | -------- | ---------------------------------------------------- |
96
- | `add` | Add agents, memory, credentials, evaluators, targets |
97
- | `remove` | Remove resources from project |
553
+ The shell forwards terminal input byte-for-byte, including `Ctrl+C`, `Ctrl+D`,
554
+ escape sequences, and full-screen terminal applications. Terminal resize events
555
+ update the remote PTY. Running `exit` or sending `Ctrl+D` terminates the remote
556
+ shell.
98
557
 
99
- > **Note**: Run `agentcore deploy` after `add` or `remove` to update resources in AWS.
558
+ Runtime Shell requires TTY stdin and stdout and does not support `--json` or
559
+ `--endpoint-url`.
100
560
 
101
- ### Observability
561
+ Bare Runtime branches and leaves, plus `memory`, `memory get`, and `memory list`,
562
+ require a TTY on stdin and stdout.
563
+ For Runtime Invoke, supplying a payload or headless-only request or output flags
564
+ runs headlessly; `--session-id` can instead seed the persistent console.
565
+ Supplying Memory operation flags runs those commands headlessly, and `--json`
566
+ always suppresses TUI rendering. The `memory event` and `memory record` groups
567
+ are headless: invoking a group without a leaf prints help, and their leaves
568
+ require resource selectors.
102
569
 
103
- | Command | Description |
104
- | ------------- | --------------------------------------- |
105
- | `logs` | Stream or search agent runtime logs |
106
- | `traces list` | List recent traces for a deployed agent |
107
- | `traces get` | Download a trace to a JSON file |
108
- | `status` | Show deployed resource details |
570
+ ```bash
571
+ agentcore runtime
572
+ agentcore runtime list
573
+ agentcore runtime get
574
+ agentcore runtime version list
575
+ agentcore runtime endpoint list
576
+ agentcore memory
577
+ agentcore memory list
578
+ agentcore memory get
579
+ agentcore memory event
580
+ agentcore memory record
581
+ ```
109
582
 
110
- ### Evaluations
583
+ The Identity TUI is read-only: bare `identity` branches and the `get`/`list`
584
+ leaves open interactive menus and detail views. Mutations (`create`, `update`,
585
+ `delete`) remain available through the CLI and are omitted from the TUI menus.
111
586
 
112
- | Command | Description |
113
- | ----------------------- | ------------------------------------------------ |
114
- | `add evaluator` | Add a custom LLM-as-a-Judge evaluator |
115
- | `add online-eval` | Add continuous evaluation for live traffic |
116
- | `run eval` | Run on-demand evaluation against agent traces |
117
- | `run batch-evaluation` | Run evaluators across all sessions [preview] |
118
- | `run recommendation` | Optimize prompts and tool descriptions [preview] |
119
- | `evals history` | View past eval run results |
120
- | `pause online-eval` | Pause a deployed online eval config |
121
- | `resume online-eval` | Resume a paused online eval config |
122
- | `stop batch-evaluation` | Stop a running batch evaluation [preview] |
123
- | `logs evals` | Stream or search online eval logs |
587
+ ```bash
588
+ agentcore identity
589
+ agentcore identity api-key-credential-provider list
590
+ agentcore identity api-key-credential-provider get
591
+ agentcore identity oauth2-credential-provider list
592
+ agentcore identity oauth2-credential-provider get
593
+ ```
124
594
 
125
- ### Config Bundles [preview]
595
+ The Gateway TUI is read-only: bare Gateway, Target, Connector, and Rule
596
+ branches and their `get`/`list` leaves open command menus and scoped selection
597
+ flows. Connector is presented as a separate resource experience while using
598
+ Gateway Target operations internally.
126
599
 
127
- | Command | Description |
128
- | ------------------- | ----------------------------------------- |
129
- | `add config-bundle` | Add a versioned configuration bundle |
130
- | `cb versions` | List version history for a bundle |
131
- | `cb diff` | Diff two versions of a bundle |
132
- | `cb create-branch` | Create a new branch on an existing bundle |
600
+ ```bash
601
+ agentcore gateway
602
+ agentcore gateway list
603
+ agentcore gateway get
604
+ agentcore gateway target list
605
+ agentcore gateway target get
606
+ agentcore gateway connector list
607
+ agentcore gateway connector get
608
+ agentcore gateway rule list
609
+ agentcore gateway rule get
610
+ ```
133
611
 
134
- > Create agents with `--with-config-bundle` to auto-wire config bundle support into the generated template.
612
+ ---
135
613
 
136
- ### Utilities
614
+ # Architecture & patterns
137
615
 
138
- | Command | Description |
139
- | -------------- | ----------------------------------------- |
140
- | `validate` | Validate configuration files |
141
- | `package` | Package agent artifacts without deploying |
142
- | `fetch access` | Fetch access info for deployed resources |
143
- | `update` | Check for and install CLI updates |
616
+ This section documents the architectural conventions the codebase is built
617
+ around. They exist to keep the app modular, testable, and predictable as it
618
+ grows.
144
619
 
145
- ## Project Structure
620
+ ## The big picture
146
621
 
147
622
  ```
148
- my-project/
149
- ├── agentcore/
150
- │ ├── .env.local # API keys (gitignored)
151
- │ ├── agentcore.json # Resource specifications
152
- │ ├── aws-targets.json # Deployment targets
153
- │ └── cdk/ # CDK infrastructure
154
- ├── app/ # Application code
623
+ ┌───────────────────────────┐
624
+ argv ─────────────▶ │ Router / Handler tree │ src/router, src/handlers
625
+ │ (flags, args, middleware)│
626
+ └────────────┬──────────────┘
627
+ │
628
+ flags/args ? │ bare command ?
629
+ │ │ │
630
+ ▼ ▼
631
+ ┌─────────────────┐ ┌───────────────────┐
632
+ │ headless handler│ │ Ink/React TUI │ src/tui, src/components
633
+ │ → JSON output │ │ (same handlers) │
634
+ └────────┬────────┘ └────────┬──────────┘
635
+ │ │
636
+ └──────────┬─────────────┘
637
+ ▼
638
+ ┌───────────────────────┐
639
+ │ Core (CoreClient) │ src/core
640
+ │ feature sub-clients │
641
+ └──────────┬────────────┘
642
+ ▼
643
+ AWS SDK: Bedrock AgentCore (control + data) + IAM
155
644
  ```
156
645
 
157
- ### App Structure
646
+ The CLI and the TUI are two front-ends over the **same** handler tree and the
647
+ **same** `Core` clients. Dependencies are injected at the edge in the main entrypoint (`src/index.ts`),
648
+ which is what makes the whole thing testable end-to-end.
649
+
650
+ ## The Router / Handler framework
651
+
652
+ The whole CLI is expressed as a tree of **`Handler`** nodes wired together by a
653
+ **`Router`** (`src/router/`). A `Router` is itself a mountable branch node, so
654
+ routers nest to form the command tree (`agentcore` → `harness` → `get`). Every
655
+ command — branch or leaf — is a `Handler`:
656
+
657
+ - **Branch nodes** (routers) host subcommands and may declare group-level
658
+ ("global") flags and middleware that apply to everything beneath them. A
659
+ branch can also register a **default handler** (`router.default(...)`) that
660
+ runs when the branch is invoked with no subcommand (e.g. bare `agentcore` or
661
+ `agentcore harness` — this is how the TUI launches).
662
+ - **Leaf nodes** (built with `createHandler(...)`) do the work. They declare
663
+ their own flags/arguments (validated and coerced via zod schemas) and receive
664
+ a typed object in `handle(ctx, flags, args)`.
665
+
666
+ Every node — branch or leaf — satisfies the `Handler` interface:
158
667
 
668
+ ```ts
669
+ export interface Handler {
670
+ name(): string;
671
+ description(): string;
672
+ flags(): Flag[];
673
+ arguments(): Argument[];
674
+ // At runtime `handle` receives the validated, coerced flags object. The precise
675
+ // shape is supplied to authors via createHandler's generic; the interface keeps
676
+ // it erased so middleware can forward it uniformly.
677
+ handle: (ctx: Context, flags: any, args: any) => Promise<void>;
678
+ children(): Handler[];
679
+ }
159
680
  ```
160
- ├── app/ # Application code
161
- │ └── <AgentName>/ # Agent directory
162
- │ ├── main.py # Agent entry point
163
- │ ├── pyproject.toml # Python dependencies
164
- │ └── model/ # Model configuration
681
+
682
+ Under the hood the tree is compiled into a [Commander](https://github.com/tj/commander.js)
683
+ command tree (`src/router/router.tsx`), so `--help`, argument parsing, and error
684
+ handling come from a battle-tested parser while the authoring API stays small.
685
+
686
+ Cross-cutting values flow through a typed **`Context`**. Group-level flags
687
+ (`globalFlag(...)`) double as context keys, so a flag declared high in the tree
688
+ is read type-safely by any descendant via `ctx.value(key)` / `ctx.require(key)`.
689
+
690
+ ```ts
691
+ export interface Context {
692
+ // value returns the value previously stored under `key`, or undefined if absent.
693
+ value<V>(key: ContextKey<V>): V | undefined;
694
+ // require returns the value stored under `key`, throwing if it is absent.
695
+ require<V>(key: ContextKey<V>): V;
696
+ // withValue returns a new Context that carries `key`/`value` on top of this one.
697
+ withValue<V>(key: ContextKey<V>, value: V): Context;
698
+ }
699
+ ```
700
+
701
+ **Middleware** (`router.use(...)`) wraps handlers down the subtree in
702
+ ancestor-first order — for example `withRegion` resolves the effective AWS
703
+ region once at the root and pins it on the context for every command below. A
704
+ middleware is just a function that wraps one `Handler` in another:
705
+
706
+ ```ts
707
+ export type Middleware = (handler: Handler) => Handler;
165
708
  ```
166
709
 
167
- ## Configuration
710
+ ### Putting it all together
168
711
 
169
- Projects use JSON schema files in the `agentcore/` directory:
712
+ A minimal, self-contained example — a router with one piece of middleware and a
713
+ `greet` leaf handler:
170
714
 
171
- - `agentcore.json` - Agent specifications, memory, credentials, evaluators, online evals
172
- - `deployed-state.json` - Runtime state in agentcore/.cli/ (auto-managed)
173
- - `aws-targets.json` - Deployment targets (account, region)
715
+ ```ts
716
+ import z from "zod";
717
+ import { Router, createHandler, flag, globalFlag, type Middleware } from "./router";
174
718
 
175
- ## Capabilities
719
+ // A group-level flag that doubles as a typed context key.
720
+ const LoudKey = globalFlag("loud", "shout the greeting", z.boolean().default(false));
176
721
 
177
- - **Runtime** - Managed execution environment for deployed agents
178
- - **Memory** - Semantic, summarization, and user preference strategies
179
- - **Credentials** - Secure API key management via Secrets Manager
180
- - **Evaluations** - LLM-as-a-Judge for on-demand and continuous agent quality monitoring
722
+ // Middleware wraps every handler beneath where it's mounted. Here it just logs.
723
+ const withLogging = (): Middleware => (h) => ({
724
+ name: () => h.name(),
725
+ description: () => h.description(),
726
+ flags: () => h.flags(),
727
+ arguments: () => h.arguments(),
728
+ children: () => h.children(),
729
+ handle: async (ctx, flags, args) => {
730
+ console.error(`> running ${h.name()}`);
731
+ await h.handle(ctx, flags, args);
732
+ },
733
+ });
181
734
 
182
- ## Documentation
735
+ // A leaf handler. `flags` is precisely typed from the zod schemas, and the
736
+ // group-level LoudKey is read back off the context.
737
+ const greet = createHandler({
738
+ name: "greet",
739
+ description: "greet someone",
740
+ flags: [flag("name", "who to greet", z.string().default("world"))] as const,
741
+ handle: async (ctx, flags) => {
742
+ const message = `hello, ${flags.name}!`;
743
+ console.log(ctx.value(LoudKey) ? message.toUpperCase() : message);
744
+ },
745
+ });
183
746
 
184
- - [CLI Commands Reference](docs/commands.md) - Full command reference for scripting and CI/CD
185
- - [Configuration](docs/configuration.md) - Schema reference for config files
186
- - [Evaluations](docs/evals.md) - Evaluators, on-demand evals, and online monitoring
187
- - [Batch Evaluation](docs/batch-evaluation.md) - Run evaluators across sessions at scale [preview]
188
- - [Recommendations](docs/recommendations.md) - Optimize prompts and tool descriptions [preview]
189
- - [Config Bundles](docs/config-bundles.md) - Versioned runtime configurations [preview]
190
- - [Frameworks](docs/frameworks.md) - Supported frameworks and model providers
191
- - [Gateway](docs/gateway.md) - Gateway setup, targets, and authentication
192
- - [Memory](docs/memory.md) - Memory strategies and sharing
193
- - [Local Development](docs/local-development.md) - Dev server and debugging
747
+ // Wire it together: flags + middleware live on the router, handlers mount under it.
748
+ const app = new Router("demo", "a tiny demo CLI")
749
+ .groupFlags(LoudKey)
750
+ .use(withLogging())
751
+ .handler(greet);
752
+
753
+ await app.route(process.argv);
754
+ ```
755
+
756
+ ```bash
757
+ demo greet --name Ada # hello, Ada!
758
+ demo greet --name Ada --loud # HELLO, ADA!
759
+ ```
194
760
 
195
- ## Feedback & Issues
761
+ ## Adding a new handler
196
762
 
197
- Found a bug or have a feature request? [Open an issue](https://github.com/aws/agentcore-cli/issues/new) on GitHub.
763
+ Each command lives in its own directory with a consistent file layout. Using
764
+ `harness` as the model:
198
765
 
199
- ## Security
766
+ ```
767
+ src/handlers/harness/
768
+ ├── index.tsx # createHarnessHandler(core): builds the Router/Handler, wires
769
+ │ # subcommands, middleware, flags, and the default handler
770
+ ├── screen.tsx # the Ink/React screen(s) rendered for this command in the TUI
771
+ ├── types.tsx # the interface(s) this command consumes from Core (see below)
772
+ ├── get/ # a subcommand, same layout recursively
773
+ │ ├── index.tsx
774
+ │ └── screen.tsx
775
+ └── list/
776
+ ├── index.tsx
777
+ └── screen.tsx
778
+ ```
779
+
780
+ Conventions:
781
+
782
+ - **`index.tsx`** exports a `create<Name>Handler(core)` factory returning a
783
+ `Handler`/`Router`. Dependencies (the `Core` client) are passed in, never
784
+ imported as singletons. Re-export the command's `screen.tsx` from here.
785
+ - **`screen.tsx`** exports the React component(s) for the TUI. Screens receive
786
+ `ScreenProps` (`{ ctx, core }`) threaded down from `Root`, and drive data
787
+ fetching with react-query against `core`.
788
+ - **`types.tsx`** defines the interface(s) this command needs from Core.
789
+ - Shared helpers live in a sibling `utils.tsx` (e.g. `coreOptsFromCtx(ctx)`
790
+ builds the standard `CoreOptions` from context values).
791
+ - Shared components live in `src/components/`: anything rendered by more than
792
+ one screen belongs there (e.g. `Layout`, `RouterScreen`, `HarnessPicker`),
793
+ with the vendored InkUI primitives under `src/components/ui/`. A handler
794
+ directory contains only the screens for its own command.
795
+
796
+ Mount the new handler by adding `root.handler(create<Name>Handler(core))` in
797
+ `src/handlers/index.tsx` (or on the appropriate parent router).
798
+
799
+ ## Core and dependency inversion
800
+
801
+ Business logic and all I/O (AWS SDK calls, etc.) live in **`src/core/`**, behind
802
+ a `CoreClient` that exposes feature-scoped sub-clients (e.g. `core.harness`).
803
+ `CoreClient` owns the underlying AWS clients — the Bedrock AgentCore
804
+ **control** plane (CRUD, versions, endpoints), the **data** plane (invoke, exec
805
+ streaming), **IAM** (default execution roles) — caching one per config.
806
+
807
+ The important rule: **interfaces are defined by their consumers, not by Core.**
808
+ The `CoreHarnessClient` interface lives in `src/handlers/harness/types.tsx` —
809
+ next to the handler that uses it — and `src/core/harness.tsx` provides the
810
+ implementation. Handlers depend on the interface they declare; Core depends on
811
+ nothing about the handlers. This is **dependency inversion**: the
812
+ high-level policy (handlers) owns the abstraction, and the low-level detail
813
+ (Core/SDK) conforms to it.
814
+
815
+ Construction is also inverted. `CoreClient` doesn't build SDK clients directly;
816
+ it takes **factory functions** (`(config) => new BedrockAgentCore...Client(...)`)
817
+ injected at the app edge in `src/index.ts`. That keeps the SDK swappable —
818
+ crucial for the testing strategy below.
819
+
820
+ ## The TUI
821
+
822
+ The interactive UI is built with [Ink](https://github.com/vadimdemedes/ink)
823
+ (React for the terminal). `renderTui` mounts the `Root` component
824
+ (`src/components/Root.tsx`) — a MemoryRouter over the app's route table plus a
825
+ react-query client — seeded at the command's path. Because routes map to the
826
+ same handler paths as the CLI, deep-linking works: `harness invoke --id X` opens
827
+ the chat screen at that harness. Ink reads and writes through the injected IO
828
+ streams, so the TUI is fully testable without a real terminal.
829
+
830
+ ## Testing
831
+
832
+ Tests sit next to the code they cover as `<file>.test.tsx` (e.g.
833
+ `src/router/router.test.ts`), run with `bun test`. Shared test infrastructure
834
+ lives in `src/testing/`.
835
+
836
+ The guiding principle is **test behavior, not implementation**: a good test lets
837
+ a maintainer refactor freely and only fails when observable behavior changes.
838
+ This is possible because the app injects every dependency at its edges, so a
839
+ test can build the whole CLI with test doubles at the boundary and drive a real
840
+ command flow — argument parsing, middleware, handler, Core, and (for the TUI)
841
+ rendering — as a single unit, asserting on the output a user would see.
842
+
843
+ We aim for **90% line coverage** (`bun test --coverage`).
844
+
845
+ ### Injected IO
846
+
847
+ Nothing in the app reaches for `process.stdout`/`console.*` directly. An `AppIO`
848
+ (`{ stdin, stdout, stderr }`, defined in `src/handlers/types.tsx`) is passed to
849
+ `createRootHandler(core, io)` at the edge (`src/index.ts` passes the real process
850
+ streams) and threaded down to the TUI renderer and handlers. JSON output flows
851
+ through the context: a `withJsonRenderer` middleware pins a `JsonRenderer` wired
852
+ to the configured stdout, and leaf handlers emit via
853
+ `ctx.require(JsonRendererKey).renderJson(...)`. In tests, `testIO()` supplies an
854
+ in-memory `AppIO` with `stdout()`/`stderr()` accessors, so a command's output is
855
+ captured with no global patching.
856
+
857
+ ### Golden files and record mode
858
+
859
+ Handler tests run the real `CoreClient` over fixture-backed SDK clients and
860
+ compare rendered output against committed **golden files**. The record/replay
861
+ seam sits at the SDK `.send()` boundary (the same seam `src/index.ts` wires the
862
+ real clients into), so replayed tests still exercise the real `CoreClient`,
863
+ `HarnessClient`, and option translation — only the network call is swapped out.
864
+
865
+ Two modes, selected by the `RECORD` env var:
866
+
867
+ ```bash
868
+ RECORD=1 bun test # hit the live AWS APIs and (re)write fixtures + golden files
869
+ bun test # replay the saved fixtures; never touch the network
870
+ ```
871
+
872
+ Recording lets the suite be fast, deterministic, and runnable offline/in CI.
873
+ Refresh the fixtures by re-running in record mode when the APIs or expected
874
+ output change. Fixtures are Date-safe (Dates round-trip via a tagged encoding)
875
+ and strip volatile transport metadata (`$metadata`, request IDs) so they stay
876
+ stable. Golden files are excluded from Prettier (`.prettierignore`) — they are
877
+ byte-for-byte recordings, not source to reformat.
878
+
879
+ See [this talk](https://www.youtube.com/watch?v=yszygk1cpEc&t=1s) for background
880
+ on the pattern.
881
+
882
+ ### TUI tests
883
+
884
+ Screens are tested with
885
+ [`ink-testing-library`](https://github.com/vadimdemedes/ink-testing-library) via
886
+ the `renderScreen(path, { core })` helper (`src/testing/renderScreen.tsx`). It
887
+ mounts the real `Root` (MemoryRouter + the app's route table + react-query)
888
+ seeded at a command path — exactly how the CLI mounts a screen — so routing,
889
+ route params, data fetching, key input, and rendering are all exercised
890
+ together. Data comes from a `TestCoreClient` (a hand-controllable `Core` that
891
+ returns canned responses, forces errors, and records calls). Assertions read the
892
+ rendered frame (`waitForText`, `lastFrame`) and key presses drive navigation
893
+ between screens (`press`, `write`).
894
+
895
+ ## Repository layout
896
+
897
+ ```
898
+ src/
899
+ index.ts # app entry: wires real SDK factories + process IO into the root handler
900
+ router/ # the Router/Handler framework (compiles to Commander)
901
+ handlers/ # the command tree; one directory per command (index/screen/types)
902
+ core/ # CoreClient + feature sub-clients; all AWS SDK I/O lives here
903
+ middleware/ # cross-cutting middleware (withRegion, withJsonRenderer, ...)
904
+ tui/ # Ink renderer entry (renderTui / renderTuiAt) + JSON renderer
905
+ components/ # shared TUI components; ui/ holds vendored InkUI primitives
906
+ testing/ # test doubles + helpers (testIO, renderScreen, fixtures, golden IO)
907
+ runnable/ # top-level run/exit-code wrapper
908
+ ```
909
+
910
+ ---
911
+
912
+ # Development
913
+
914
+ Install [Bun](https://bun.com).
915
+
916
+ ```bash
917
+ brew install oven-sh/bun/bun
918
+ ```
919
+
920
+ Install dependencies:
921
+
922
+ ```bash
923
+ bun install
924
+ ```
925
+
926
+ Run from source:
927
+
928
+ ```bash
929
+ bun run start
930
+ ```
931
+
932
+ Run tests:
933
+
934
+ ```bash
935
+ bun test
936
+ ```
937
+
938
+ ## Run Locally
939
+
940
+ Build, then symlink the `agentcore` command globally so it works from any directory:
941
+
942
+ ```bash
943
+ bun run build
944
+ npm link
945
+ ```
946
+
947
+ Re-run `bun run build` after changes; the linked command picks it up. Remove with:
948
+
949
+ ```bash
950
+ npm unlink -g @aws/agentcore
951
+ ```
952
+
953
+ To test the exact published artifact instead:
954
+
955
+ ```bash
956
+ npm pack # builds via prepublishOnly, creates the .tgz
957
+ npm i -g ./aws-agentcore-0.28.1.tgz
958
+ ```
959
+
960
+ ## Windows notes
961
+
962
+ - **`agentcore.ps1 cannot be loaded because running scripts is disabled`**: the
963
+ npm shim is a PowerShell script and Windows Server defaults to a `Restricted`
964
+ execution policy. Run `Set-ExecutionPolicy -Scope CurrentUser RemoteSigned`
965
+ once, or call `agentcore.cmd`. The compiled `.exe` has no shim.
966
+ - **The CLI looks frozen in a PowerShell window**: legacy conhost pauses all
967
+ output while text is selected (the title bar shows `Select`). Press `Esc`.
968
+ Windows Terminal does not do this.
969
+ - **`project create` refuses a long path**: Windows caps paths at 260 characters
970
+ unless `LongPathsEnabled` is set, and the CDK app's `node_modules` needs about
971
+ 100 of them. Create the project higher in the tree or enable long paths.
972
+
973
+ # Build
974
+
975
+ Run `make` to verify bun is installed, build the Node bundle, and compile all native binaries:
976
+
977
+ ```bash
978
+ make # check-bun -> build -> compile (all platforms)
979
+ make bundle # node bundle only (dist/index.js)
980
+ make compile # native binaries only (dist/bin/)
981
+ make clean # remove dist/
982
+ ```
983
+
984
+ `make` errors out early if bun is not installed.
985
+
986
+ Bundle the CLI into `dist/` for distribution. The bundle targets Node.js and is the artifact published to npm (via the `bin` entry):
987
+
988
+ ```bash
989
+ make bundle
990
+ ```
991
+
992
+ The output (`dist/index.js`) can be run directly with Node:
993
+
994
+ ```bash
995
+ node dist/index.js
996
+ ```
997
+
998
+ ## Native binaries
999
+
1000
+ Compile standalone executables (Bun runtime embedded; no Node/Bun required to run) for all platforms into `dist/bin/`:
1001
+
1002
+ ```bash
1003
+ make compile
1004
+ ```
1005
+
1006
+ Targets (build individually with `bun run compile:<target>`):
1007
+
1008
+ | Script | Output |
1009
+ | ----------------------- | ----------------------------- |
1010
+ | `compile:darwin-x64` | `agentcore-darwin-x64` |
1011
+ | `compile:darwin-arm64` | `agentcore-darwin-arm64` |
1012
+ | `compile:linux-x64` | `agentcore-linux-x64` |
1013
+ | `compile:linux-arm64` | `agentcore-linux-arm64` |
1014
+ | `compile:windows-x64` | `agentcore-windows-x64.exe` |
1015
+ | `compile:windows-arm64` | `agentcore-windows-arm64.exe` |
1016
+
1017
+ Each binary is ~60–95MB (embedded runtime).
1018
+
1019
+ # Formatting
1020
+
1021
+ Format all files with Prettier:
1022
+
1023
+ ```bash
1024
+ bun run format # write changes
1025
+ bun run format:check # check only
1026
+ ```
200
1027
 
201
- See [SECURITY](SECURITY.md) for reporting vulnerabilities and security information.
1028
+ A Husky pre-commit hook runs Prettier (via lint-staged) on staged files automatically. It installs on `bun install`.
202
1029
 
203
- ## License
1030
+ # Next Steps
204
1031
 
205
- This project is licensed under the Apache-2.0 License.
1032
+ - **Cover more AgentCore resources.** The harness surface (CRUD, versions,
1033
+ endpoints, invoke, exec) is fully implemented in both the CLI and the TUI;
1034
+ the same patterns extend naturally to the remaining read-only Memory
1035
+ data-plane operations, browser profiles, and the other AgentCore resources.
1036
+ - **Implement `config`.** The `config` command is currently a stub — it should
1037
+ read/write real global settings (telemetry, log level, ...) through an
1038
+ injected config accessor.