Skip to content

Rupeshs11/knoxctl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

☸️ Knoxctl

A lightning-fast, lightweight CLI for Kubernetes operations.

Go Report Card License: MIT Platform


knoxctl is a high-performance Kubernetes CLI tool built in Go using the Cobra framework and client-go.

Designed as a streamlined, developer-friendly alternative to kubectl, it strips away the noise and focuses on the core operations you actually use every day: Get, Apply, and Delete. It seamlessly parses your local ~/.kube/config, directly handles raw YAML manifests via dynamic client rendering, and presents the data in a beautiful, formatted tabular view.


Knoxctl CLI Interface

✨ Why Knoxctl? (Features)

🚀 Blazing Fast: Compiled directly to single-binary machine code using Go.
💻 Cross-Platform: Ready-to-use binaries for Windows and Linux (WSL).
🎨 Beautiful Color UI: Easily distinguish resource health with green (Running), yellow (Pending), and red (Failed) statuses powered by fatih/color.
🛠️ Server-Side Apply (SSA): Uses native dynamic clients to robustly create, update, and patch complex YAML structures without needing hardcoded schemas.
🎯 "All" Commands: Bulk-target resources to save time! Supports get all, apply -f all, and delete all within any namespace.
🧹 Clean Visuals: Tabular output strictly focused on the critical metadata (Status, Age, Replicas, IPs).


📦 Installation

There are two ways to get knoxctl running on your system.

Note: Make sure you have kubectl or your cluster properly configured with a valid ~/.kube/config. knoxctl automatically reads your environment!

Option 1: Download Pre-built Binary (Recommended)

🐧 Linux / Ubuntu (WSL)

# Download the latest Linux binary
wget https://github.com/Rupeshs11/knoxctl/releases/download/v1.1.0/knoxctl-linux-amd64 -O knoxctl

# Make it executable
chmod +x knoxctl

# Move it to your local bin for global access
sudo mv knoxctl /usr/local/bin/knoxctl

# Verify
knoxctl --help

🪟 Windows (PowerShell)

# 1. Download knoxctl.exe from the GitHub Releases page
# 2. Move it to a directory that is in your PATH. For example:
Move-Item -Path ".\Downloads\knoxctl.exe" -Destination "C:\Windows\System32\knoxctl.exe"

# Verify
knoxctl --help
Option 2: Build from Source (For Developers)

If you have Go installed and want to compile it yourself:

# 1. Clone the repository
git clone https://github.com/Rupeshs11/knoxctl.git
cd knoxctl

# 2. Download Go modules
go mod tidy

# 3. Build the binary
go build -o knoxctl .       # For Linux/macOS
go build -o knoxctl.exe .   # For Windows

# 4. Move to your PATH

🚀 Commands & Usage

knoxctl [command] [flags]

🔍 1. Inspection & Read Operations (get, describe, logs, version)

Instantly fetch the status and details of your workloads.

Command Description
knoxctl get pods List pods in a namespace
knoxctl get deployments List deployments in a namespace
knoxctl get svc List services in a namespace
knoxctl get nodes List all active nodes in the cluster
knoxctl get ns List all namespaces
knoxctl get all List all pods, deployments, and services
knoxctl describe <res> <name> Deep dive into a specific resource's configuration and events
knoxctl logs <pod> Stream container logs (Supports -f, --tail)
knoxctl version Print CLI version & cluster server version

📸 In Action:

Checking the CLI version:

Version Command Output

Getting detailed pod, deployment, and service metadata across all namespaces:

Get All Namespaces

Fetching specific endpoints and services:

Services

🏗️ 2. Write Operations (apply)

Deploy resources directly from raw YAML files, effortlessly.

Command Description
knoxctl apply -f <file> Apply or create resources from a single YAML
knoxctl apply -f all Apply all YAML files in current directory

📸 In Action:

Deploying an entire directory of YAML configurations at once:

Apply All

Creating a specific deployment:

Apply Deployment

💥 3. Destroy Operations (delete)

Quickly terminate workloads or teardown entire namespaces.

Command Description
knoxctl delete <res> <name> Delete a specific resource
knoxctl delete -f <file> Delete resources defined in a YAML file
knoxctl delete all Delete all pods, deployments, and svc

📸 In Action:

Force cleaning an entire namespace (Deployments, Pods, Services):

Delete All Namespace

Tearing down a specific deployment:

Delete Deployment

🏁 Global Flags

Append these to any command to control your execution context:

Flag Description
-n, --namespace <name> Target a specific namespace (default: "default")
-A, --all-namespaces List or target resources across all namespaces
--kubeconfig <path> Provide a custom kubeconfig file path (default: ~/.kube/config)

About

A lightning-fast, lightweight CLI for Kubernetes operations built in Go.

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages