kubenu is a structured, modular Kubernetes CLI written in Nushell — built for SREs and DevOps engineers who want better data pipelines, safer scripting, and more expressive Kubernetes automation.
🎯 Why kubenu? No more
awk,jq, or fragile Bash.kubenulets you query, filter, transform, and automate Kubernetes tasks using structured data and clean, readable pipelines.
- Cluster Info: Get detailed cluster version and node information
- Health Checks: Monitor node health and readiness status
- Resource Overview: View cluster resources and utilization
- Pod Listing: View pods with status, restarts, and age
- Crash Detection: Identify and troubleshoot crashlooping pods
- Log Management: Stream and filter pod logs
- Image Tracking: List and manage container images
- Status Monitoring: Check deployment rollout status
- Scaling: Scale deployments up/down with ease
- Restart Management: Trigger deployment restarts
- Evicted Pods: Automatically clean up evicted pods
- Job Management: Remove completed jobs based on age
- Resource Optimization: Maintain cluster health
- Structured Data: Pure Nushell pipelines for reliable data processing
- JSON/YAML Handling: Native support for structured data formats
- Extensible Design: Easy to add new commands and features
- Error Handling: Robust error management and user feedback
- Nushell (install via
brew install nushellor see docs) kubectlinstalled and configured- Access to a Kubernetes cluster
# Clone the repository
git clone https://github.com/NoNickeD/nushell-demo.git
cd nushell-demo
# Make the script executable
chmod +x kubenu.nu
# Create a symlink for easy access
sudo ln -s $(pwd)/kubenu.nu /usr/local/bin/kubenu# View cluster information
kubenu cluster info
# Check cluster health
kubenu cluster health# List all pods with detailed status
kubenu pods list
# Find crashlooping pods
kubenu pods crashes
# View pod logs (auto-detects namespace)
kubenu pods logs my-pod
# List container images
kubenu pods images my-deploy# Check deployment status
kubenu deploy status my-deployment
# Scale a deployment
kubenu deploy scale my-deployment 3
# Restart a deployment
kubenu deploy restart my-deployment# Clean up evicted pods
kubenu cleanup evicted
# Remove old completed jobs
kubenu cleanup jobs --older-than 7kubenu/
├── README.md
├── kubenu.nu # Main entrypoint script
├── lib/
│ └── util.nu # Common helper functions
├── commands/
│ ├── cluster.nu # Cluster management
│ ├── pods.nu # Pod operations
│ ├── deploy.nu # Deployment control
│ └── cleanup.nu # Resource cleanup
# Create a local Kubernetes cluster
task full-deploy-local
# Verify
task verify-deployment- Create a new file in the
commands/directory - Implement your command using Nushell
- Add the command to the main script
- Update the README with documentation
To delete the local Kubernetes cluster:
task delete-local-cluster💡 Pro Tip: Need to do something that would take 10 lines of Bash? Try
kubenuinstead! 😎