Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 38 additions & 3 deletions .github/workflows/update-ref-docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ jobs:
KAGENT_API_PAGE: docs-site/content/kagent/resources/api-ref.md
KMCP_API_PAGE: docs-site/content/kmcp/reference/api-ref.md
HELM_PAGE: docs-site/content/kagent/resources/helm.md
KAGENT_CLI_DIR: docs-site/content/kagent/resources/cli
KMCP_CLI_DIR: docs-site/content/kmcp/reference/cli

steps:
- name: Checkout kagent repository
Expand Down Expand Up @@ -374,16 +376,49 @@ jobs:
echo "Final generated file contents (first 50 lines):"
head -50 "$HELM_PAGE"

- name: Build kagent CLI binary
run: |
# kagent is a single-module monorepo rooted at go/, not the repo root.
cd "$GITHUB_WORKSPACE/kagent/go"
go build -o /tmp/kagent-cli ./core/cli/cmd/kagent
/tmp/kagent-cli --help > /dev/null
echo "kagent CLI binary built and smoke-tested successfully"

- name: Build kmcp CLI binary
run: |
cd "$GITHUB_WORKSPACE/kmcp"
go build -o /tmp/kmcp-cli ./cmd/kmcp
/tmp/kmcp-cli --help > /dev/null
echo "kmcp CLI binary built and smoke-tested successfully"

- name: Generate kagent CLI reference docs
run: |
cd "$GITHUB_WORKSPACE/website"
mkdir -p "$KAGENT_CLI_DIR"
python3 scripts/generate-cli-docs.py \
--binary /tmp/kagent-cli \
--display-name kagent \
--out-dir "$KAGENT_CLI_DIR"

- name: Generate kmcp CLI reference docs
run: |
cd "$GITHUB_WORKSPACE/website"
mkdir -p "$KMCP_CLI_DIR"
python3 scripts/generate-cli-docs.py \
--binary /tmp/kmcp-cli \
--display-name kmcp \
--out-dir "$KMCP_CLI_DIR"

