Skip to content

For the complete documentation index, see llms.txt. Markdown versions of all docs pages are available by appending .md to any docs URL.

kagent invoke

Page as Markdown

kagent invoke command

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