{"id":13471526,"url":"https://github.com/sozercan/kubectl-ai","last_synced_at":"2026-10-19T15:13:07.187Z","repository":{"id":143965915,"uuid":"615891862","full_name":"sozercan/kubectl-ai","owner":"sozercan","description":"✨ Kubectl plugin to create manifests with LLMs","archived":false,"fork":false,"pushed_at":"2025-01-27T22:00:14.000Z","size":249,"stargazers_count":1196,"open_issues_count":15,"forks_count":89,"subscribers_count":12,"default_branch":"main","last_synced_at":"2026-09-18T20:41:52.909Z","etag":null,"topics":["ai","chatgpt","gpt","gpt-4","hacktoberfest","k8s","kubectl","kubectl-plugins","kubernetes","llm","localllama","open-llm","openai","openai-api"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sozercan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-03-19T01:16:05.000Z","updated_at":"2026-09-18T14:15:49.000Z","dependencies_parsed_at":"2024-01-14T09:09:50.864Z","dependency_job_id":"1779ca53-4198-4549-872d-8a74af578d96","html_url":"https://github.com/sozercan/kubectl-ai","commit_stats":{"total_commits":92,"total_committers":10,"mean_commits":9.2,"dds":0.5543478260869565,"last_synced_commit":"e89cbdd3cda09fa6efff92453c67b6edc9ff3d4a"},"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/sozercan/kubectl-ai","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sozercan%2Fkubectl-ai","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sozercan%2Fkubectl-ai/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sozercan%2Fkubectl-ai/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sozercan%2Fkubectl-ai/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sozercan","download_url":"https://codeload.github.com/sozercan/kubectl-ai/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sozercan%2Fkubectl-ai/sbom","scorecard":{"id":839804,"data":{"date":"2025-08-19T07:30:29Z","repo":{"name":"github.com/sozercan/kubectl-ai","commit":"e89cbdd3cda09fa6efff92453c67b6edc9ff3d4a"},"scorecard":{"version":"v5.0.0","commit":"ea7e27ed41b76ab879c862fa0ca4cc9c61764ee4"},"score":5.4,"checks":[{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/ea7e27ed41b76ab879c862fa0ca4cc9c61764ee4/docs/checks.md#binary-artifacts"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/ea7e27ed41b76ab879c862fa0ca4cc9c61764ee4/docs/checks.md#branch-protection"}},{"name":"CI-Tests","score":4,"reason":"12 out of 29 merged PRs checked by a CI test -- score normalized to 4","details":null,"documentation":{"short":"Determines if the project runs tests before pull requests are merged.","url":"https://github.com/ossf/scorecard/blob/ea7e27ed41b76ab879c862fa0ca4cc9c61764ee4/docs/checks.md#ci-tests"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/ea7e27ed41b76ab879c862fa0ca4cc9c61764ee4/docs/checks.md#cii-best-practices"}},{"name":"Code-Review","score":0,"reason":"Found 0/4 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/ea7e27ed41b76ab879c862fa0ca4cc9c61764ee4/docs/checks.md#code-review"}},{"name":"Contributors","score":10,"reason":"project has 10 contributing companies or organizations","details":["Info: deis contributor org/company found, microsoft contributor org/company found, open-policy-agent contributor org/company found, MicrosoftDocs contributor org/company found, deislabs contributor org/company found, Azure contributor org/company found, CatalystCode contributor org/company found, MicrosoftCopilot contributor org/company found, project-copacetic contributor org/company found, eraser-dev contributor org/company found, "],"documentation":{"short":"Determines if the project has a set of contributors from multiple organizations (e.g., companies).","url":"https://github.com/ossf/scorecard/blob/ea7e27ed41b76ab879c862fa0ca4cc9c61764ee4/docs/checks.md#contributors"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/ea7e27ed41b76ab879c862fa0ca4cc9c61764ee4/docs/checks.md#dangerous-workflow"}},{"name":"Dependency-Update-Tool","score":10,"reason":"update tool detected","details":["Info: detected update tool: Dependabot: .github/dependabot.yaml:1"],"documentation":{"short":"Determines if the project uses a dependency update tool.","url":"https://github.com/ossf/scorecard/blob/ea7e27ed41b76ab879c862fa0ca4cc9c61764ee4/docs/checks.md#dependency-update-tool"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/ea7e27ed41b76ab879c862fa0ca4cc9c61764ee4/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/ea7e27ed41b76ab879c862fa0ca4cc9c61764ee4/docs/checks.md#license"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/ea7e27ed41b76ab879c862fa0ca4cc9c61764ee4/docs/checks.md#maintained"}},{"name":"Packaging","score":10,"reason":"packaging workflow detected","details":["Info: Project packages its releases by way of GitHub Actions.: .github/workflows/release.yaml:13"],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/ea7e27ed41b76ab879c862fa0ca4cc9c61764ee4/docs/checks.md#packaging"}},{"name":"Pinned-Dependencies","score":10,"reason":"all dependencies are pinned","details":["Info:  17 out of  17 GitHub-owned GitHubAction dependencies pinned","Info:   9 out of   9 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/ea7e27ed41b76ab879c862fa0ca4cc9c61764ee4/docs/checks.md#pinned-dependencies"}},{"name":"SAST","score":8,"reason":"SAST tool detected but not run on all commits","details":["Info: SAST configuration detected: CodeQL","Warn: 12 commits out of 29 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/ea7e27ed41b76ab879c862fa0ca4cc9c61764ee4/docs/checks.md#sast"}},{"name":"Security-Policy","score":10,"reason":"security policy file detected","details":["Info: security policy file detected: SECURITY.md:1","Info: Found linked content: SECURITY.md:1","Info: Found disclosure, vulnerability, and/or timelines in security policy: SECURITY.md:1","Info: Found text in security policy: SECURITY.md:1"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/ea7e27ed41b76ab879c862fa0ca4cc9c61764ee4/docs/checks.md#security-policy"}},{"name":"Signed-Releases","score":0,"reason":"Project has not signed or included provenance with any releases.","details":["Warn: release artifact v0.0.13 not signed: https://api.github.com/repos/sozercan/kubectl-ai/releases/168625204","Warn: release artifact v0.0.12 not signed: https://api.github.com/repos/sozercan/kubectl-ai/releases/145666302","Warn: release artifact v0.0.11 not signed: https://api.github.com/repos/sozercan/kubectl-ai/releases/114604451","Warn: release artifact v0.0.10 not signed: https://api.github.com/repos/sozercan/kubectl-ai/releases/101763390","Warn: release artifact v0.0.9 not signed: https://api.github.com/repos/sozercan/kubectl-ai/releases/99647421","Warn: release artifact v0.0.13 does not have provenance: https://api.github.com/repos/sozercan/kubectl-ai/releases/168625204","Warn: release artifact v0.0.12 does not have provenance: https://api.github.com/repos/sozercan/kubectl-ai/releases/145666302","Warn: release artifact v0.0.11 does not have provenance: https://api.github.com/repos/sozercan/kubectl-ai/releases/114604451","Warn: release artifact v0.0.10 does not have provenance: https://api.github.com/repos/sozercan/kubectl-ai/releases/101763390","Warn: release artifact v0.0.9 does not have provenance: https://api.github.com/repos/sozercan/kubectl-ai/releases/99647421"],"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/ea7e27ed41b76ab879c862fa0ca4cc9c61764ee4/docs/checks.md#signed-releases"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Info: jobLevel 'actions' permission set to 'read': .github/workflows/codeql.yml:31","Info: jobLevel 'contents' permission set to 'read': .github/workflows/codeql.yml:32","Info: jobLevel 'contents' permission set to 'read': .github/workflows/scorecards.yml:29","Info: jobLevel 'actions' permission set to 'read': .github/workflows/scorecards.yml:30","Info: topLevel 'contents' permission set to 'read': .github/workflows/codeql.yml:24","Info: topLevel 'contents' permission set to 'read': .github/workflows/dependency-review.yml:13","Info: topLevel permissions set to 'read-all': .github/workflows/lint.yaml:15","Warn: topLevel 'contents' permission set to 'write': .github/workflows/release.yaml:9","Info: topLevel permissions set to 'read-all': .github/workflows/scorecards.yml:18","Info: topLevel permissions set to 'read-all': .github/workflows/test.yaml:6","Info: topLevel permissions set to 'read-all': .github/workflows/unit-test.yaml:15","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/ea7e27ed41b76ab879c862fa0ca4cc9c61764ee4/docs/checks.md#token-permissions"}},{"name":"Vulnerabilities","score":4,"reason":"6 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-v778-237x-gjrc / GO-2024-3321","Warn: Project is vulnerable to: GHSA-hcg3-q754-cr77 / GO-2025-3487","Warn: Project is vulnerable to: GO-2024-3333","Warn: Project is vulnerable to: GHSA-qxp5-gwg8-xv66 / GO-2025-3503","Warn: Project is vulnerable to: GHSA-vvgc-356p-c3xw / GO-2025-3595","Warn: Project is vulnerable to: GHSA-6v2p-p543-phr9 / GO-2025-3488"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/ea7e27ed41b76ab879c862fa0ca4cc9c61764ee4/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-23T20:10:52.339Z","repository_id":143965915,"created_at":"2025-08-23T20:10:52.339Z","updated_at":"2025-08-23T20:10:52.339Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":344872684,"owners_count":38358695,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-10-03T21:59:58.778Z","status":"online","status_checked_at":"2026-10-19T02:00:06.414Z","response_time":53,"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","chatgpt","gpt","gpt-4","hacktoberfest","k8s","kubectl","kubectl-plugins","kubernetes","llm","localllama","open-llm","openai","openai-api"],"created_at":"2024-07-31T16:00:46.230Z","updated_at":"2026-10-19T15:13:06.874Z","avatar_url":"https://github.com/sozercan.png","language":"Go","funding_links":[],"categories":["精选开源项目合集","Go","Extend ChatGPT Feature","Uncategorized","Browser-extensions","kubernetes","Addons, extensions, plug-ins for integrating LLM into third-party applications","twitter","ai"],"sub_categories":["GPT插件","Other","Uncategorized","Other user interfaces"],"readme":"# Kubectl OpenAI plugin ✨\n\nThis project is a `kubectl` plugin to generate and apply Kubernetes manifests using OpenAI GPT.\n\nMy main motivation is to avoid finding and collecting random manifests when dev/testing things.\n\n## Demo\n\n[![asciicast](https://asciinema.org/a/MEXrlAqUjo7DMnfoyQearpVQ7.svg)](https://asciinema.org/a/MEXrlAqUjo7DMnfoyQearpVQ7)\n\n## Installation\n\n### Homebrew\n\nAdd to `brew` tap and install with:\n\n```shell\nbrew tap sozercan/kubectl-ai https://github.com/sozercan/kubectl-ai\nbrew install kubectl-ai\n```\n\n### Krew\n\nAdd to `krew` index and install with:\n\n```shell\nkubectl krew index add kubectl-ai https://github.com/sozercan/kubectl-ai\nkubectl krew install kubectl-ai/kubectl-ai\n```\n\n### GitHub release\n- Download the binary from [GitHub releases](https://github.com/sozercan/kubectl-ai/releases).\n\n- If you want to use this as a [`kubectl` plugin](https://kubernetes.io/docs/tasks/extend-kubectl/kubectl-plugins/), then copy `kubectl-ai` binary to your `PATH`. If not, you can also use the binary standalone.\n\n## Usage\n\n### Prerequisites\n\n`kubectl-ai` requires a valid Kubernetes configuration and one of the following:\n\n- [OpenAI API key](https://platform.openai.com/overview)\n- [Azure OpenAI Service](https://aka.ms/azure-openai) API key and endpoint\n- [OpenAI API-compatible endpoint](#set-up-a-local-openai-api-compatible-endpoint) (such as [AIKit](https://github.com/sozercan/aikit) or [LocalAI](https://localai.io/))\n\nFor OpenAI, Azure OpenAI or OpenAI API compatible endpoint, you can use the following environment variables:\n\n```shell\nexport OPENAI_API_KEY=\u003cyour OpenAI key\u003e\nexport OPENAI_DEPLOYMENT_NAME=\u003cyour OpenAI deployment/model name. defaults to \"gpt-3.5-turbo-0301\"\u003e\nexport OPENAI_ENDPOINT=\u003cyour OpenAI endpoint, like \"https://my-aoi-endpoint.openai.azure.com\" or \"http://localhost:8080/v1\"\u003e\n```\n\nIf `OPENAI_ENDPOINT` variable is set, then it will use the endpoint. Otherwise, it will use OpenAI API.\n\nAzure OpenAI service does not allow certain characters, such as `.`, in the deployment name. Consequently, `kubectl-ai` will automatically replace `gpt-3.5-turbo` to `gpt-35-turbo` for Azure. However, if you use an Azure OpenAI deployment name completely different from the model name, you can set `AZURE_OPENAI_MAP` environment variable to map the model name to the Azure OpenAI deployment name. For example:\n\n```shell\nexport AZURE_OPENAI_MAP=\"gpt-3.5-turbo=my-deployment\"\n```\n\n### Set up a local OpenAI API-compatible endpoint\n\nIf you don't have OpenAI API access, you can set up a local OpenAI API-compatible endpoint using [AIKit](https://github.com/sozercan/aikit) on your local machine without any GPUs! For more information, see the [AIKit documentaton](https://sozercan.github.io/aikit/).\n\n```shell\ndocker run -d --rm -p 8080:8080 ghcr.io/sozercan/llama3.1:8b\nexport OPENAI_ENDPOINT=\"http://localhost:8080/v1\"\nexport OPENAI_DEPLOYMENT_NAME=\"llama-3.1-8b-instruct\"\nexport OPENAI_API_KEY=\"n/a\"\n```\n\nAfter setting up the environment like above, you can use `kubectl-ai` as usual.\n\n### Flags and environment variables\n\n- `--require-confirmation` flag or `REQUIRE_CONFIRMATION` environment variable can be set to prompt the user for confirmation before applying the manifest. Defaults to true.\n\n- `--temperature` flag or `TEMPERATURE` environment variable can be set between 0 and 1. Higher temperature will result in more creative completions. Lower temperature will result in more deterministic completions. Defaults to 0.\n\n- `--use-k8s-api` flag or `USE_K8S_API` environment variable can be set to use Kubernetes OpenAPI Spec to generate the manifest. This will result in very accurate completions including CRDs (if present in configured cluster). This setting will use more OpenAI API calls and it requires [function calling](https://openai.com/blog/function-calling-and-other-api-updates) which is available in `0613` or later models only. Defaults to false. However, this is recommended for accuracy and completeness.\n\n- `--k8s-openapi-url` flag or `K8S_OPENAPI_URL` environment variable can be set to use a custom Kubernetes OpenAPI Spec URL. This is only used if `--use-k8s-api` is set. By default, `kubectl-ai` will use the configured Kubernetes API Server to get the spec unless this setting is configured. You can use the [default Kubernetes OpenAPI Spec](https://raw.githubusercontent.com/kubernetes/kubernetes/master/api/openapi-spec/swagger.json) or generate a custom spec for completions that includes custom resource definitions (CRDs). You can generate custom OpenAPI Spec by using `kubectl get --raw /openapi/v2 \u003e swagger.json`.\n\n### Pipe Input and Output\n\nKubectl AI can be used with pipe input and output. For example:\n\n```shell\n$ cat foo-deployment.yaml | kubectl ai \"change replicas to 5\" --raw | kubectl apply -f -\n```\n\n#### Save to file\n\n```shell\n$ cat foo-deployment.yaml | kubectl ai \"change replicas to 5\" --raw \u003e my-deployment-updated.yaml\n```\n\n#### Use with external editors\n\nIf you want to use an external editor to edit the generated manifest, you can set the `--raw` flag and pipe to the editor of your choice. For example:\n\n```shell\n# Visual Studio Code\n$ kubectl ai \"create a foo namespace\" --raw | code -\n\n# Vim\n$ kubectl ai \"create a foo namespace\" --raw | vim -\n```\n\n## Examples\n\n### Creating objects with specific values\n\n```shell\n$ kubectl ai \"create an nginx deployment with 3 replicas\"\n✨ Attempting to apply the following manifest:\napiVersion: apps/v1\nkind: Deployment\nmetadata:\n  name: nginx-deployment\n  labels:\n    app: nginx\nspec:\n  replicas: 3\n  selector:\n    matchLabels:\n      app: nginx\n  template:\n    metadata:\n      labels:\n        app: nginx\n    spec:\n      containers:\n      - name: nginx\n        image: nginx:1.7.9\n        ports:\n        - containerPort: 80\nUse the arrow keys to navigate: ↓ ↑ → ←\n? Would you like to apply this? [Reprompt/Apply/Don't Apply]:\n+   Reprompt\n  ▸ Apply\n    Don't Apply\n```\n\n### Reprompt to refine your prompt\n\n```shell\n...\nReprompt: update to 5 replicas and port 8080\n✨ Attempting to apply the following manifest:\napiVersion: apps/v1\nkind: Deployment\nmetadata:\n  name: nginx-deployment\n  labels:\n    app: nginx\nspec:\n  replicas: 5\n  selector:\n    matchLabels:\n      app: nginx\n  template:\n    metadata:\n      labels:\n        app: nginx\n    spec:\n      containers:\n      - name: nginx\n        image: nginx:1.7.9\n        ports:\n        - containerPort: 8080\nUse the arrow keys to navigate: ↓ ↑ → ←\n? Would you like to apply this? [Reprompt/Apply/Don't Apply]:\n+   Reprompt\n  ▸ Apply\n    Don't Apply\n```\n\n### Multiple objects\n\n```shell\n$ kubectl ai \"create a foo namespace then create nginx pod in that namespace\"\n✨ Attempting to apply the following manifest:\napiVersion: v1\nkind: Namespace\nmetadata:\n  name: foo\n---\napiVersion: v1\nkind: Pod\nmetadata:\n  name: nginx\n  namespace: foo\nspec:\n  containers:\n  - name: nginx\n    image: nginx:latest\nUse the arrow keys to navigate: ↓ ↑ → ←\n? Would you like to apply this? [Reprompt/Apply/Don't Apply]:\n+   Reprompt\n  ▸ Apply\n    Don't Apply\n```\n\n### Optional `--require-confirmation` flag\n\n```shell\n$ kubectl ai \"create a service with type LoadBalancer with selector as 'app:nginx'\" --require-confirmation=false\n✨ Attempting to apply the following manifest:\napiVersion: v1\nkind: Service\nmetadata:\n  name: nginx-service\nspec:\n  selector:\n    app: nginx\n  ports:\n  - port: 80\n    targetPort: 80\n  type: LoadBalancer\n```\n\n\u003e Please note that the plugin does not know the current state of the cluster (yet?), so it will always generate the full manifest.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsozercan%2Fkubectl-ai","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsozercan%2Fkubectl-ai","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsozercan%2Fkubectl-ai/lists"}