- name: Create Pull Request
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.GITHUB_TOKEN }}
path: website
commit-message: "docs: Update kagent and kmcp API reference docs"
commit-message: "docs: Update kagent and kmcp API, Helm, and CLI reference docs"
signoff: true
title: "Update kagent and kmcp API reference docs"
title: "Update kagent and kmcp API, Helm, and CLI reference docs"
body: |
Automated API and kagent Helm chart documentation update based on the latest commits:
Automated API, kagent Helm chart, and CLI reference documentation update based on the latest commits:
- **kagent**: [`${{ env.KAGENT_COMMIT }}`](https://github.com/${{ github.repository_owner }}/kagent/commit/${{ env.KAGENT_COMMIT }})
- **kmcp**: [`${{ env.KMCP_COMMIT }}`](https://github.com/${{ github.repository_owner }}/kmcp/commit/${{ env.KMCP_COMMIT }})

Expand Down
15 changes: 15 additions & 0 deletions docs-site/content/kagent/resources/cli/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,18 @@ weight: 1

Review the kagent CLI commands and learn how to use them effectively.

- [`kagent add-mcp`](kagent-add-mcp/) - Add an MCP server entry to kagent.yaml
- [`kagent bug-report`](kagent-bug-report/) - Generate a bug report
- [`kagent build`](kagent-build/) - Build a Docker images for an agent project
- [`kagent completion`](kagent-completion/) - Generate the autocompletion script for the specified shell
- [`kagent dashboard`](kagent-dashboard/) - Open the kagent dashboard
- [`kagent db`](kagent-db/) - Database operations (migrations, inspection)
- [`kagent deploy`](kagent-deploy/) - Deploy an agent to Kubernetes
- [`kagent get`](kagent-get/) - Get a kagent resource
- [`kagent init`](kagent-init/) - Initialize a new agent project
- [`kagent install`](kagent-install/) - Install kagent
- [`kagent invoke`](kagent-invoke/) - Invoke a kagent agent
- [`kagent mcp`](kagent-mcp/) - MCP (Model Context Protocol) server management
- [`kagent run`](kagent-run/) - Run agent project locally with docker-compose and launch chat interface
- [`kagent uninstall`](kagent-uninstall/) - Uninstall kagent
- [`kagent version`](kagent-version/) - Print the kagent version
65 changes: 21 additions & 44 deletions docs-site/content/kagent/resources/cli/kagent-add-mcp.md
Original file line number Diff line number Diff line change
@@ -1,57 +1,34 @@
---
title: kagent add-mcp
description: kagent add-mcp command
description: Add an MCP server entry to kagent.yaml. Use flags for non-interactive setup or run without flags to open the wizard.
weight: 10
---

Add an MCP server entry to `kagent.yaml`.
Add an MCP server entry to kagent.yaml. Use flags for non-interactive setup or run without flags to open the wizard.

```bash
kagent add-mcp [name] [args...] [flags]
```

**Arguments:**
- `name` - Name of the MCP server
- `args` - Command arguments (optional)

**Flags:**
- `--arg` - Command argument (repeatable)
- `--build` - Construct image specification (e.g., `docker build`)
- `--command` - Command to run MCP server (e.g., `npx`, `uvx`, `kmcp`)
- `--env` - Environment variable in KEY=VALUE format (repeatable)
- `--header` - HTTP header for remote MCP in KEY=VALUE format (repeatable, supports `${VAR}` for env vars)
- `--image` - Container image (optional; mutually exclusive with `--build`)
- `--project-dir` - Project directory (default: current directory)
- `--remote` - Remote MCP server URL (`http://` or `https://`)
- `--arg strings` - Command argument (repeatable)
- `--build string` - Container build (optional; mutually exclusive with --image)
- `--command string` - Command to run MCP server (e.g., npx, uvx, kmcp, or a binary)
- `--env strings` - Environment variable in KEY=VALUE format (repeatable)
- `--header strings` - HTTP header for remote MCP in KEY=VALUE format (repeatable, supports ${VAR} for env vars)
- `-h, --help` - help for add-mcp
- `--image string` - Container image (optional; mutually exclusive with --build)
- `--project-dir string` - Project directory (default: current directory)
- `--remote string` - Remote MCP server URL (http/https)

**Global Flags:**
- `--kagent-url` - kagent URL (default: "http://localhost:8083")
- `--namespace, -n` - Namespace (default: "kagent")
- `--output-format, -o` - Output format (default: "table")
- `--timeout` - Timeout duration (default: 300s)
- `--verbose, -v` - Verbose output

## About `kagent add-mcp`

Adds an MCP server entry to your `kagent.yaml` file. Use flags for non-interactive setup or run without flags to open the wizard.

## Example

Add a remote MCP server:

```bash
kagent add-mcp my-mcp-server --remote https://mcp.example.com
```

Add an MCP server with a command:

```bash
kagent add-mcp my-mcp-server --command npx --arg @modelcontextprotocol/server-filesystem
```

Add an MCP server with custom environment variables:

```bash
kagent add-mcp my-mcp-server --command my-server --env API_KEY=secret --env LOG_LEVEL=debug
```

- `--config string` - config file (default is $HOME/.kagent/config.yaml) (default "$HOME/.kagent/config.yaml")
- `--kagent-grpc-ca-file string` - CA certificate file for KAgent gRPC
- `--kagent-grpc-server-name string` - TLS server name for KAgent gRPC
- `--kagent-grpc-tls` - Use TLS for KAgent gRPC
- `--kagent-grpc-url string` - KAgent gRPC target (default "localhost:8084")
- `--kagent-url string` - KAgent REST URL (default "http://localhost:8083")
- `-n, --namespace string` - Namespace (default "kagent")
- `-o, --output-format string` - Output format (default "table")
- `--timeout duration` - Timeout (default 5m0s)
- `-v, --verbose` - Verbose output
42 changes: 16 additions & 26 deletions docs-site/content/kagent/resources/cli/kagent-bug-report.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,26 @@
---
title: kagent bug-report
description: kagent bug-report command
weight: 10
description: Generate a bug report
weight: 20
---

Generate a bug report for troubleshooting.
Generate a bug report

```bash
kagent bug-report [flags]
```

**Global Flags:**
- `--kagent-url` - kagent URL (default: "http://localhost:8083")
- `--namespace, -n` - Namespace (default: "kagent")
- `--output-format, -o` - Output format (default: "table")
- `--timeout` - Timeout duration (default: 300s)
- `--verbose, -v` - Verbose output

## About `kagent bug-report`

This command generates a comprehensive bug report that includes:
- kagent CLI version
- kagent server version
- Kubernetes cluster information
- Resource status and logs
- Configuration details

## Example

Generate a bug report:

```bash
kagent bug-report
```
**Flags:**
- `-h, --help` - help for bug-report

**Global Flags:**
- `--config string` - config file (default is $HOME/.kagent/config.yaml) (default "$HOME/.kagent/config.yaml")
- `--kagent-grpc-ca-file string` - CA certificate file for KAgent gRPC
- `--kagent-grpc-server-name string` - TLS server name for KAgent gRPC
- `--kagent-grpc-tls` - Use TLS for KAgent gRPC
- `--kagent-grpc-url string` - KAgent gRPC target (default "localhost:8084")
- `--kagent-url string` - KAgent REST URL (default "http://localhost:8083")
- `-n, --namespace string` - Namespace (default "kagent")
- `-o, --output-format string` - Output format (default "table")
- `--timeout duration` - Timeout (default 5m0s)
- `-v, --verbose` - Verbose output
65 changes: 24 additions & 41 deletions docs-site/content/kagent/resources/cli/kagent-build.md
Original file line number Diff line number Diff line change
@@ -1,60 +1,43 @@
---
title: kagent build
description: kagent build command
weight: 10
description: Build Docker images for an agent project created with the init command.
weight: 30
---

Build a Docker image for an agent project.
Build Docker images for an agent project created with the init command.

This command will look for a kagent.yaml file in the specified project directory and build Docker images using docker build. The images can optionally be pushed to a registry.

Image naming:
- If --image is provided, it will be used as the full image specification (e.g., ghcr.io/myorg/my-agent:v1.0.0)
- Otherwise, defaults to localhost:5001/{agentName}:latest where agentName is loaded from kagent.yaml

```bash
kagent build [project-directory] [flags]
```

**Arguments:**
- `project-directory` - The directory containing the agent project with `kagent.yaml`

**Flags:**
- `--image` - Full image specification (e.g., ghcr.io/myorg/my-agent:v1.0.0)
- `--platform` - Target platform for Docker build (e.g., linux/amd64, linux/arm64)
- `-h, --help` - help for build
- `--image string` - Full image specification (e.g., ghcr.io/myorg/my-agent:v1.0.0)
- `--platform string` - Target platform for Docker build (e.g., linux/amd64, linux/arm64)
- `--push` - Push the image to the registry

**Global Flags:**
- `--kagent-url` - kagent URL (default: "http://localhost:8083")
- `--namespace, -n` - Namespace (default: "kagent")
- `--output-format, -o` - Output format (default: "table")
- `--timeout` - Timeout duration (default: 300s)
- `--verbose, -v` - Verbose output

## About `kagent build`

The `kagent build` command builds Docker images for an agent project created with the `init` command. It looks for a `kagent.yaml` file in the specified project directory and builds Docker images using `docker build`.

**Image naming:**
- If `--image` is provided, it is used as the full image specification (e.g., `ghcr.io/myorg/my-agent:v1.0.0`)
- Otherwise, defaults to `localhost:5001/{agentName}:latest` where `agentName` is loaded from `kagent.yaml`
- `--config string` - config file (default is $HOME/.kagent/config.yaml) (default "$HOME/.kagent/config.yaml")
- `--kagent-grpc-ca-file string` - CA certificate file for KAgent gRPC
- `--kagent-grpc-server-name string` - TLS server name for KAgent gRPC
- `--kagent-grpc-tls` - Use TLS for KAgent gRPC
- `--kagent-grpc-url string` - KAgent gRPC target (default "localhost:8084")
- `--kagent-url string` - KAgent REST URL (default "http://localhost:8083")
- `-n, --namespace string` - Namespace (default "kagent")
- `-o, --output-format string` - Output format (default "table")
- `--timeout duration` - Timeout (default 5m0s)
- `-v, --verbose` - Verbose output

## Example

Build a Docker image:

```bash
kagent build ./my-agent
```

Build and tag a Docker image:

```bash
kagent build ./my-agent --image ghcr.io/myorg/my-agent:v1.0.0
```

Build and push an image to a registry:

```bash
kagent build ./my-agent --image ghcr.io/myorg/my-agent:v1.0.0 --push
```

Build for a specific platform:

```bash
kagent build ./my-agent --platform linux/amd64 --image ghcr.io/myorg/my-agent:v1.0.0
kagent build ./my-agent --image ghcr.io/myorg/my-agent:v1.0.0
kagent build ./my-agent --image ghcr.io/myorg/my-agent:v1.0.0 --push
```
46 changes: 46 additions & 0 deletions docs-site/content/kagent/resources/cli/kagent-completion-bash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
title: kagent completion bash
description: Generate the autocompletion script for the bash shell.
weight: 50
---

Generate the autocompletion script for the bash shell.

This script depends on the 'bash-completion' package.
If it is not installed already, you can install it via your OS's package manager.

To load completions in your current shell session:

source <(kagent completion bash)

To load completions for every new session, execute once:

#### Linux:

kagent completion bash > /etc/bash_completion.d/kagent

#### macOS:

kagent completion bash > $(brew --prefix)/etc/bash_completion.d/kagent

You will need to start a new shell for this setup to take effect.

```bash
kagent completion bash
```

**Flags:**
- `-h, --help` - help for bash
- `--no-descriptions` - disable completion descriptions

**Global Flags:**
- `--config string` - config file (default is $HOME/.kagent/config.yaml) (default "$HOME/.kagent/config.yaml")
- `--kagent-grpc-ca-file string` - CA certificate file for KAgent gRPC
- `--kagent-grpc-server-name string` - TLS server name for KAgent gRPC
- `--kagent-grpc-tls` - Use TLS for KAgent gRPC
- `--kagent-grpc-url string` - KAgent gRPC target (default "localhost:8084")
- `--kagent-url string` - KAgent REST URL (default "http://localhost:8083")
- `-n, --namespace string` - Namespace (default "kagent")
- `-o, --output-format string` - Output format (default "table")
- `--timeout duration` - Timeout (default 5m0s)
- `-v, --verbose` - Verbose output
37 changes: 37 additions & 0 deletions docs-site/content/kagent/resources/cli/kagent-completion-fish.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
title: kagent completion fish
description: Generate the autocompletion script for the fish shell.
weight: 60
---

Generate the autocompletion script for the fish shell.

To load completions in your current shell session:

kagent completion fish | source

To load completions for every new session, execute once:

kagent completion fish > ~/.config/fish/completions/kagent.fish

You will need to start a new shell for this setup to take effect.

```bash
kagent completion fish [flags]
```

**Flags:**
- `-h, --help` - help for fish
- `--no-descriptions` - disable completion descriptions

**Global Flags:**
- `--config string` - config file (default is $HOME/.kagent/config.yaml) (default "$HOME/.kagent/config.yaml")
- `--kagent-grpc-ca-file string` - CA certificate file for KAgent gRPC
- `--kagent-grpc-server-name string` - TLS server name for KAgent gRPC
- `--kagent-grpc-tls` - Use TLS for KAgent gRPC
- `--kagent-grpc-url string` - KAgent gRPC target (default "localhost:8084")
- `--kagent-url string` - KAgent REST URL (default "http://localhost:8083")
- `-n, --namespace string` - Namespace (default "kagent")
- `-o, --output-format string` - Output format (default "table")
- `--timeout duration` - Timeout (default 5m0s)
- `-v, --verbose` - Verbose output
Loading
Loading