From kube-dc
Manages kube-dc CLI for authenticating to Kube-DC clusters via OAuth, switching contexts/projects, listing/switching namespaces, and kubectl credential integration.
How this skill is triggered — by the user, by Claude, or both
Slash command
/kube-dc:use-kube-dc-cliThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
The `kube-dc` CLI provides browser-based OAuth authentication and context management for Kube-DC clusters. It integrates as a kubectl exec credential plugin.
The kube-dc CLI provides browser-based OAuth authentication and context management for Kube-DC clusters. It integrates as a kubectl exec credential plugin.
# Linux (amd64)
sudo curl -sL https://github.com/kube-dc/kube-dc-public/releases/latest/download/kube-dc_linux_amd64 -o /usr/local/bin/kube-dc && sudo chmod +x /usr/local/bin/kube-dc
# Linux (arm64)
sudo curl -sL https://github.com/kube-dc/kube-dc-public/releases/latest/download/kube-dc_linux_arm64 -o /usr/local/bin/kube-dc && sudo chmod +x /usr/local/bin/kube-dc
# macOS (Apple Silicon)
sudo curl -sL https://github.com/kube-dc/kube-dc-public/releases/latest/download/kube-dc_darwin_arm64 -o /usr/local/bin/kube-dc && sudo chmod +x /usr/local/bin/kube-dc
# macOS (Intel)
sudo curl -sL https://github.com/kube-dc/kube-dc-public/releases/latest/download/kube-dc_darwin_amd64 -o /usr/local/bin/kube-dc && sudo chmod +x /usr/local/bin/kube-dc
kube-dc login --domain kube-dc.cloud --org {org-name}
kube-dc login --domain stage.kube-dc.com --org {org-name}
kube-dc login --domain internal.example.com --org {org-name} --ca-cert /path/to/ca.crt
Opens browser for Keycloak OAuth login. Tokens cached for ~30 days with auto-refresh.
kube-dc use {org}/{project} # Switch to specific project
kube-dc use # Interactive selection
Context names follow pattern: kube-dc/{domain}/{org}/{project}
kube-dc ns # List available namespaces (from JWT claims)
kube-dc ns {namespace} # Switch to specific namespace
kube-dc config show # Current context, server, cached credentials
kube-dc config get-contexts # List all kube-dc contexts
kube-dc logout # Remove credentials for current server
kube-dc logout --all # Remove all cached credentials
Before creating resources, always check the current context:
# Quick check
kubectl config current-context
# Detailed info (server, namespace, token status)
kube-dc config show
# Available namespaces for current user
kube-dc ns
The namespace tells you the project: namespace {org}-{project} → org={org}, project={project}.
After kube-dc login, the CLI configures kubectl with an exec credential plugin:
users:
- name: kube-dc@{org}
user:
exec:
apiVersion: client.authentication.k8s.io/v1
command: kube-dc
args: ["credential", "--server", "https://kube-api.{domain}:6443"]
Every kubectl command automatically:
kubectx # Lists all contexts including kube-dc ones
kubectx kube-dc/shalb/demo # Switch to Kube-DC context
| Path | Purpose |
|---|---|
~/.kube/config | Kubeconfig (Kube-DC entries merged, never overwrites others) |
~/.kube-dc/config.yaml | CLI configuration |
~/.kube-dc/credentials/ | Cached OAuth tokens (0600 permissions) |
After CLI operations:
# 1. Check credentials are cached
kube-dc config show
# Expected: shows server, user, org, valid access/refresh tokens
# 2. Verify kubectl works
kubectl get ns
# Expected: lists namespaces you have access to
# 1. Verify active context
kubectl config current-context
# Expected: kube-dc/{domain}/{org}/{project}
# 2. Verify namespace
kubectl config view --minify -o jsonpath='{.contexts[0].context.namespace}'
# Expected: {org}-{project}
# 1. Verify namespace changed
kube-dc ns
# Expected: asterisk (*) next to the active namespace
Success: Config shows valid tokens, kubectl commands return data. Failure:
kube-dc login --domain {domain} --org {org}kube-dc login rather than trying to extract tokens manuallynpx claudepluginhub kube-dc/kube-dc-public --plugin kube-dcRetrieves OAuth tokens from the correct OpenShift cluster context when multiple clusters are configured. Useful for authenticating API calls to specific OpenShift clusters like app.ci or dpcr.
Executes kubectl commands to query, deploy, debug, and monitor Kubernetes clusters. Use when working with pods, deployments, services, nodes, or container diagnostics.
Assists with Kubernetes kubectl operations: debugging (logs, describe, exec, port-forward), managing resources (deployments, services, configmaps, secrets), and cluster tasks (scaling, rollouts, nodes). Use for pods, services, or troubleshooting.