{"id":28047199,"url":"https://github.com/isaccanedo/kubectl-ai","last_synced_at":"2026-05-18T04:09:18.038Z","repository":{"id":291868134,"uuid":"979046533","full_name":"isaccanedo/kubectl-ai","owner":"isaccanedo","description":":cloud: AI powered Kubernetes Assistant","archived":false,"fork":false,"pushed_at":"2025-05-06T23:26:38.000Z","size":3275,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-10T05:06:15.787Z","etag":null,"topics":["ai","aipowered","assistent","cli","ia","kubernetes"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/isaccanedo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"contributing.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-05-06T23:12:23.000Z","updated_at":"2025-05-06T23:26:41.000Z","dependencies_parsed_at":"2025-05-07T00:36:33.488Z","dependency_job_id":null,"html_url":"https://github.com/isaccanedo/kubectl-ai","commit_stats":null,"previous_names":["isaccanedo/kubectl-ai"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/isaccanedo/kubectl-ai","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isaccanedo%2Fkubectl-ai","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isaccanedo%2Fkubectl-ai/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isaccanedo%2Fkubectl-ai/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isaccanedo%2Fkubectl-ai/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/isaccanedo","download_url":"https://codeload.github.com/isaccanedo/kubectl-ai/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isaccanedo%2Fkubectl-ai/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33164672,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-17T22:39:12.733Z","status":"online","status_checked_at":"2026-05-18T02:00:06.436Z","response_time":71,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","aipowered","assistent","cli","ia","kubernetes"],"created_at":"2025-05-11T20:45:59.867Z","updated_at":"2026-05-18T04:09:18.014Z","avatar_url":"https://github.com/isaccanedo.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# kubectl-ai\n\nkubectl-ai is an AI powered kubernetes agent that runs in your terminal.\n\n![kubectl-ai demo GIF using: kubectl-ai \"how's nginx app doing in my cluster\"](kubectl-ai.gif)\n\n## Quick Start\n\nFirst, ensure that kubectl is installed and configured.\n\n### Installation\n\n1. Download the latest release from the [releases page](https://github.com/GoogleCloudPlatform/kubectl-ai/releases/latest) for your target machine.\n\n2. Untar the release, make the binary executable and move it to a directory in your $PATH (as shown below).\n\n```shell\n$ tar -zxvf kubectl-ai_Darwin_arm64.tar.gz\n$ chmod a+x kubectl-ai\n$ sudo mv kubectl-ai /usr/local/bin/\n```\n\n### Usage\n\n#### Using Gemini (Default)\n\nSet your Gemini API key as an environment variable. If you don't have a key, get one from [Google AI Studio](https://aistudio.google.com).\n\n```bash\nexport GEMINI_API_KEY=your_api_key_here\nkubectl-ai\n\n# Use different gemini model\nkubectl-ai --model gemini-2.5-pro-exp-03-25\n\n# Use 2.5 flash (faster) model\nkubectl-ai --quiet --model gemini-2.5-flash-preview-04-17 \"check logs for nginx app in hello namespace\"\n```\n\n#### Using AI models running locally (ollama or llamacpp)\n\nYou can use `kubectl-ai` with AI models running locally. `kubectl-ai` supports [ollama](https://ollama.com/) and [llama.cpp](https://github.com/ggml-org/llama.cpp) to use the AI models running locally.\n\nAn example of using Google's `gemma3` model with `ollama`:\n\n```shell\n# assuming ollama is already running and you have pulled one of the gemma models\n# ollama pull gemma3:12b-it-qat\n\n# enable-tool-use-shim because models require special prompting to enable tool calling\nkubectl-ai --llm-provider ollama --model gemma3:12b-it-qat --enable-tool-use-shim\n\n# you can use `models` command to discover the locally available models\n\u003e\u003e models\n```\n\n#### Using Azure OpenAI\n\nYou can also use Azure OpenAI deployment by setting your OpenAI API key and specifying the provider:\n\n```bash\nexport AZURE_OPENAI_API_KEY=your_azure_openai_api_key_here\nexport AZURE_OPENAI_ENDPOINT=https://your_azure_openai_endpoint_here\nkubectl-ai --llm-provider=azopenai --model=your_azure_openai_deployment_name_here\n# or\naz login\nkubectl-ai --llm-provider=openai://your_azure_openai_endpoint_here --model=your_azure_openai_deployment_name_here\n```\n\n#### Using OpenAI\n\nYou can also use OpenAI models by setting your OpenAI API key and specifying the provider:\n\n```bash\nexport OPENAI_API_KEY=your_openai_api_key_here\nkubectl-ai --llm-provider=openai --model=gpt-4.1\n```\n\n* Note: `kubectl-ai` supports AI models from `gemini`, `vertexai`, `azopenai`, `openai` and local LLM providers such as `ollama` and `llamacpp`.\n\nRun interactively:\n\n```shell\nkubectl-ai\n```\n\nThe interactive mode allows you to have a chat with `kubectl-ai`, asking multiple questions in sequence while maintaining context from previous interactions. Simply type your queries and press Enter to receive responses. To exit the interactive shell, type `exit` or press Ctrl+C.\n\nOr, run with a task as input:\n\n```shell\nkubectl-ai -quiet \"fetch logs for nginx app in hello namespace\"\n```\n\nCombine it with other unix commands:\n\n```shell\nkubectl-ai \u003c query.txt\n# OR\necho \"list pods in the default namespace\" | kubectl-ai\n```\n\nYou can even combine a positional argument with stdin input. The positional argument will be used as a prefix to the stdin content:\n\n```shell\ncat error.log | kubectl-ai \"explain the error\"\n```\n\n## Extras\n\nYou can use the following special keywords for specific actions:\n\n* `model`: Display the currently selected model.\n* `models`: List all available models.\n* `version`: Display the `kubectl-ai` version.\n* `reset`: Clear the conversational context.\n* `clear`: Clear the terminal screen.\n* `exit` or `quit`: Terminate the interactive shell (Ctrl+C also works).\n\n### Invoking as kubectl plugin\n\nUse it via the `kubectl` plug interface like this: `kubectl ai`.  kubectl will find `kubectl-ai` as long as it's in your PATH.  For more information about plugins please see: https://kubernetes.io/docs/tasks/extend-kubectl/kubectl-plugins/\n\n\n### Examples\n\n```bash\n# Get information about pods in the default namespace\nkubectl-ai -quiet \"show me all pods in the default namespace\"\n\n# Create a new deployment\nkubectl-ai -quiet \"create a deployment named nginx with 3 replicas using the nginx:latest image\"\n\n# Troubleshoot issues\nkubectl-ai -quiet \"double the capacity for the nginx app\"\n\n# Using Azure OpenAI instead of Gemini\nkubectl-ai --llm-provider=azopenai --model=your_azure_openai_deployment_name_here -quiet \"scale the nginx deployment to 5 replicas\"\n\n# Using OpenAI instead of Gemini\nkubectl-ai --llm-provider=openai --model=gpt-4.1 -quiet \"scale the nginx deployment to 5 replicas\"\n```\n\nThe `kubectl-ai` will process your query, execute the appropriate kubectl commands, and provide you with the results and explanations.\n\n## k8s-bench\n\nkubectl-ai project includes [k8s-bench](./k8s-bench/README.md) - a benchmark to evaluate performance of different LLM models on kubernetes related tasks. Here is a summary from our last run:\n\n| Model | Success | Fail |\n|-------|---------|------|\n| gemini-2.5-flash-preview-04-17 | 10 | 0 |\n| gemini-2.5-pro-preview-03-25 | 10 | 0 |\n| gemma-3-27b-it | 8 | 2 |\n| **Total** | 28 | 2 |\n\nSee [full report](./k8s-bench.md) for more details.\n\n---\n\n*Note: This is not an officially supported Google product. This project is not\neligible for the [Google Open Source Software Vulnerability Rewards\nProgram](https://bughunters.google.com/open-source-security).*\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fisaccanedo%2Fkubectl-ai","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fisaccanedo%2Fkubectl-ai","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fisaccanedo%2Fkubectl-ai/lists"}