Skip to content

bedrock-agentcore: Add invoke-harness command with streamed output #10682

Description

@andresMoreno96

Describe the feature

Add a bedrock-agentcore invoke-harness command to the AWS CLI that calls the InvokeHarness API and prints the agent's streamed response to the terminal.

Example of the desired usage:

aws bedrock-agentcore invoke-harness \
  --harness-arn arn:aws:bedrock-agentcore:eu-central-1:123456789012:harness/my_harness-AbCdEf1234 \
  --runtime-session-id "$(uuidgen)" \
  --message "Hello, what can you do?"

Use Case

The AWS CLI already supports the harness control plane (bedrock-agentcore-control create-harness, get-harness, etc.), but there is no way to send a message to a harness from it. Today the options are:

  • The AgentCore CLI (agentcore invoke --harness-arn ...), which requires Node.js and npm. This is a problem on servers and in organizations that don't allow Node, or where the CDK-based tooling is restricted.
  • boto3 (invoke_harness), which requires writing a script.
  • Raw HTTPS requests with SigV4 signing.

For quick tests, shell scripts, and CI pipelines, a native AWS CLI command would remove the need for extra runtimes or custom code.

Proposed Solution

  • A bedrock-agentcore invoke-harness command mapped to the InvokeHarness API.
  • A convenience --message (or similar) parameter for a single user text message, in addition to the full --messages JSON structure.
  • Streamed text output (contentBlockDelta text) printed to stdout as it arrives, with an option to output the raw event stream as JSON.

Other SDK-generated tools already expose this API; for example, AWS Tools for PowerShell has Invoke-BACHarness.

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

CLI version used

aws-cli/2.36.49 Python/3.14.6 Linux/6.1.186-228.374.amzn2023.x86_64 exec-env/CloudShell exe/x86_64.amzn.2023

Environment details (OS name and version, etc.)

AWS CloudShell (eu-central-1)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature-requestA feature should be added or improved.needs-triageThis issue or PR still needs to be triaged.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions