refactor(cli): simplify command composition - #2606
Open
codyhartsook wants to merge 6 commits into
Open
Conversation
5 tasks
codyhartsook
force-pushed
the
api-v2-cli-pr3
branch
from
August 28, 2026 18:36
f8e0966 to
9d26a36
Compare
EItanya
added a commit
that referenced
this pull request
Aug 29, 2026
## 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. [#2559](#2559) : API v2 CLI foundation: template/instance discovery, create/delete, invoke/streaming, JSON output, and quarantining legacy commands. 2. [#2605](#2605) : TUI: browse AgentInstances, load history, and chat through the same A2A path as invoke. 3. [#2606](#2606) : Cleanup: simplify `main.go` and align the command structure with agentregistry. 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 - [x] `make -C go test` - [x] `go test ./core/cli/...` - [x] `make -C go lint` - [x] `make -C go build` - [x] AgentTemplate and AgentInstance CLI smoke test against a local installation --------- Signed-off-by: Cody Hartsook <cody.hartsook@solo.io> Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io> Co-authored-by: Eitan Yarmush <eitan.yarmush@solo.io>
codyhartsook
force-pushed
the
api-v2-cli-pr3
branch
from
August 29, 2026 17:17
9d26a36 to
0d87c1b
Compare
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>
EItanya
force-pushed
the
api-v2-cli-pr3
branch
from
August 29, 2026 19:28
0d87c1b to
a6df794
Compare
EItanya
reviewed
Aug 29, 2026
EItanya
left a comment
Contributor
There was a problem hiding this comment.
The package boundary seems inconsistent: some one-command areas (agenttemplate, envdoc) have subpackages, while root commands such as version, install, bug-report, and dashboard remain in commands. Can we use a clear convention here—e.g. subpackages only for actual command families—and flatten the one-off command packages?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
cmd/kagent/main.goto a small entrypoint backed by a reusable root commandroot.gofocused on composition while each command owns its Cobra wiring and flagsThe resulting boundary is intentionally small:
Root()creates a fresh command tree, command packages own command-specific setup, and the shared connection package owns gRPC, TLS, and temporary port-forward setup. This removes package-level CLI flag state and keeps command behavior out ofmain.go.tui-recording-pr.mp4
This is the third of three related CLI PRs and builds on #2559 and #2605. When reviewed as a stack, the changes unique to this PR are structural; the API v2 workflows and AgentInstance TUI behavior live in the first two PRs.
Related to #2366 and the K13 CLI cutover in
docs/plans/api-v2-execution-plan.md.Test plan
make -C go testgo test ./core/cli/...make -C go lintmake -C go build