/kopylot

An AI-Powered assistant for Kubernetes developers

Primary LanguageShellMIT LicenseMIT

KoPylot: Your AI-Powered Kubernetes Assistant 🤖

Release Build status codecov Commit activity License

Kopylot is an open-source AI-powered Kubernetes assistant. Its goal is to help developers and DevOps engineers to easily manage and monitor their Kubernetes clusters.

You can read more about the project in the blog post.

💫 Features:

  • 🔍 Audit: Audit a resource, such as pods, deployments, or services using an LLM model. Audit

  • 🩺 Diagnose: Diagnose resources, such as pods, deployments, or services using an LLM model. Diagnose

  • 💬 Chat: Start a chat with kopylot to generate kubectl commands based on your prompts. Chat

  • ☸️ Ctl: A wrapper around kubectl. The arguments passed to the ctl subcommand are interpreted by kubectl. Ctl

🚀 Quick Start:

  1. Requests an API key from OpenAI.
  2. Export the key using the following command:
export KOPYLOT_AUTH_TOKEN=your_api_key
  1. Install Kopylot using pip:
pip install kopylot
  1. Run Kopylot:
kopylot --help

📖 Usage:

Usage: kopylot [OPTIONS] COMMAND [ARGS]...                                           
                                                                                      
╭─ Options ──────────────────────────────────────────────────────────────────────────╮
│ --version                                                                          │
│ --install-completion        [bash|zsh|fish|powershell  Install completion for the  │
│                             |pwsh]                     specified shell.            │
│                                                        [default: None]             │
│ --show-completion           [bash|zsh|fish|powershell  Show completion for the     │
│                             |pwsh]                     specified shell, to copy it │
│                                                        or customize the            │
│                                                        installation.               │
│                                                        [default: None]             │
│ --help                                                 Show this message and exit. │
╰────────────────────────────────────────────────────────────────────────────────────╯
╭─ Commands ─────────────────────────────────────────────────────────────────────────╮
│ audit     Audit a pod, deployment, or service using an LLM model.                  │
│ chat      Start a chat with kopylot to generate kubectl commands based your        │
│           inputs.                                                                  │
│ ctl       A wrapper around kubectl. The arguments passed to the ctl subcommand are │
│           interpreted by kubectl.                                                  │
│ diagnose  Diagnose a resource e.g. pod, deployment, or service using an LLM model. │
╰────────────────────────────────────────────────────────────────────────────────────╯

🤝 Contributions:

Kopylot is an open-source project and we welcome contributions from the community. There are a couple of ways to set up your development environment and start contributing to the project.

🐳 Using a Dev Container

KoPylot supports development using a dev container, which helps you set up a consistent and isolated environment for development. This makes it easy to get started without having to worry about conflicting dependencies or configurations on your local machine.

To get started with a dev container:

  1. Install Docker and Visual Studio Code.
  2. Install the Remote - Containers extension in Visual Studio Code.
  3. Clone the KoPylot repository and open the project folder in Visual Studio Code.
  4. Press F1, type Remote-Containers: Reopen in Container, and hit Enter. Visual Studio Code will build the dev container and reopen the project inside it.

You're now ready to start contributing to KoPylot using the dev container!

🛠️ Local Setup

If you prefer to set up your development environment locally, make sure you have Poetry installed on your system. Then, follow these steps:

  1. Clone the KoPylot repository:

    git clone https://github.com/avsthiago/kopylot
  2. Navigate to the project folder:

    cd kopylot
  3. Install the project dependencies using Poetry:

    make install

You're now ready to start contributing to KoPylot using your local setup! 😄

Before submitting a pull request, please make sure to test your changes and follow the project's coding guidelines. We appreciate your contributions and look forward to collaborating with you! 🎉

📄 License:

Kopylot is licensed under the MIT License. See LICENSE for more information.

☎️ Contact:

If you have any questions or suggestions, feel free to contact me on https://thiagoalves.ai.

Thank you for using Kopylot! 🙌

🗺️ Roadmap:

  • Wrap the kubectl command using ctl subcommand.
  • Create the audit subcommand to audit kubernetes resources.
  • Create the diagnose subcommand to diagnose kubernetes resources.
  • Create the chat subcommand to generate kubectl commands using from the user prompts.
  • Make it possible to use other LLM models, not just from OpenAI.
  • Integrate LangChain into Kopylot to make it as autonomous as possible.

~ Similar Projects:

One of the similar projects that I found is the Kopilot from knight42. It is also a Kubernetes assistant which uses LLMs behind the scenes. The main difference from KoPylot is that it is written in Go. At the moment, it doesn't have the Chat command implemented, but it can respond in different languages.