@mdb-ist/kube
v1.0.1
Published
CLI to manage Kanopy/Kubernetes setup and operations (kubeconfig, Helm, ksec secrets, Drone CI).
Maintainers
Readme
kube
A cross-platform CLI to manage Kanopy / Kubernetes setup and day-to-day operations:
prerequisite installation, kubeconfig generation and login, ksec secrets, Drone CI secrets,
deployment inspection, and diagnostics.
Works on Windows, macOS and Linux.
Install
npm install -g kubeOr run without installing:
npx kubeUsage
kube # launch the interactive menu
kube --help # list every command and configuration flag
kube corp --help # SSO session helper (harvest cookies for protected hosts)
kube keys # GitHub key & auth manager (bash on macOS/Linux, PowerShell on Windows)Running kube with no arguments opens an interactive menu covering setup, cluster access,
secrets, deployment, Drone CI, and diagnostics.
Configuration
The tool ships no environment-specific defaults — values that point at a concrete cluster, registry, or domain must be supplied. Any command that needs a value it cannot find fails with a message naming the exact flag or variable to set, so nothing internal is baked into the package.
Every setting can be provided three ways, in precedence order:
- CLI flag — e.g.
--namespace my-ns - Environment variable — e.g.
KUBE_NAMESPACE=my-ns .envfile (optional, best-effort — never blocks the tool)
.env detection
When you run kube in any directory it will, in order:
- use
--env-file <path>if given; - otherwise load
./.envfrom the current working directory if present; - otherwise load
.envfrom the project root if present.
A missing .env never interrupts the tool.
Common flags
| Flag | Environment variable | Meaning |
| --- | --- | --- |
| --env-file <path> | — | Explicit environment file to load |
| --namespace <ns> | KUBE_NAMESPACE | Kubernetes namespace |
| --app-name <name> | KUBE_DEMO_NAME | App/release base name |
| --staging-api <url> | KUBE_STAGING_API | Staging cluster API server |
| --prod-api <url> | KUBE_PROD_API | Production cluster API server |
| --domain <suffix> | KUBE_DOMAIN_SUFFIX | Ingress domain suffix |
| --ecr-registry <host> | KUBE_ECR_REGISTRY | Container registry host |
| --drone-url <url> | KUBE_DRONE_URL | Drone CI server URL |
| --drone-repo <owner/repo> | KUBE_DRONE_REPO | Drone repository (falls back to the git remote) |
| --helm-repo-url <url> | KUBE_HELM_REPO_URL | Helm chart repository URL |
| --helm-repo-name <name> | KUBE_HELM_REPO_NAME | Helm repo alias (default charts) |
| --helm-chart-version <v> | KUBE_HELM_CHART_VERSION | Helm chart version (default 4.25.0) |
| --release-backend <name> | KUBE_RELEASE_BACKEND | Backend release name |
| --release-frontend <name> | KUBE_RELEASE_FRONTEND | Frontend release name |
| --release-merchant <name> | KUBE_RELEASE_MERCHANT | Merchant release name |
| --ksec-secret-staging <n> | KUBE_KSEC_SECRET_STAGING | Staging ksec secret name |
| --ksec-secret-prod <n> | KUBE_KSEC_SECRET_PROD | Production ksec secret name |
| --cicd-token-secret <n> | KUBE_CICD_TOKEN_SECRET | CI/CD token secret (default kanopy-cicd-token) |
| --ecr-secret-name <n> | KUBE_ECR_SECRET_NAME | ECR secret name (default ecr) |
| --kanopy-config-dir <dir> | KUBE_KANOPY_CONFIG_DIR | Kanopy config dir under $HOME (default .kanopy) |
| --kube-config-dir <dir> | KUBE_CONFIG_DIR | kubeconfig dir under $HOME (default .kube) |
Release, secret, and ingress-host names are derived from --app-name, --namespace, and
--domain unless you override them explicitly.
Run kube --help for the complete, always-up-to-date list.
Example .env
KUBE_NAMESPACE=my-namespace
KUBE_DEMO_NAME=my-app
KUBE_STAGING_API=https://api.staging.example.com
KUBE_PROD_API=https://api.prod.example.com
KUBE_DOMAIN_SUFFIX=example.com
KUBE_ECR_REGISTRY=123456789012.dkr.ecr.us-east-1.amazonaws.com
KUBE_DRONE_URL=https://drone.example.com
KUBE_HELM_REPO_URL=https://charts.example.comRequirements
Node.js >= 18. The tool installs / checks external CLIs it drives (kubectl, helm,
kanopy-oidc, the ksec Helm plugin) and shells out to them. The corp helper additionally
needs @playwright/test (npm i -D @playwright/test && npx playwright install chromium).
License
ISC — see LICENSE.
