CLI tool for Amazon Bedrock AgentCore. Manages agent infrastructure lifecycle.
src/
├── index.ts # Library entry - exports ConfigIO, types
├── schema/ # Schema definitions with Zod validators
├── lib/ # Shared utilities (ConfigIO, packaging)
├── cli/ # CLI implementation
│ ├── primitives/ # Resource primitives (add/remove logic per resource type)
│ ├── commands/ # CLI commands (thin Commander registration)
│ ├── tui/ # Terminal UI (Ink/React)
│ ├── operations/ # Shared business logic (schema mapping, deploy, etc.)
│ ├── cdk/ # CDK toolkit wrapper for programmatic CDK operations
│ └── templates/ # Project templating
└── assets/ # Template assets vended to users
Note: CDK L3 constructs are in a separate package @aws/agentcore-cdk.
create- Create new AgentCore projectadd- Add resources (agent, memory, identity, evaluator, online-eval, target)remove- Remove resources (agent, memory, identity, evaluator, online-eval, target, all)deploy- Deploy infrastructure to AWSstatus- Check deployment statusdev- Local development server (CodeZip: uvicorn with hot-reload; Container: Docker build + run with volume mount)invoke- Invoke agents (local or deployed)run evals- Run on-demand evaluation against agent sessionsevals history- View past eval run resultspause online-eval- Pause (disable) a deployed online eval configresume online-eval- Resume (enable) a paused online eval configlogs- Stream or search agent runtime logslogs evals- Stream or search online eval logstraces list- List recent traces for a deployed agenttraces get- Download a trace to a JSON filepackage- Package agent artifacts without deploying (zip for CodeZip, container image build for Container)validate- Validate configuration filesupdate- Check for CLI updateshelp- Display help information
- Template agents: Created from framework templates (Strands, LangChain_LangGraph, CrewAI, GoogleADK, OpenAIAgents, AutoGen)
- BYO agents: Bring your own code with
agentcore add agent --type byo
- CodeZip: Python source is packaged into a zip artifact and deployed to AgentCore Runtime (default)
- Container: Agent is built as a Docker container image, deployed via ECR and CodeBuild. Requires a
Dockerfilein the agent's code directory. Supported container runtimes: Docker, Podman, Finch.
All resource types (agent, memory, identity, evaluator, online-eval, gateway, mcp-tool) are modeled as primitives --
self-contained classes in src/cli/primitives/ that own the full add/remove lifecycle for their resource type.
Each primitive extends BasePrimitive and implements: add(), remove(), previewRemove(), getRemovable(),
registerCommands(), and addScreen().
Current primitives:
AgentPrimitive— agent creation (template + BYO), removal, credential resolutionMemoryPrimitive— memory creation with strategies, removalCredentialPrimitive— credential/identity creation, .env management, removalEvaluatorPrimitive— custom evaluator creation/removal with cross-reference validationOnlineEvalConfigPrimitive— online eval config creation/removalGatewayPrimitive— MCP gateway creation/removalGatewayTargetPrimitive— MCP tool creation/removal with code generation
Singletons are created in registry.ts and wired into CLI commands via cli.ts. See src/cli/AGENTS.md for details on
adding new primitives.
When users run agentcore create, we vend a CDK project at agentcore/cdk/ that:
- Imports
@aws/agentcore-cdkfor L3 constructs - Reads schema files and synthesizes CloudFormation
This package exports utilities for programmatic use:
ConfigIO- Read/write schema files- Schema types -
AgentEnvSpec,AgentCoreProjectSpec, etc. findConfigRoot()- Locate agentcore/ directory
npm test # Run unit tests
npm run test:unit # Same as above
npm run test:integ # Run integration testsAsset files in src/assets/ are protected by snapshot tests. When modifying templates:
npm run test:update-snapshots # Update snapshots after intentional changesSee docs/TESTING.md for details.
@aws/agentcore-cdk- CDK constructs used by vended projects
- Never use inline imports. Imports must always go at the top of the file.
- Wheverever there is a requirement to use something that returns a success result and an error message you must use this format
{ success: Boolean, error?:string}- Always look for existing types before creating a new type inline.
- Re-usable constants must be defined in a constants file in the closest sensible subdirectory.
See docs/tui-harness.md for the full TUI harness usage guide (MCP tools, screen markers, examples, and error
recovery).