Kubectl Operations
The kb CLI wraps kubectl’s most common operations behind fzf-powered resource pickers. You can run them from the TUI operations panel or invoke them directly from the shell. Either way, omitting the resource name drops you into an interactive picker.
Describe
Section titled “Describe”Show the full kubectl describe output for a pod, deployment, or any resource.
From the TUI: open the operations panel and select Describe › Pod or Describe › Deployment. The CLI prompts you to pick from the current cluster’s resources.
From the shell:
# Interactive — fzf picker selects the resource kind and namekb k describe
# Directkb k describe pod my-pod -n stagingkb k describe deployment my-app -n productionPass -i to force the fzf picker even when a name is provided:
kb k describe -iThe namespace flag (-n) defaults to default.
YAML View
Section titled “YAML View”Fetch a resource’s manifest in YAML, equivalent to kubectl get <kind> <name> -o yaml.
From the TUI: select YAML › Pod or YAML › Service. The output renders in the operations output panel.
No direct CLI subcommand exists for YAML view; it is a TUI-only operation. The underlying call is kubectl get pod <name> -n <namespace> -o yaml for pods and kubectl get svc <name> -n <namespace> -o yaml for services.
Open a deployment’s manifest in $EDITOR, equivalent to kubectl edit deployment <name>.
From the TUI: select Edit › Deployment. The TUI suspends while your editor runs and resumes when you save and close.
Direct CLI editing is handled by the same editResource function under the hood. The TUI command is the primary interface for this workflow.
Open a shell inside a running pod.
From the TUI: select Exec › Shell. The TUI suspends and hands over your terminal; it resumes when the shell exits.
From the shell:
# Interactive pickerkb exec
# Named podkb exec my-pod -n my-namespace
# Specific container and commandkb exec my-pod -n my-namespace -c sidecar --command /bin/bash
# Force picker even when pod name is providedkb exec -iThe default command is /bin/sh. Use --command to override it. Use -c to target a specific container in a multi-container pod.
Stream or print logs from a pod.
From the TUI: select Logs › Pod. The TUI fetches the last 100 lines and displays them in the output panel (no follow mode in TUI).
From the shell:
# Interactive picker, last 100 lineskb logs
# Named pod, follow outputkb logs my-pod -n my-namespace --follow
# Specific container, custom tail depthkb logs my-pod -c app --tail=200
# Force pickerkb logs -iFlags:
-f/--follow— stream new lines as they arrive--tail=N— show only the last N lines (default100)-c/--container— target a named container-n/--namespace— namespace (defaultdefault)
Port-Forward
Section titled “Port-Forward”Forward a local port to a pod or service.
# Interactive picker for resource, then prompted for port mappingkb pf
# Named podkb pf pod/my-pod 8080:80
# Named service, specific namespacekb pf svc/my-svc 9090:9090 -n staging
# Force picker even with resource givenkb pf -iThe resource argument accepts pod/name or svc/name notation. Bare names are treated as pods. If you omit the port mapping, kb pf prompts you for one (e.g. 8080:80).
The command prints Forwarding <ports> -> <target> in <namespace> (Ctrl+C to stop) and blocks until you interrupt it.
Common Patterns
Section titled “Common Patterns”All commands share a consistent resolution strategy: if you supply enough arguments and do not pass -i, the command runs directly. Otherwise it opens fzf. This makes both scripted and ad-hoc usage work without separate commands.
The -n / --namespace flag is available on every command and always defaults to default. Pass it explicitly when working across namespaces:
kb logs my-pod -n kube-system --followkb exec my-pod -n staging -c appkb pf svc/my-svc 5432:5432 -n databases