Documentation
kagent invoke#
Invoke a kagent agent to perform a task.
kagent invoke [flags]
Flags:
--agent, -a- Agent to invoke--file, -f- File to read the task from--session, -s- Session--stream, -S- Stream the response--task, -t- Task to perform--url-override, -u- URL override
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
Example#
Invoke an agent with a task:
kagent invoke --agent "k8s-agent" --task "Get all the pods in the kagent namespace"
Invoke with streaming output:
kagent invoke --agent "k8s-agent" --task "Get all the pods" --stream
Invoke from a task file:
kagent invoke --agent "k8s-agent" --file task.txt
Kagent Lab: Discover kagent and kmcp
Free, on‑demand lab: build custom AI agents with kagent and integrate tools via kmcp on Kubernetes.