Skip to content

Conversation

@jmhbh
Copy link
Contributor

@jmhbh jmhbh commented Sep 2, 2025

This PR adds the following new features to the kagent CLI.

  1. kagent init creates a bootstrap agent project.
    • Currently supports bootstrapping an agent project for the following model providers. The supported models are the models that we currently support in models.go
      1. OpenAI
      2. Anthropic
      3. AzureOpenAI
      4. Gemini
  2. kagent build builds a docker image for an agent project.
    • By default the image assumes the repository is localhost:5001, the name of the image is the name specified in the agent project's manifest and the tag is latest.
  3. kagent deploy deploys the agent to a kubernetes environement by creating a .

Tested on the following provider and model combinations.

  1. Gemini: gemini-2.0-flash ✅
  2. OpenAI: gpt-4 ✅

Following provider and model combinations are currently being tested

  1. AzureOpenAI: gpt-4 (in progress)
  2. Anthropic: claude-sonnet-4 (in progress)

Follow Ups

  1. Add support for VertexAI and AnthropicVertexAI. I'm currently blocked on procuring working credentials which is why I have temporarily removed some of my previous implementation and am opting to add support for the above in a follow up PR.

@jmhbh jmhbh changed the title (Feat) Implement init, build and `deploy cmd for kagent cli (Feat) Implement init, build and deploy cmd for kagent cli Sep 2, 2025
@jmhbh jmhbh force-pushed the feat/kagent-cli-init-and-deploy-cmd branch from c9bcb22 to 7c23350 Compare September 2, 2025 21:03
…ld and deploy agent projects to kubernetes

Signed-off-by: JM Huibonhoa <jm.huibonhoa@solo.io>
@jmhbh jmhbh force-pushed the feat/kagent-cli-init-and-deploy-cmd branch from 7c23350 to bb66005 Compare September 2, 2025 21:12
@jmhbh jmhbh marked this pull request as ready for review September 2, 2025 21:22
Copilot AI review requested due to automatic review settings September 2, 2025 21:22
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces the core CLI functionality for kagent with three new commands: init, build, and deploy. These commands enable developers to bootstrap agent projects, build Docker images, and deploy agents to Kubernetes environments.

  • Implements project scaffolding with support for OpenAI, Anthropic, AzureOpenAI, and Gemini model providers
  • Adds Docker image building and registry pushing capabilities with configurable image naming
  • Provides Kubernetes deployment functionality with automatic secret management for API keys

Reviewed Changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
go/cli/internal/frameworks/frameworks.go Factory function for creating framework-specific generators
go/cli/internal/frameworks/common/manifest_manager.go Manages kagent.yaml manifest files with validation and persistence
go/cli/internal/frameworks/common/base_generator.go Base generator providing template rendering and project generation
go/cli/internal/frameworks/adk/python/templates/* Python ADK project templates for pyproject.toml, agent code, and Docker configuration
go/cli/internal/frameworks/adk/python/generator.go Python-specific generator implementation with project structure creation
go/cli/internal/cli/init.go Init command implementation with model provider validation
go/cli/internal/cli/deploy.go Deploy command with Kubernetes client setup and Agent CRD creation
go/cli/internal/cli/build.go Build command for Docker image creation and registry operations
go/cli/cmd/kagent/main.go CLI command registration and interactive shell integration

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

- bind cmd flags to config
- add better verbose logging
- use clientcmd for loading kubeConfig
- fix resource existence check logic for secrets and agents

Signed-off-by: JM Huibonhoa <jm.huibonhoa@solo.io>
@jmhbh jmhbh force-pushed the feat/kagent-cli-init-and-deploy-cmd branch from 69869f9 to 2823ac7 Compare September 3, 2025 05:40
EItanya
EItanya previously approved these changes Sep 3, 2025
Copy link
Contributor

@EItanya EItanya left a comment

Choose a reason for hiding this comment

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

Going to approve as is, but I would like to see some of these fixes in a follow-up

Signed-off-by: JM Huibonhoa <jm.huibonhoa@solo.io>
Signed-off-by: JM Huibonhoa <jm.huibonhoa@solo.io>
Comment on lines +51 to +53
def create_model():
"""Create an OpenAI model instance using LiteLLM."""
return LiteLlm(model="openai/{{.ModelName}}")
Copy link
Contributor

Choose a reason for hiding this comment

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

We no longer use LiteLlm for openai, please see the latest code.

Comment on lines +59 to +61
def create_model():
"""Create an Azure OpenAI model instance using LiteLLM."""
return LiteLlm(model="azure/{{.ModelName}}")
Copy link
Contributor

Choose a reason for hiding this comment

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

Same for azure

Signed-off-by: JM Huibonhoa <jm.huibonhoa@solo.io>
Signed-off-by: JM Huibonhoa <jm.huibonhoa@solo.io>
@EItanya EItanya merged commit c420da6 into kagent-dev:main Sep 19, 2025
15 of 16 checks passed
krisztianfekete pushed a commit to krisztianfekete/kagent that referenced this pull request Sep 23, 2025
…ent-dev#838)

This PR adds the following new features to the `kagent` CLI.

1. `kagent init` creates a bootstrap agent project.
- Currently supports bootstrapping an agent project for the following
model providers. The supported models are the models that we currently
support in
[models.go](https://github.com/kagent-dev/kagent/blob/main/go/internal/httpserver/handlers/models.go)
       1. OpenAI
       2. Anthropic
       3. AzureOpenAI
       4. Gemini
2. `kagent build` builds a docker image for an agent project.
- By default the image assumes the repository is `localhost:5001`, the
name of the image is the `name` specified in the agent project's
manifest and the tag is `latest`.
3. `kagent deploy` deploys the agent to a kubernetes environement by
creating a .

Tested on the following provider and model combinations.
1. Gemini:  gemini-2.0-flash ✅
2. OpenAI: gpt-4 ✅

Following provider and model combinations are currently being tested
1. AzureOpenAI: gpt-4 (in progress)
2. Anthropic: claude-sonnet-4 (in progress)

### Follow Ups
1. Add support for `VertexAI` and `AnthropicVertexAI`. I'm currently
blocked on procuring working credentials which is why I have temporarily
removed some of my previous implementation and am opting to add support
for the above in a follow up PR.

---------

Signed-off-by: JM Huibonhoa <jm.huibonhoa@solo.io>
Signed-off-by: krisztianfekete <git@krisztianfekete.org>
krisztianfekete pushed a commit to krisztianfekete/kagent that referenced this pull request Sep 23, 2025
…ent-dev#838)

This PR adds the following new features to the `kagent` CLI.

1. `kagent init` creates a bootstrap agent project.
- Currently supports bootstrapping an agent project for the following
model providers. The supported models are the models that we currently
support in
[models.go](https://github.com/kagent-dev/kagent/blob/main/go/internal/httpserver/handlers/models.go)
       1. OpenAI
       2. Anthropic
       3. AzureOpenAI
       4. Gemini
2. `kagent build` builds a docker image for an agent project.
- By default the image assumes the repository is `localhost:5001`, the
name of the image is the `name` specified in the agent project's
manifest and the tag is `latest`.
3. `kagent deploy` deploys the agent to a kubernetes environement by
creating a .

Tested on the following provider and model combinations.
1. Gemini:  gemini-2.0-flash ✅
2. OpenAI: gpt-4 ✅

Following provider and model combinations are currently being tested
1. AzureOpenAI: gpt-4 (in progress)
2. Anthropic: claude-sonnet-4 (in progress)

### Follow Ups
1. Add support for `VertexAI` and `AnthropicVertexAI`. I'm currently
blocked on procuring working credentials which is why I have temporarily
removed some of my previous implementation and am opting to add support
for the above in a follow up PR.

---------

Signed-off-by: JM Huibonhoa <jm.huibonhoa@solo.io>
Signed-off-by: krisztianfekete <git@krisztianfekete.org>
@artberger artberger mentioned this pull request Oct 28, 2025
10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants