kubectl-ai
Terminal assistant that turns natural-language requests into kubectl and bash operations using Gemini, OpenAI, Bedrock, Ollama and other LLM providers.
kubectl-ai is a command-line assistant for Kubernetes that takes natural-language requests, such as "check logs for nginx app in hello namespace", and uses an LLM to suggest and run the matching Kubernetes operations. Its built-in tools are kubectl and bash. You can add custom tools through a tools.yaml file, which it reads from ~/.config/kubectl-ai/tools.yaml by default, or from a path given with --custom-tools-config.
It runs in an interactive chat mode that keeps context across questions, or in a non-interactive mode with --quiet and a task argument. It also reads stdin, so you can run cat error.log | kubectl-ai "explain the error", where the positional argument becomes a prefix to the piped content. Sessions can be saved and resumed with --new-session, --list-sessions, --resume-session and --delete-session. Settings can be given as command-line flags, in ~/.config/kubectl-ai/config.yaml, or as environment variables, and flags take precedence over the config file.
It supports several model providers: gemini (the default), vertexai, azopenai, openai, grok and bedrock. It also supports local models through ollama and llama.cpp, and OpenAI-compatible endpoints such as Alibaba's Qwen. For models that need special prompting for tool calling, there is an --enable-tool-use-shim flag. The README also documents an MCP server mode, an MCP client mode, a web UI option (uiType: web), and a Docker image that can be used against a GKE cluster. The tool is aimed at developers, platform engineers and SREs who work with Kubernetes clusters from the terminal.
Installation
# via Quick install script (Linux & macOS)
curl -sSL https://raw.githubusercontent.com/GoogleCloudPlatform/kubectl-ai/main/install.sh | bash
# via Krew
kubectl krew install ai
# via Nix
nix-shell -p kubectl-ai

Alternatives & related tools
Claude Squad
Terminal UI that runs multiple AI coding agents (Claude Code, Codex, Gemini, Aider) in parallel, each in its own tmux session and git worktree.
mods
CLI tool that adds AI capabilities to command line pipelines by processing stdin through LLMs
Crush
Terminal-based agentic coding assistant from Charm that connects to many LLM providers, uses LSPs for context, and extends via MCP servers.
DeepSeek-Reasonix
Open-source coding agent shipped as a single Go binary with a TUI, desktop app, and ACP editor integration; DeepSeek preset, any OpenAI-compatible model.
Ollama
CLI tool for running and managing local large language models with REST API and client library support
add a badge to your README
Maintain kubectl-ai? Show that it's featured on trmn. The badge links back to this page.
[](https://www.trmn.sh/tools/kubectl-ai?utm_source=badge)<a href="https://www.trmn.sh/tools/kubectl-ai?utm_source=badge"><img src="https://www.trmn.sh/badge/kubectl-ai.svg" alt="Featured on trmn" height="20"></a>