Test locally

June 29, 2026 ยท View on GitHub

AgentCore CLI

Create, develop, and deploy AI agents to Amazon Bedrock AgentCore

Build Status npm version License

Overview

Amazon Bedrock AgentCore enables you to deploy and operate AI agents securely at scale using any framework and model. AgentCore provides tools and capabilities to make agents more effective, purpose-built infrastructure to securely scale agents, and controls to operate trustworthy agents. This CLI helps you create, develop locally, and deploy agents to AgentCore with minimal configuration.

๐Ÿš€ Jump Into AgentCore

  • Node.js 20.x or later
  • uv for Python agents (install)

Installation

Upgrading from the Bedrock AgentCore Starter Toolkit? If the old Python CLI is still installed, you'll see a warning after install asking you to uninstall it. Both CLIs use the agentcore command name, so having both can cause confusion. Uninstall the old one using whichever tool you originally used:

pip uninstall bedrock-agentcore-starter-toolkit    # if installed via pip
pipx uninstall bedrock-agentcore-starter-toolkit   # if installed via pipx
uv tool uninstall bedrock-agentcore-starter-toolkit # if installed via uv
npm install -g @aws/agentcore

Quick Start

Use the terminal UI to walk through all commands interactively, or run each command individually:

# Launch terminal UI
agentcore

# Create a new project (wizard guides you through agent setup)
agentcore create
cd my-project

# Test locally
agentcore dev

# Deploy to AWS
agentcore deploy

# Test deployed agent
agentcore invoke

Supported Frameworks

FrameworkNotes
Strands AgentsAWS-native, streaming support (Python + TypeScript)
LangChain/LangGraphGraph-based workflows
Google ADKGemini models only
OpenAI AgentsOpenAI models only

Supported Model Providers

ProviderAPI Key RequiredDefault Model
Amazon BedrockNo (uses AWS credentials)us.anthropic.claude-sonnet-4-5-20250514-v1:0
AnthropicYesclaude-sonnet-4-5-20250514
Google GeminiYesgemini-2.5-flash
OpenAIYesgpt-4.1

Commands

Project Lifecycle

CommandDescription
createCreate a new AgentCore project
devStart local development server
deployDeploy infrastructure to AWS
invokeInvoke deployed agents

Resource Management

CommandDescription
addAdd harnesses, agents, memory, credentials, gateways and gateway-targets, evaluators, online evals, online insights, knowledge bases, config bundles, datasets, policy engines and policies, payment managers and payment connectors, runtime endpoints
removeRemove any of the above resources from the project

Note: Run agentcore deploy after add or remove to update resources in AWS.

Harness

A harness bundles a runtime, model, tools, skills, memory, and observability into one declarative config. Use it when you want infra without writing agent code.

CommandDescription
add harnessAdd a harness resource (runtime + model + memory)
add toolAdd a tool to a harness (--harness <name> --type <type> --name <name>)
add skillAdd a skill to a harness (--harness <name> + --path / --s3 / --git)
export harnessExport a harness config to a deployable Strands Python agent under app/

After export harness, read app/<agentName>/EXPORT_NOTES.md before running deploy โ€” it lists any manual follow-up the exporter could not automate.

Observability

CommandDescription
logsStream or search agent runtime logs
traces listList recent traces for a deployed agent
traces getDownload a trace to a JSON file
statusShow deployed resource details

Evaluations

CommandDescription
add evaluatorAdd a custom LLM-as-a-Judge evaluator
add online-evalAdd continuous evaluation for live traffic
run evalRun on-demand evaluation against agent traces
run batch-evaluationRun evaluators across all sessions
run recommendationOptimize prompts and tool descriptions
evals historyView past eval run results
pause online-evalPause a deployed online eval config
resume online-evalResume a paused online eval config
stop batch-evaluationStop a running batch evaluation
logs evalsStream or search online eval logs

Config Bundles

CommandDescription
add config-bundleAdd a versioned configuration bundle
cb versionsList version history for a bundle
cb diffDiff two versions of a bundle
cb create-branchCreate a new branch on an existing bundle

Create agents with --with-config-bundle to auto-wire config bundle support into the generated template.

A/B Tests

CommandDescription
run ab-testStart an A/B test (config-bundle or target-based) on a gateway
view ab-testList A/B test jobs or view one in detail
pause ab-testPause traffic splitting for a running test
resume ab-testResume a paused test
stop ab-testStop a running test (terminal)
promote ab-testApply the winning variant to agentcore.json
archive ab-testDelete the test on the service and clear local history

Knowledge Bases

CommandDescription
add knowledge-baseAdd a managed Bedrock Knowledge Base wired to a gateway

See Knowledge Bases for ingestion, vectorization, and retrieval setup.

Insights โ€” [preview]

Failure-pattern analysis across agent sessions. Insights configs run continuously alongside online evals and surface clusters of bad outcomes.

CommandDescription
add online-insightsAdd a continuous insights config bound to a runtime
run insightsRun on-demand failure analysis across recent sessions
view insightsList insights jobs or view one in detail
pause online-insightsPause a deployed online insights config
resume online-insightsResume a paused online insights config
archive insightsDelete an insights job on the service + clear local history

