Skip to content

feat(cli): add API v2 AgentInstance workflows - #2559

Open
codyhartsook wants to merge 16 commits into
kagent-dev:mainfrom
codyhartsook:api-v2-cli-pr1-split
Open

feat(cli): add API v2 AgentInstance workflows#2559
codyhartsook wants to merge 16 commits into
kagent-dev:mainfrom
codyhartsook:api-v2-cli-pr1-split

Conversation

@codyhartsook

@codyhartsook codyhartsook commented Aug 25, 2026

Copy link
Copy Markdown

Summary

  • Adds API v2 CLI commands for AgentTemplate discovery and AgentInstance lifecycle and invocation
  • Adds typed AgentInstance and upstream A2A clients over the shared gRPC connection
  • Connects through configured gRPC or a temporary controller port-forward, with optional TLS
  • Removes the legacy client-side agent project workflow while retaining mcp

Note that of the 64 files changed, 35 were removals from the legacy CLI project workflow ; no server-side APIs or controllers are removed.

This is the first of three related CLI PRs:

  1. Add the API v2 CLI commands and remove the legacy CLI project workflow.
  2. Rebuild the TUI around AgentInstance and upstream A2A semantics.
  3. Add apply and establish the CLI authentication seam.

Suspend and resume are deliberately not exposed by this CLI work.

Related to #2366 and the K13 CLI cutover in docs/plans/api-v2-execution-plan.md.

Test plan

  • make -C go test
  • go test ./core/cli/...
  • make -C go lint
  • make -C go build
  • AgentTemplate and AgentInstance CLI smoke test against a local installation

Signed-off-by: Cody Hartsook <cody.hartsook@solo.io>
Signed-off-by: Cody Hartsook <cody.hartsook@solo.io>
Signed-off-by: Cody Hartsook <cody.hartsook@solo.io>
Signed-off-by: Cody Hartsook <cody.hartsook@solo.io>
Signed-off-by: Cody Hartsook <cody.hartsook@solo.io>
Signed-off-by: Cody Hartsook <cody.hartsook@solo.io>
@github-actions github-actions Bot added the enhancement New feature or request label Aug 25, 2026
codyhartsook and others added 5 commits August 25, 2026 12:32
Signed-off-by: Cody Hartsook <cody.hartsook@solo.io>
This reverts commit 1e6d4d9.

Signed-off-by: Cody Hartsook <cody.hartsook@solo.io>
Signed-off-by: Cody Hartsook <cody.hartsook@solo.io>
Signed-off-by: Cody Hartsook <cody.hartsook@solo.io>
@github-actions github-actions Bot added enhancement New feature or request and removed enhancement New feature or request labels Aug 25, 2026
Signed-off-by: Cody Hartsook <cody.hartsook@solo.io>
@codyhartsook
codyhartsook marked this pull request as ready for review August 25, 2026 23:57
@codyhartsook
codyhartsook requested a review from a team as a code owner August 25, 2026 23:57
EItanya and others added 2 commits August 25, 2026 20:52
Signed-off-by: Cody Hartsook <cody.hartsook@solo.io>

@EItanya EItanya left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Initial review, I'm still looking for more simplifications, but this is a good start

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This API is still technically supported. Is there a way we can retain this functionality?

@codyhartsook codyhartsook Aug 26, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tracing this again, the wizard was only used by the removed add-mcp command and wrote to the legacy kagent.yaml project workflow. From my understanding, I think it should remain deleted, with AgentTemplate manifests as the mcp binding but open to suggestions

}

func prepareCreateCfg(cfg *CreateCfg) error {
if cfg.Harness == "" {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The following just merged: 76cde41

We can get this out of clientside code

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, done. I removed the client-side create/delete validation and left that to the shared Protovalidate interceptor. The CLI just generates a request ID when one is not supplied.

Comment thread go/core/cli/internal/config/config.go Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we please delete this file and viper, it's just complicated.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed the internal config package and Viper/ishell from the CLI. Root flags now pass through a small explicit connection options struct. Viper still shows up indirectly through the lint tooling, but the CLI no longer uses it.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note that the code line count decreased but added some file change churn, fyi to reviewers

…-cli-pr1-split

Signed-off-by: Cody Hartsook <cody.hartsook@solo.io>

# Conflicts:
#	go/core/v2/a2agateway/gateway.go
#	go/core/v2/a2agateway/gateway_test.go
Signed-off-by: Cody Hartsook <cody.hartsook@solo.io>
@codyhartsook
codyhartsook requested a review from EItanya August 26, 2026 16:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants