{"_id":"@andresnator/k8s-clone","_rev":"5-d752351c856394efb06e5d5c3d37a69a","name":"@andresnator/k8s-clone","dist-tags":{"latest":"1.2.1"},"versions":{"1.0.0":{"name":"@andresnator/k8s-clone","version":"1.0.0","keywords":["kubernetes","k8s","cli","migration","kubectl","devops"],"author":{"name":"@andresnator"},"license":"MIT","_id":"@andresnator/k8s-clone@1.0.0","maintainers":[{"name":"andresnator","email":"andresnator@gmail.com"}],"homepage":"https://github.com/andresnator/k8s-clone#readme","bugs":{"url":"https://github.com/andresnator/k8s-clone/issues"},"bin":{"k8s-clone":"dist/index.js"},"dist":{"shasum":"b216fd74f16e486c75a7d9ff31ddba0b9c5f9ce4","tarball":"https://registry.npmjs.org/@andresnator/k8s-clone/-/k8s-clone-1.0.0.tgz","fileCount":13,"integrity":"sha512-8zf+gnqVIaDx8pXepbfs3KfRz88CZs3LPUVqNHktvNND4soaYyOsins7jbZkqjU98HxINHKscvXKS4xMQZLIxw==","signatures":[{"sig":"MEUCIQCRlBr15QA2GgGC4PaTGX26BdldLk0N460kyziJx97/HwIgesPsoSC3gEOevmCiMzLbdpjuyOh0wFoVhMqrAr+O7Ds=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":46034},"main":"dist/index.js","type":"module","gitHead":"b7897ee1f594e357c580d5ad185efcd01bd21645","scripts":{"test":"node --experimental-vm-modules node_modules/jest/bin/jest.js","build":"tsc","start":"npm run build && node dist/index.js","test:ci":"node --experimental-vm-modules node_modules/jest/bin/jest.js --ci --coverage --maxWorkers=2","test:coverage":"node --experimental-vm-modules node_modules/jest/bin/jest.js --coverage","prepublishOnly":"npm run build"},"_npmUser":{"name":"andresnator","email":"andresnator@gmail.com"},"repository":{"url":"git+https://github.com/andresnator/k8s-clone.git","type":"git"},"_npmVersion":"11.6.4","description":"A CLI tool to clone and migrate Kubernetes resources across namespaces","directories":{},"_nodeVersion":"22.21.1","dependencies":{"ink":"^6.5.1","ora":"^9.0.0","chalk":"^5.6.2","react":"^19.2.0","inquirer":"^9.3.8","commander":"^14.0.2","ink-big-text":"^2.0.0","ink-gradient":"^3.0.0","@kubernetes/client-node":"^1.4.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^30.2.0","ts-jest":"^29.4.6","typescript":"^5.9.3","@types/jest":"^30.0.0","@types/node":"^24.10.1","@types/react":"^19.2.7","@types/inquirer":"^9.0.9","semantic-release":"^25.0.2","@semantic-release/git":"^10.0.1","@semantic-release/changelog":"^6.0.3"},"_npmOperationalInternal":{"tmp":"tmp/k8s-clone_1.0.0_1764885318049_0.40391413715422764","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@andresnator/k8s-clone","version":"1.0.1","keywords":["kubernetes","k8s","cli","migration","kubectl","devops"],"author":{"name":"@andresnator"},"license":"MIT","_id":"@andresnator/k8s-clone@1.0.1","maintainers":[{"name":"andresnator","email":"andresnator@gmail.com"}],"homepage":"https://github.com/andresnator/k8s-clone#readme","bugs":{"url":"https://github.com/andresnator/k8s-clone/issues"},"bin":{"k8s-clone":"dist/index.js"},"dist":{"shasum":"a4bfc2e9b7933876d7d7a55f300e7dbe39141454","tarball":"https://registry.npmjs.org/@andresnator/k8s-clone/-/k8s-clone-1.0.1.tgz","fileCount":15,"integrity":"sha512-E+LAeIUYG9owKVl8s39PoTmJKWbcNrJ2UylrN04lXGID0+qUSXpi7u0w2BtADO1NVFJzq5F370cfFwfeVJXUvQ==","signatures":[{"sig":"MEQCIAkgYqm7AAdEkPlw2xj1cvH9CZV7IPanYrBxgIJdd/ohAiBWmsZBXl280Jzn67IJ8pyw+LYuImVoacee/lCKHEeZrw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":59159},"main":"dist/index.js","type":"module","gitHead":"bb2b8cff00f71094c4987c23866e0fa20845cb44","scripts":{"test":"node --experimental-vm-modules node_modules/jest/bin/jest.js","build":"tsc","setup":"bash scripts/setup.sh","start":"npm run build && node dist/index.js","test:ci":"node --experimental-vm-modules node_modules/jest/bin/jest.js --ci --coverage --maxWorkers=2","test:coverage":"node --experimental-vm-modules node_modules/jest/bin/jest.js --coverage","prepublishOnly":"npm run build"},"_npmUser":{"name":"andresnator","email":"andresnator@gmail.com"},"repository":{"url":"git+https://github.com/andresnator/k8s-clone.git","type":"git"},"_npmVersion":"11.6.4","description":"A CLI tool to clone and migrate Kubernetes resources across namespaces","directories":{},"_nodeVersion":"24.11.1","dependencies":{"ink":"^6.5.1","ora":"^9.0.0","chalk":"^5.6.2","react":"^19.2.0","semver":"^7.7.3","inquirer":"^9.3.8","commander":"^14.0.2","ink-big-text":"^2.0.0","ink-gradient":"^3.0.0","@kubernetes/client-node":"^1.4.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^30.2.0","ts-jest":"^29.4.6","typescript":"^5.9.3","@types/jest":"^30.0.0","@types/node":"^24.10.1","@types/react":"^19.2.7","@types/semver":"^7.7.1","@types/inquirer":"^9.0.9","semantic-release":"^25.0.2","@semantic-release/git":"^10.0.1","@semantic-release/changelog":"^6.0.3"},"_npmOperationalInternal":{"tmp":"tmp/k8s-clone_1.0.1_1765028188100_0.4250984931733519","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"name":"@andresnator/k8s-clone","version":"1.1.0","keywords":["kubernetes","k8s","cli","migration","kubectl","devops"],"author":{"name":"@andresnator"},"license":"MIT","_id":"@andresnator/k8s-clone@1.1.0","maintainers":[{"name":"andresnator","email":"andresnator@gmail.com"}],"homepage":"https://github.com/andresnator/k8s-clone#readme","bugs":{"url":"https://github.com/andresnator/k8s-clone/issues"},"bin":{"k8s-clone":"dist/index.js"},"dist":{"shasum":"49925a5cced6c2c753d0fcaf53408960cfe754f8","tarball":"https://registry.npmjs.org/@andresnator/k8s-clone/-/k8s-clone-1.1.0.tgz","fileCount":16,"integrity":"sha512-rUWwxjJ7gpOEs2ZwOlxdqvxQymBjdYdpX+DXHYXII+bPee9h6KiQZR9wsqa7143LQ0WacxWOC31l0E+m9I/JEA==","signatures":[{"sig":"MEQCIFIQoZdE2itbfmRozk4j4xP9CdFaFF58gPL+gQsF6Sz5AiBQ/l9b8zdORCCi+wA9dhlg6p8+NFU25bDtgEFwwANZVQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":67827},"main":"dist/index.js","type":"module","gitHead":"e2ad85938664709d537e3244b6067b102d60f6f1","scripts":{"test":"node --experimental-vm-modules node_modules/jest/bin/jest.js","build":"tsc","setup":"bash scripts/setup.sh","start":"npm run build && node dist/index.js","test:ci":"node --experimental-vm-modules node_modules/jest/bin/jest.js --ci --coverage --maxWorkers=2","test:coverage":"node --experimental-vm-modules node_modules/jest/bin/jest.js --coverage","prepublishOnly":"npm run build"},"_npmUser":{"name":"andresnator","email":"andresnator@gmail.com"},"repository":{"url":"git+https://github.com/andresnator/k8s-clone.git","type":"git"},"_npmVersion":"11.6.4","description":"A CLI tool to clone and migrate Kubernetes resources across namespaces","directories":{},"_nodeVersion":"24.11.1","dependencies":{"ink":"^6.5.1","ora":"^9.0.0","chalk":"^5.6.2","react":"^19.2.0","semver":"^7.7.3","inquirer":"^9.3.8","commander":"^14.0.2","ink-big-text":"^2.0.0","ink-gradient":"^3.0.0","@kubernetes/client-node":"^1.4.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^30.2.0","ts-jest":"^29.4.6","typescript":"^5.9.3","@types/jest":"^30.0.0","@types/node":"^24.10.1","@types/react":"^19.2.7","@types/semver":"^7.7.1","@types/inquirer":"^9.0.9","semantic-release":"^25.0.2","@semantic-release/git":"^10.0.1","@semantic-release/changelog":"^6.0.3"},"_npmOperationalInternal":{"tmp":"tmp/k8s-clone_1.1.0_1765202404701_0.3645727207077727","host":"s3://npm-registry-packages-npm-production"}},"1.2.0":{"name":"@andresnator/k8s-clone","version":"1.2.0","keywords":["kubernetes","k8s","cli","migration","kubectl","devops"],"author":{"name":"@andresnator"},"license":"MIT","_id":"@andresnator/k8s-clone@1.2.0","maintainers":[{"name":"andresnator","email":"andresnator@gmail.com"}],"homepage":"https://github.com/andresnator/k8s-clone#readme","bugs":{"url":"https://github.com/andresnator/k8s-clone/issues"},"bin":{"k8s-clone":"dist/index.js"},"dist":{"shasum":"75fca7a5bf8a96271caf73d1f96998f9bb8724e2","tarball":"https://registry.npmjs.org/@andresnator/k8s-clone/-/k8s-clone-1.2.0.tgz","fileCount":16,"integrity":"sha512-n7PJLA+VJkMYudTKyn3/a22YBWr7i9aNAMzr7jG180t7KWYJhIZ2DiUbclczq5yFOUT2NEidCqv6zXbD60xgnQ==","signatures":[{"sig":"MEYCIQC7TElmSOqC1PDwVzO5GVm/nsmAz8zVszjWn4i78gHzxAIhAOqbkHkZydRsTPFshwPxpfhYiXfNs/f2bFb4erq4ylG6","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":68279},"main":"dist/index.js","type":"module","gitHead":"29e7cebaf651e6af8e36d5ca9f6ae5145267378e","scripts":{"test":"node --experimental-vm-modules node_modules/jest/bin/jest.js","build":"tsc","setup":"bash scripts/setup.sh","start":"npm run build && node dist/index.js","test:ci":"node --experimental-vm-modules node_modules/jest/bin/jest.js --ci --coverage --maxWorkers=2","test:coverage":"node --experimental-vm-modules node_modules/jest/bin/jest.js --coverage","prepublishOnly":"npm run build"},"_npmUser":{"name":"andresnator","email":"andresnator@gmail.com"},"repository":{"url":"git+https://github.com/andresnator/k8s-clone.git","type":"git"},"_npmVersion":"11.6.4","description":"A CLI tool to clone and migrate Kubernetes resources across namespaces","directories":{},"_nodeVersion":"24.11.1","dependencies":{"ink":"^6.5.1","ora":"^9.0.0","chalk":"^5.6.2","react":"^19.2.0","semver":"^7.7.3","js-yaml":"^4.1.1","inquirer":"^9.3.8","commander":"^14.0.2","ink-big-text":"^2.0.0","ink-gradient":"^3.0.0","@kubernetes/client-node":"^1.4.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^30.2.0","ts-jest":"^29.4.6","typescript":"^5.9.3","@types/jest":"^30.0.0","@types/node":"^24.10.1","@types/react":"^19.2.7","@types/semver":"^7.7.1","@types/js-yaml":"^4.0.9","@types/inquirer":"^9.0.9","semantic-release":"^25.0.2","@semantic-release/git":"^10.0.1","@semantic-release/changelog":"^6.0.3"},"_npmOperationalInternal":{"tmp":"tmp/k8s-clone_1.2.0_1765223523939_0.166945856148349","host":"s3://npm-registry-packages-npm-production"}},"1.2.1":{"name":"@andresnator/k8s-clone","version":"1.2.1","publishConfig":{"access":"public"},"description":"A CLI tool to clone and migrate Kubernetes resources across namespaces","type":"module","main":"dist/index.js","bin":{"k8s-clone":"dist/index.js"},"scripts":{"build":"tsc","start":"npm run build && node dist/index.js","test":"node --experimental-vm-modules node_modules/jest/bin/jest.js","test:coverage":"node --experimental-vm-modules node_modules/jest/bin/jest.js --coverage","test:ci":"node --experimental-vm-modules node_modules/jest/bin/jest.js --ci --coverage --maxWorkers=2","prepublishOnly":"npm run build","setup":"bash scripts/setup.sh"},"keywords":["kubernetes","k8s","cli","migration","kubectl","devops"],"author":{"name":"@andresnator"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/andresnator/k8s-clone.git"},"bugs":{"url":"https://github.com/andresnator/k8s-clone/issues"},"homepage":"https://github.com/andresnator/k8s-clone#readme","dependencies":{"@kubernetes/client-node":"^1.4.0","chalk":"^5.6.2","commander":"^14.0.2","ink":"^6.5.1","ink-big-text":"^2.0.0","ink-gradient":"^3.0.0","inquirer":"^9.3.8","js-yaml":"^4.1.1","ora":"^9.0.0","react":"^19.2.0","semver":"^7.7.3"},"devDependencies":{"@semantic-release/changelog":"^6.0.3","@semantic-release/git":"^10.0.1","@types/inquirer":"^9.0.9","@types/jest":"^30.0.0","@types/js-yaml":"^4.0.9","@types/node":"^24.10.1","@types/react":"^19.2.7","@types/semver":"^7.7.1","jest":"^30.2.0","semantic-release":"^25.0.2","ts-jest":"^29.4.6","typescript":"^5.9.3"},"gitHead":"f0f0406b139d14e641d6e9a8ccb35f2ae175644f","_id":"@andresnator/k8s-clone@1.2.1","_nodeVersion":"24.12.0","_npmVersion":"11.6.4","dist":{"integrity":"sha512-sA4SUSa4OoqS/8rFei4DdAV0t2EoC1gLjitqW3ap3jjTXrFYZGzJ/i+y3Bi66yKPFG2pwlIACTxUXcrpbKL/Lw==","shasum":"5a5020f31f7a99dac2b3351a41173def0fc08d30","tarball":"https://registry.npmjs.org/@andresnator/k8s-clone/-/k8s-clone-1.2.1.tgz","fileCount":17,"unpackedSize":73940,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQC7ZrFb5tiJVpMm/9XXwY1jfzhF5syqwL2DxUGzyGUidAIgDO7h9pHk0PMPMFOYdbLmqjoL1co58wnj+KK/UdCsiiM="}]},"_npmUser":{"name":"andresnator","email":"andresnator@gmail.com"},"directories":{},"maintainers":[{"name":"andresnator","email":"andresnator@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/k8s-clone_1.2.1_1766218333206_0.2618709554554557"},"_hasShrinkwrap":false}},"time":{"created":"2025-12-04T21:55:17.945Z","modified":"2025-12-20T08:12:13.559Z","1.0.0":"2025-12-04T21:55:18.239Z","1.0.1":"2025-12-06T13:36:28.240Z","1.1.0":"2025-12-08T14:00:04.868Z","1.2.0":"2025-12-08T19:52:04.155Z","1.2.1":"2025-12-20T08:12:13.348Z"},"bugs":{"url":"https://github.com/andresnator/k8s-clone/issues"},"author":{"name":"@andresnator"},"license":"MIT","homepage":"https://github.com/andresnator/k8s-clone#readme","keywords":["kubernetes","k8s","cli","migration","kubectl","devops"],"repository":{"type":"git","url":"git+https://github.com/andresnator/k8s-clone.git"},"description":"A CLI tool to clone and migrate Kubernetes resources across namespaces","maintainers":[{"name":"andresnator","email":"andresnator@gmail.com"}],"readme":"\n<img width=\"1191\" height=\"295\" alt=\"image\" src=\"https://github.com/user-attachments/assets/c57244ee-c09a-44ea-95bd-5e81d3bc6da5\" />\n\n\n# K8s Migrator\n\n[![CI](https://github.com/andresnator/k8s-clone/actions/workflows/ci.yml/badge.svg)](https://github.com/andresnator/k8s-clone/actions/workflows/ci.yml)\n[![CodeQL](https://github.com/andresnator/k8s-clone/actions/workflows/codeql.yml/badge.svg)](https://github.com/andresnator/k8s-clone/actions/workflows/codeql.yml)\n[![npm version](https://badge.fury.io/js/@andresnator%2Fk8s-clone.svg)](https://badge.fury.io/js/@andresnator%2Fk8s-clone)\n\n<a href=\"https://buymeacoffee.com/andresnator\"><img src=\"https://github.com/user-attachments/assets/c720fbfe-bae5-4c03-b038-eccf8c71e9aa\" alt=\"Buy Me a Coffee\" width=\"150\"></a>\n\nA CLI tool to clone and migrate Kubernetes resources across namespaces.\n\n## Features\n\n- Granular selection of resources (Services, Deployments, ConfigMaps, Secrets, PVCs).\n- PVC data migration (copies volume contents).\n- Friendly interactive interface.\n- Automatic update notifications - displays when a newer version is available on npm.\n- **Custom Apps** - Group and deploy related Kubernetes resources as configurable applications (see [CUSTOM_APPS.md](./CUSTOM_APPS.md)).\n\n## Requirements\n\n- Node.js (Tested on v20.x and v22.x)\n- `kubectl` installed and available in your PATH.\n- Access to a Kubernetes cluster (current context in `~/.kube/config`).\n\n## Installation\n\n### Global Installation (Recommended)\n\nInstall `k8s-clone` globally from npm:\n\n```bash\nnpm install -g @andresnator/k8s-clone\n```\n\nThen run:\n\n```bash\nk8s-clone\n```\n\n### Local Development\n\n```bash\ngit clone https://github.com/andresnator/k8s-clone.git\ncd k8s-clone\nnpm install\nnpm run build\n```\n\n## Configuration\n\nk8s-clone uses an optional configuration file at `~/.k8s-clone/config.yaml` to store default cluster and namespace settings.\n\n**Setup**: Run `npm run setup` to create the configuration directory and file automatically.\n\n**Custom Location**: Set `K8S_CLONE_CONFIG` environment variable to use a different path.\n\n**Behavior**: When empty, the tool auto-detects clusters from `~/.kube/config` and fetches resources via Kubernetes API. When populated, it uses pre-configured values. See `config.example.yaml` for structure details.\n\n### Environment Variables\n\n- `K8S_CLONE_CONFIG`: Set a custom path for the configuration file (default: `~/.k8s-clone/config.yaml`)\n- `K8S_CLONE_SKIP_VERSION_CHECK`: Set to any truthy value (`true`, `1`, `yes`, or any non-empty string) to skip version update checks (useful for CI/CD environments)\n\n## Usage\n\nIf installed globally:\n\n```bash\nk8s-clone\n```\n\nIf running locally:\n\n```bash\nnpm start\n```\n\nFollow the on‑screen prompts to choose the source namespace, the destination namespace, and the resources you wish to migrate.\n\n### Command-Line Options\n\n- `--version, -v`: Display the current version number\n- `--help, -h`: Display help information\n\n## Custom Apps\n\nThe **Custom Apps** feature allows you to group related Kubernetes resources into logical applications and deploy them as a unit with optional spec overrides.\n\n**Key Features:**\n- Define applications once in config, deploy multiple times\n- Override resource specs per environment (e.g., replica counts, storage sizes)\n- Support for deep nesting in overwrite-spec\n- Duplicate resource detection and warnings\n\nFor complete documentation, examples, and troubleshooting, see **[CUSTOM_APPS.md](./CUSTOM_APPS.md)**.\n\n## Demo\n\nWant to see it in action? We have prepared a comprehensive **[Demo Guide](./DEMO.md)** that walks you through a realistic migration scenario.\n\nThe demo uses a full-stack application (Frontend + Backend + Database) with persistent storage to showcase:\n- **Stateful Migration**: Moving PVCs with actual data.\n- **Configuration Handling**: Migrating ConfigMaps and Secrets.\n- **Networking**: Preserving Services and Ingress rules.\n\nCheck out **[DEMO.md](./DEMO.md)** for step-by-step instructions on how to deploy the test app and run the migration.\n \n## Multi-Cluster Setup\n\nFor testing with Minikube profiles, see the detailed [Demo Guide](./DEMO.md) which includes multi-cluster migration scenarios.\n\n## How It Works\n\n1. **Select Contexts & Namespaces**: Choose source/destination clusters and namespaces\n2. **Select Resources**: Interactive prompts let you choose which resources to migrate\n3. **Clean Metadata**: System-generated fields are automatically removed\n4. **Migrate Data**: PVC data is transferred using temporary pods and `tar` streaming\n5. **Create Resources**: All selected resources are recreated in the destination namespace\n\n## Project Structure\n\n- `src/index.ts` - CLI entry point and user interaction flow\n- `src/migrator.ts` - Core migration logic\n- `src/cleaner.ts` - Resource cleanup logic\n- `src/k8s.ts` - Kubernetes API client wrapper\n- `src/ui.ts` - Interactive UI components\n- `src/config.ts` - Configuration management\n- `src/metadata-cleaner.ts` - Metadata cleaning utilities\n- `src/resource-handlers.ts` - Resource-specific handling logic\n- `src/types.ts` - TypeScript type definitions\n- `src/Banner.tsx` - Banner component\n- `scripts/setup.sh` - Configuration setup script\n- `demo/demo.yaml` - Complete demo application manifest\n\n## Testing\n\nTo run the unit tests:\n\n```bash\nnpm test\n```\n\n## Contributing\n\nContributions are welcome! Please see [CONTRIBUTING.md](./CONTRIBUTING.md) for guidelines on how to contribute, including our commit message conventions and automated release process.\n\n## License\n\nThis project is licensed under the MIT License — see the `LICENSE` file for details.\n\nSPDX-License-Identifier: MIT\n","readmeFilename":"README.md"}