This directory contains the Go components of the Kagent project, including the controller and CLI tools.
-
cli/: Command-line interface for Kagent
cmd/: Entry points for CLI commandsinternal/: Internal CLI implementation
-
controller/: Kubernetes controller for Kagent
api/: API definitions for custom resourcescmd/: Controller entry pointinternal/: Internal controller implementationhack/: Helper scripts and toolstranslator/: Translator implementation.
-
internal/: Internal code for the controller and CLI.
httpserver/: HTTP server for the controller.a2a/: A2A implementation.adk/: Go types for the declarative ADK framework.database/: Database implementation.version/: Version information for the controller.utils/: Utility functions for the controller.
-
pkg/: Shared code for the controller and CLI.
-
bin/: Output directory for compiled binaries
-
test/: Test files and e2e tests. Unit tests are co-located with the code they test.
- Go 1.23 or later
- Docker (for container builds)
- Make
To build the CLI for multiple platforms:
# Build for all supported platforms
make build
# The binaries will be available in the bin/ directory:
# - bin/kagent-linux-amd64
# - bin/kagent-linux-arm64
# - bin/kagent-darwin-amd64
# - bin/kagent-darwin-arm64
# - bin/kagent-windows-amd64.exeThe CLI is a REPL (Read-Eval-Print Loop), so you can run it directly without building:
go run cli/cmd/kagent/main.goTo build the controller as a Docker image:
# Build the Docker image
make docker-build
# Push the Docker image to a registry
make docker-pushYou can customize the image name and tag by setting the following variables:
# Example with custom values
make docker-build docker-push \
DOCKER_REGISTRY=my-registry.io \
DOCKER_REPO=my-org/kagent \
IMAGE_NAME=controller \
VERSION=v1.0.0After building, you can run the CLI directly from the bin directory:
# Linux/macOS
./bin/kagent-linux-amd64 [command]
# or
./bin/kagent-darwin-arm64 [command]
# Windows
./bin/kagent-windows-amd64.exe [command]To run the controller locally:
make runTo deploy the controller to a Kubernetes cluster:
# Install CRDs
make install
# Deploy the controller
make deployTo undeploy:
# Undeploy the controller
make undeploy
# Uninstall CRDs
make uninstall# Generate manifests (CRDs, RBAC, etc.)
make manifests
# Generate DeepCopy methods
make generate# Run unit tests
make test
# Run end-to-end tests (requires a running Kind cluster)
make test-e2e# Run linters
make lint
# Fix linting issues automatically where possible
make lint-fixTo generate a consolidated YAML file for installation:
make build-installer
# The installer will be available at dist/install.yaml