aws / aws/agentcore-cli

Support interactive TUI invocation for existing AgentCore Harnesses by ARN

Aperta
#2,008 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
enhancement
Lingua principale
TypeScript
Stelle
283
Fork
95
Merge medio
1g 2h
PR unite (30g)
183

Descrizione

### Description

AgentCore CLI should support opening the existing interactive chat/TUI experience against an already-deployed AgentCore Harness that was created outside the current AgentCore CLI project, such as a Harness created through the AWS Console, Terraform, CloudFormation, or the AgentCore control-plane API.

Today an externally managed Harness can be invoked with:

```bash
agentcore invoke \
--harness-arn arn:aws:bedrock-agentcore:us-west-2:123456789012:harness/example \
--region us-west-2 \
--session-id \
"prompt"
```

However, `--harness-arn` is treated as a non-interactive option. Omitting the prompt results in:

```text
No prompt provided. Usage: agentcore invoke --harness-arn --region "your prompt"
```

This means users of externally managed Harnesses cannot use the CLI's interactive chat/TUI experience and instead have to repeatedly invoke the Harness with individual prompts or build their own frontend.

It would be useful to support something along the lines of:

```bash
agentcore invoke \
--harness-arn \
--region us-west-2 \
--interactive
```

or, if no prompt is supplied and stdin is a TTY, automatically enter interactive mode:

```bash
agentcore invoke \
--harness-arn \
--region us-west-2
```

The interactive session should reuse a single `runtimeSessionId` for the duration of the session and allow an explicitly supplied `--session-id` so an existing Harness session can be resumed.

This would make the AgentCore CLI useful as a general client for managed Harnesses without requiring the Harness infrastructure to be owned or deployed by an AgentCore CLI/CDK project.

This is especially valuable for organizations that manage AgentCore infrastructure centrally with Terraform or CloudFormation while individual developers authenticate using their own AWS credentials.

### Acceptance Criteria

* `agentcore invoke` can enter an interactive terminal chat experience when targeting a Harness with `--harness-arn`.

* The feature works without requiring an AgentCore CLI project or `agentcore deploy`.

* The Harness may have been created by the AWS Console, Terraform, CloudFormation, or API.

* An existing session can be resumed with:

```bash
agentcore invoke \
--harness-arn \
--region \
--session-id \
--interactive
```

* Streaming assistant output is rendered interactively.

* Exiting the TUI reports the session ID so the user can reconnect later.

### Additional Context

A common deployment model is:

```text
Terraform / CloudFormation / AWS Console
|
v
AgentCore Harness
^
|
InvokeHarness API
|
v
Developer CLI
```

In this model, the developer may have permission to invoke the Harness but intentionally does not have permission to deploy or modify it.

The existing CLI can already invoke such a Harness non-interactively:

```bash
agentcore invoke \
--harness-arn \
--region \
--session-id \
"prompt"
```

and `--verbose` exposes structured Harness streaming events such as `toolUse` and `toolResult`. The missing piece is an interactive frontend over the same invocation mechanism.

This would avoid teams having to build custom Harness clients solely to obtain a persistent terminal conversation and visibility into agent tool execution.

It would also make infrastructure ownership independent from developer UX: platform teams could manage Harnesses through their preferred IaC tooling while developers still get the native AgentCore interactive experience.

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Il payload non indica alcun file di implementazione o test. Inizia dal punto di ingresso `agentcore invoke` e dal relativo percorso `--harness-arn` esistente, quindi segui il flusso di streaming di InvokeHarness. Il lavoro è completato quando Harnesses gestiti esternamente possono aprire una chat interattiva, riutilizzare o riprendere una sessione, visualizzare l’output in streaming e riportare l’ID della sessione all’uscita.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
aws, typescript
Ambito
cli
Tipo di issue
Funzionalità
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Tranquilla
Chiarezza
Abbastanza chiara
Idoneità per principianti
48/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.