Kubectl Command Builder
Compose correct, safely quoted kubectl commands with scoped flag chips. Nothing connects to a cluster.
Builder only — commands are never executed and no cluster is contacted.
Command inputs
Command preview
16 charskubectl get pods
Alias: kgp · Flags use canonical boolean-then-value order.
Recipes
Examples
Previous container logs
logs · web-7d9f · -c app · --previous · --tail=200 · -n prodkubectl logs web-7d9f --previous -c app --tail=200 -n prodThe classic CrashLoopBackOff command, built without memorising flag combinations.
Interactive shell
exec · api-0 · -it · /bin/shkubectl exec api-0 -i -t -- /bin/shThe remote command always follows -- and each token is safely quoted.
Invalid port pair
port-forward · pod/api · httpError: "http" is not a local:remote port pair (use :80 for a random local port).Constraints are enforced before a command can be copied.
About this tool
Kubectl Command Builder turns the kubectl flags you half-remember into a form. Choose from sixteen command families — get, describe, logs, exec, port-forward, cp, rollout, scale, apply, delete, top, auth can-i, config, explain, edit and patch — and the flag chips change to the ones that family actually accepts.
The composer assembles a canonical line: verb, positional arguments, boolean flags, valued flags, then namespace and context. Values containing spaces or shell metacharacters are single-quoted with embedded quotes escaped, so a pod name or patch body pasted from a ticket cannot turn into a shell injection when you paste the command into a terminal.
It is a builder, not a client: no kubeconfig is read, no API call is made and nothing is executed. Recipes generate three-command debug sequences, and the history lets you restore a composed command. Your names, namespaces and context stay in the tab.
What this tool does not do
- The schema covers the listed families and their common flags; new kubectl versions may add flags not yet in the chips.
- Custom extra flags are appended verbatim after validation of plain --flag or --flag=value shape.
- POSIX single-quoting is used; PowerShell needs different escaping and receives a note for Windows paths.
- History and recipes live in memory for the current visit only; nothing is persisted to disk.
- No command is ever executed; copy the preview and run it in a terminal you control.
How to use this tool
Choose a family
Pick a verb from the Inspect, Operate, Debug or Config rail. The flag chips are scoped to that verb — --previous only appears for logs.
Fill the inputs
Enter resource and name, namespace and context. rollout and patch expect type/name targets; cp expects source and destination paths.
Toggle flags
Use checkboxes for booleans and inline inputs for valued flags such as --tail, -c and -o. The preview updates on every change.
Handle the constraints
Conflicts are resolved with a note (-A drops -n); missing requirements become errors with a plain-language fix.
Copy or save
Copy the command, copy a whole recipe, or save it to history for later. Nothing runs automatically.
Use cases
Incident triage
Load the debug-crashloop recipe to get describe and previous-container logs with one click.
On-call handoff
Copy a correctly namespaced, quoted command into a ticket instead of a vague description.
Learning kubectl
See which flags belong to which verb and what happens when incompatible flags are combined.
Multi-cluster work
Keep context and namespace in the preview so a pasted command targets the right cluster.
Command shape
| Part | Rule |
|---|---|
| verb | kubectl plus the family verb; auth and rollout include their subcommand |
| arguments | Resource/name, pod name, port pairs or paths, quoted when unsafe |
| boolean flags | --follow, --previous, -A, -i -t and friends, in declaration order |
| valued flags | -c app, --tail=200, -l 'app=web', -o wide, then -n and --context |
| exec terminator | Remote command follows -- and is quoted token by token |
Values are single-quoted when they contain whitespace or shell metacharacters; an embedded quote becomes '\''.
Common mistakes
Mistake:Using -A and -n together.
Fix:kubectl rejects the combination; the builder keeps -A and shows a note that -n was dropped.
Mistake:Forgetting the -- before an exec command.
Fix:The builder inserts -- and quotes the remote command tokens for you.
Mistake:Assuming a rollout target is just a name.
Fix:Use deployment/name; the builder flags targets with zero or more than one slash.
Mistake:Pasting a patch body with quotes or shell metacharacters.
Fix:Valued arguments are single-quoted, with internal quotes escaped, before they reach the preview.
Mistake:Expecting the tool to run the command.
Fix:It only builds text. Nothing is executed and no cluster is contacted.
Frequently asked questions
How do I see the previous container's logs?
Choose the logs family, enter the pod name, tick --previous and optionally set -c and --tail. The builder emits kubectl logs <pod> --previous -c <container> --tail=200 -n <namespace>. The previous container is the one that ran before the current one in the same pod — useful for CrashLoopBackOff.
What's the difference between exec -it and attach?
attach connects to the main process of an existing container; exec starts a new process inside it. Tick the -it chip to allocate a TTY and keep stdin open, then type the remote command after --, for example /bin/sh. The builder never attaches; it only composes the exec line.
How do I target all namespaces?
Tick --all-namespaces (or use -A). Since kubectl treats -A and -n as mutually exclusive, the builder drops any namespace you entered and shows a note in the warnings strip instead of producing an invalid command.
How are names with special characters quoted?
Any value containing whitespace or a shell metacharacter is wrapped in single quotes, and embedded single quotes become '\''. A pod name with a space or a JSON patch body therefore stays one argv element when you paste the command into a POSIX shell. Non-ASCII characters are preserved byte-for-byte.
Can it run commands for me?
No. The builder never reads your kubeconfig, opens a socket or executes anything. It only assembles text in your tab, which you can copy and run in a terminal you control. Recipes and history are conveniences for composing and restoring text.
Why does port-forward validate my port pairs?
kubectl accepts local:remote pairs, an empty local port such as :80 for a randomly assigned one, and several pairs separated by spaces. Anything else is reported before you copy. Ports outside 1–65535 are rejected as well.
References & standards
Related tools
.env Secret Safety Linter
Validate .env syntax and spot likely leaked credentials or placeholder secrets.
.gitattributes Generator
Build .gitattributes rules for line endings, Git LFS, GitHub linguist marks and merge drivers — with a one-line explanation for every rule.
.htaccess Generator
Build an Apache .htaccess — HTTPS redirects, rewrites, error pages, security headers, and basic auth
2D Fluid Dynamics & Particle Physics Sandbox
A physics playground with two engines sharing one canvas. The fluid mode runs a real Eulerian Navier-Stokes solver — semi-Lagrangian advection, explicit diffusion, Jacobi pressure projection and vorticity confinement — that you paint with dye and velocity using mouse or touch. The particle mode is a damped Verlet N-body engine with gravity wells, Coulomb attractors and repulsors, spring links, wall restitution and elastic circle collisions. Particle counts adapt to the device (100k target on WebGL2 desktop, 2k-5k on CPU fallback), and every configuration exports as runnable code: a Matter.js world, a PixiJS ticker setup, or a standalone vanilla Canvas engine.
A/B Test Sample Size Calculator
Compute required sample size per variant and test duration from baseline conversion rate, minimum detectable effect, alpha and power.
ABA Routing Number Validator
Validate 9-digit US ABA routing numbers with 3-7-1 Mod-10 breakdown.