Skip to main content

A vibes-based alternative to kubectl

Project description

vibectl

A vibes-based alternative to kubectl for interacting with Kubernetes clusters. Make your cluster management more intuitive and fun!

Features

  • 🌟 Vibes-based interaction with Kubernetes clusters
  • 🧠 Memory-aware autonomous Kubernetes operations
  • 🚀 Intuitive commands that just feel right
  • 🎯 Simplified cluster management
  • 🔍 Smart context awareness
  • ✨ AI-powered summaries of cluster state
  • 🧠 Natural language resource queries
  • 🎨 Theme support with multiple visual styles
  • 📊 Intelligent output formatting for different resource types

Requirements

  • Python 3.10+
  • kubectl command-line tool installed and in your PATH
  • Anthropic API key (for Claude models)

Installation

Option 1: Standard Pip Installation (Non-NixOS users)

  1. Install using pip:

    pip install vibectl
    
  2. Install the LLM Anthropic provider:

    pip install llm-anthropic
    llm install llm-anthropic
    
  3. Configure your Anthropic API key:

    export ANTHROPIC_API_KEY=your-api-key
    

Option 2: Development Installation with Flake (NixOS users)

  1. Install Flake
  2. Clone and set up:
    git clone https://github.com/othercriteria/vibectl.git
    cd vibectl
    flake develop
    
  3. Configure your Anthropic API key:
    export ANTHROPIC_API_KEY=your-api-key
    

The development environment will automatically:

  • Create and activate a Python virtual environment
  • Install all dependencies including development tools
  • Set up the Anthropic LLM provider

Usage

Autonomous Mode with vibectl vibe

The vibectl vibe command is a powerful, memory-aware tool that can autonomously plan and execute Kubernetes operations:

# Use with a specific request
vibectl vibe "create a deployment for our frontend app"

# Use without arguments - autonomous mode based on memory context
vibectl vibe

# Continue working on a previous task
vibectl vibe "continue setting up the database system"

The vibe command works by:

  1. Understanding your cluster context from memory
  2. Planning appropriate actions
  3. Executing kubectl commands with your confirmation
  4. Updating memory with results
  5. Planning next steps

Example Flow with Memory

Memory: "We are working in `foo` namespace. We have created deployment `bar`.
We need to create a service for `bar`."

Command: vibectl vibe "keep working on the bar system"

Planning: Need to create a service for the bar deployment
Action: kubectl create service clusterip bar-service --tcp=80:8080
Confirmation: [Y/n]

Updated Memory: "We are working in the `foo` namespace. We have created
deployment `bar` with service `bar-service`. We don't know if it is alive yet."

No-Argument Mode

When run without arguments, vibectl vibe uses memory context to determine what to do next. If no memory exists, it begins with discovery commands:

Command: vibectl vibe

Planning: Need to understand the cluster context first
Action: kubectl cluster-info
Confirmation: [Y/n]

Updated Memory: "We are working with a Kubernetes cluster running version 1.25.4
with control plane at https://cluster.example.com. Next, we should understand
what namespaces and workloads are available."

Other Common Commands

# Display version and configuration
vibectl version
vibectl config show

# Basic operations with AI-powered summaries
vibectl get pods                                  # List pods with summary
vibectl describe deployment my-app                # Get detailed info
vibectl logs pod/my-pod                          # Get pod logs
vibectl scale deployment/nginx --replicas=3      # Scale a deployment

# Natural language commands
vibectl get vibe show me pods with high restarts
vibectl create vibe an nginx pod with 3 replicas
vibectl delete vibe remove all failed pods
vibectl describe vibe what's wrong with the database

# Direct kubectl access
vibectl just get pods                            # Pass directly to kubectl

Memory

vibectl maintains context between command invocations with its memory feature:

# View current memory
vibectl memory show

# Manually set memory content
vibectl memory set "Running backend deployment in staging namespace"

# Edit memory in your preferred editor
vibectl memory set --edit

# Clear memory content
vibectl memory clear

# Control memory updates
vibectl memory disable      # Stop updating memory
vibectl memory enable       # Resume memory updates

Memory helps vibectl understand context from previous commands, enabling references like "the namespace I mentioned earlier" without repeating information. This is especially powerful with the autonomous vibectl vibe command.

Configuration

# Set a custom kubeconfig file
vibectl config set kubeconfig /path/to/kubeconfig

# Use a different LLM model (default: claude-3.7-sonnet)
vibectl config set llm_model your-preferred-model

# Always show raw kubectl output
vibectl config set show_raw_output true

# Set visual theme
vibectl theme set dark

Custom Instructions

You can customize how vibectl generates responses by setting custom instructions that will be included in all vibe prompts:

# Set custom instructions
vibectl instructions set "Use a ton of emojis! 😁"

# View current instructions
vibectl instructions show

# Clear instructions
vibectl instructions clear

Typical use cases for custom instructions:

  • Style preferences: "Use a ton of emojis! 😁"
  • Security requirements: "Redact the last 3 octets of IPs."
  • Focus areas: "Focus on security issues."
  • Output customization: "Be extremely concise."

Output Formatting

Commands provide AI-powered summaries using rich text formatting:

  • Resource names and counts in bold
  • Healthy/good status in green
  • Warnings in yellow
  • Errors in red
  • Kubernetes concepts in blue
  • Timing information in italics

Example:

[bold]3 pods[/bold] in [blue]default namespace[/blue], all [green]Running[/green]
[bold]nginx-pod[/bold] [italic]running for 2 days[/italic]
[yellow]Warning: 2 pods have high restart counts[/yellow]

Project Structure

For a comprehensive overview of the project's structure and organization, please see STRUCTURE.md. This documentation is maintained according to our project structure rules to ensure it stays up-to-date and accurate.

Development

This project uses Flake for development environment management. The environment is automatically set up when you run flake develop.

Running Tests

pytest

Code Quality

The project uses pre-commit hooks for code quality, configured in .pre-commit-config.yaml. These run automatically on commit and include:

  • Ruff format for code formatting (replaces Black)
  • Ruff check for linting and error detection (replaces Flake8)
  • Ruff check --fix for import sorting (replaces isort)
  • MyPy for type checking

Configuration for Ruff is managed in the pyproject.toml file under the [tool.ruff] section.

Cursor Rules

The project uses Cursor rules (.mdc files in .cursor/rules/) to maintain consistent development practices. For details on these rules, including their purpose and implementation, see RULES.md.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vibectl-0.2.1.tar.gz (31.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

vibectl-0.2.1-py3-none-any.whl (36.0 kB view details)

Uploaded Python 3

File details

Details for the file vibectl-0.2.1.tar.gz.

File metadata

  • Download URL: vibectl-0.2.1.tar.gz
  • Upload date:
  • Size: 31.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.11.11

File hashes

Hashes for vibectl-0.2.1.tar.gz
Algorithm Hash digest
SHA256 e2bb7209d97881a82171730a7e54bba3ead15c71d1fd9875e3a6ad67198342ff
MD5 461ce4f7e2a4fd88fd85ef2c50314c28
BLAKE2b-256 ab3252fd2d5b11d5c2b01889a3aab20c6b8a459a5bca16bf780e41626e3e8c41

See more details on using hashes here.

File details

Details for the file vibectl-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: vibectl-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 36.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.11.11

File hashes

Hashes for vibectl-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 428c82efe7c173f2adf5798d352963f4554154f841bd71a1f9b3d2110944641f
MD5 7f6e87b8db83318df97007eac5a5e184
BLAKE2b-256 fbbd5d8298412635f78782f97daeb570f0a0f67facd9af9d523c5b67558b43fa

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page