/kubedb:kubedbfrom kubedb
Queries, inspects, dumps, restores, and port-forwards databases in Kubernetes (Postgres, MariaDB/MySQL, MongoDB, Redis/Valkey, Meilisearch). Replaces kubectl exec one-liners.
Ships in kubedb. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
kubedb is the default way to work with databases in Kubernetes. It discovers the pod,
dialect, and credentials itself. One-liners that read and decode secrets are usually
denied by permission checks, so don't read database secrets yourself. Try kubedb first,
and fall back to kubectl only if kubedb can't do the task, saying why.
If a command would pair kubectl exec with a database client (psql, pg_dump, mysql,
mariadb, mongosh, redis-cli), or pipe a secret into one, use kubedb instead.
| Instead of | Use |
|---|---|
kubectl exec -n ns pg-0 -- psql -U app -c "SELECT..." | kubedb exec -n ns -c "SELECT..." |
kubectl exec ... -- pg_dump ... | gzip > dump.sql.gz | kubedb dump -n ns dump.sql.gz |
gunzip -c dump.sql.gz | kubectl exec -i ... -- psql ... | kubedb restore -n ns dump.sql.gz |
kubectl port-forward svc/postgres 5432:5432 | kubedb port-forward -n ns |
kubectl get secret ... | base64 -d | nothing, kubedb finds credentials |
If command -v kubedb finds nothing, install it with brew install clevyr/tap/kubedb
or ask the user before reaching for kubectl.
-n and --context so the transcript shows which cluster was touched.--replica targets a read replica for read-only work (see below).--pod picks a specific pod when discovery chooses the wrong one.--dialect forces the database type when a namespace has more than one.--log-level warn hides kubedb's own log lines when you need to parse output.kubedb status --context <ctx> -n <namespace>
Shows the detected pod and dialect, and whether kubedb can connect. You don't need it before every command. Use it when the target is ambiguous, or to diagnose a failed command.
kubedb exec --context <ctx> -n <namespace> -c "<query>"
-c. A bare kubedb exec opens an interactive shell and hangs.kubedb exec -n ns < script.sql runs a script.-d picks a database other than the discovered one.--opts passes raw client flags. For clean output use --opts=-tA with Postgres,
--opts="--skip-column-names --batch" with MariaDB, or --opts=--quiet with MongoDB.kubedb exec -n prod --log-level warn --opts=-tA -c "SELECT count(*) FROM users"
kubedb exec -n staging -c "SHOW TABLES"
kubedb exec -n prod -c 'db.orders.find({status:"failed"}).limit(5)'
kubedb exec -n cache -c "INFO memory"
--replicakubedb targets the primary by default. For read-only queries, dumps, or port-forwards
against Postgres, pass --replica to use a ready read replica instead:
kubedb exec --context <ctx> -n <namespace> --replica -c "SELECT ..."
kubedb dump --context <ctx> -n <namespace> --replica dump.sql.gz
postgresql / postgresql-ha.--replica safe on single-instance clusters.--replica for anything that modifies data.--replica.kubedb dump --context <ctx> -n <namespace> [path | s3://bucket/ | gs://bucket/ | b2://bucket/]
/, the file name is generated.-F is gzip by default. plain and Postgres-only custom are also available.-t dumps only listed tables, -T skips tables, and -D keeps schema but skips data.-q --progress=false keeps output short.kubedb restore --context <ctx> -n <namespace> <file.sql | file.sql.gz | file.dmp | s3://...>
Restore is destructive because --clean is on by default. Confirm the exact context and
namespace with the user first, and pass -f to skip the prompt only after they approve.
kubedb port-forward --context <ctx> -n <namespace> [local_port]
Use this when a local client or GUI needs a connection. The local port is deliberately not the native port, to avoid conflicts and accidental connections. It defaults to 30000 plus the native port, such as 35432 for Postgres, and is logged at startup. Read it from the log or pass one explicitly. Run it in the background and stop it when done.
By default kubedb runs the client in a short-lived Job with a NetworkPolicy, not inside the
database pod. This keeps a stuck or disconnected command from lingering in the database
container, where a zombie pg_dump has blocked app migrations before. Keep the Job with
--replica too, because it can fall back to the primary. Only pass --create-job=false when
the cluster forbids Jobs and the user agrees.
Config lives at ~/.config/kubedb/config.yaml, and any flag can be set with a KUBEDB_
environment variable. Full reference: https://github.com/clevyr/kubedb/blob/main/docs/kubedb.md
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
kubedb@clevyr is listed by clevyr/claude-plugins — review the source before installing
npx claudepluginhub clevyr/claude-plugins --plugin kubedbOther plugins' skills for the same job