Policies & Guardrails

Policy engines apply Cedar-based pre/post-call policies to agent invocations โ€” including Bedrock content filters (VIOLENCE, HATE, SEXUAL, MISCONDUCT, INSULTS), prompt-attack detection, and sensitive-information redaction.

CommandDescription
add policy-engineAdd a Cedar policy engine to the project
add policyAdd a policy to a policy engine (form-based guardrails or raw Cedar)

Payments

Pay-per-call agent transactions via the x402 protocol. When a tool call returns 402 Payment Required, the payments system signs and submits payment then retries automatically.

CommandDescription
add payment-managerAdd a payment manager (orchestrates payment sessions for the agent)
add payment-connectorAdd a payment connector with provider credentials (CoinbaseCDP, StripePrivy)

See Payments for the full setup including instrument creation and tool allowlists.

Datasets

Curated session datasets for batch evaluation and recommendation runs.

CommandDescription
add datasetAdd a dataset resource (session list, ground-truth file, or trace filter)
dataset downloadDownload a dataset version locally
dataset publish-versionPublish a new dataset version
dataset remove-versionRemove a dataset version

Web Search Gateway Targets

Add a managed web-search target to a gateway:

agentcore add gateway-target --type connector --connector web-search \
  --gateway <gateway-name> --name <target-name>
# Optional: --exclude-domains "example.com,foo.org"

See Gateway for full target setup including Lambda, MCP, OpenAPI, Smithy, and API Gateway.

Utilities

CommandDescription
validateValidate configuration files
packagePackage agent artifacts without deploying
fetch accessFetch access info for deployed resources
feedbackSend feedback to the AgentCore team (with screenshot)
updateCheck for and install CLI updates

Project Structure

my-project/
โ”œโ”€โ”€ agentcore/
โ”‚   โ”œโ”€โ”€ .env.local          # API keys (gitignored)
โ”‚   โ”œโ”€โ”€ agentcore.json      # Resource specifications
โ”‚   โ”œโ”€โ”€ aws-targets.json    # Deployment targets
โ”‚   โ””โ”€โ”€ cdk/                # CDK infrastructure
โ”œโ”€โ”€ app/                    # Application code

App Structure

โ”œโ”€โ”€ app/                    # Application code
โ”‚   โ””โ”€โ”€ <AgentName>/        # Agent directory
โ”‚       โ”œโ”€โ”€ main.py         # Agent entry point
โ”‚       โ”œโ”€โ”€ pyproject.toml  # Python dependencies
โ”‚       โ””โ”€โ”€ model/          # Model configuration

Configuration

Projects use JSON schema files in the agentcore/ directory:

  • agentcore.json - Project resources (agents, memory, credentials, gateways, evaluators, online evals/insights, knowledge bases, harnesses, policy engines and policies, payment managers and connectors, config bundles, datasets, runtime endpoints)
  • deployed-state.json - Runtime state in agentcore/.cli/ (auto-managed)
  • aws-targets.json - Deployment targets (account, region)

Capabilities

  • Harness - Declarative agent: bundle runtime + tools + skills + memory + observability without writing agent code
  • Runtime - Managed execution environment for deployed agents
  • Memory - Semantic, summarization, user-preference, and episodic strategies
  • Credentials - Secure API key + OAuth credential management via Secrets Manager
  • Gateways - MCP gateways with Lambda / MCP server / OpenAPI / Smithy / API Gateway / web-search / knowledge-base targets
  • Evaluations - LLM-as-a-Judge for on-demand, batch, and continuous agent quality monitoring
  • Recommendations - Auto-optimize system prompts and tool descriptions from real session traces
  • A/B Tests - Traffic-split between config-bundle or target-based variants and promote the winner
  • Insights [preview] - Failure-pattern analysis and clustering across agent sessions
  • Knowledge Bases - Managed Bedrock Knowledge Bases auto-wired to gateways
  • Policies & Guardrails - Cedar pre/post-call policies including Bedrock content filters, prompt-attack detection, and sensitive-information redaction
  • Payments - x402-protocol microtransactions for pay-per-call tools and APIs
  • Config Bundles - Versioned runtime configurations as a separately-deployable resource

Documentation

Reference

Resources & features

  • Memory - Memory strategies and sharing
  • Gateway - Gateway setup, targets, and authentication
  • Knowledge Bases - Managed Bedrock Knowledge Bases wired to gateways
  • Payments - x402-protocol microtransactions for paid tools/APIs
  • Config Bundles - Versioned runtime configurations
  • Container Builds - Container build types and Dockerfile setup

Evaluation & quality

Operations

Examples

See the AgentCore Samples repository for end-to-end examples using the CLI, including multi-agent workflows, MCP gateway targets, and framework integrations.

Feedback & Issues

Have a quick comment or suggestion? Send it from your terminal:

agentcore feedback "your message" --screenshot path/to/screenshot.png

The CLI will display the AWS Customer Agreement and prompt for consent before submitting. See docs/feedback.md for usage details.

For bugs, regressions, or feature requests that need discussion, open an issue on GitHub instead.

Security

See SECURITY for reporting vulnerabilities and security information.

License

This project is licensed under the Apache-2.0 License.