{
  "name": "kubectl-cli",
  "displayName": "kubectl CLI",
  "description": "Install and update kubectl CLI Tools without leaving Podman Desktop",
  "version": "1.16.0-next",
  "icon": "icon.png",
  "publisher": "podman-desktop",
  "license": "Apache-2.0",
  "engines": {
    "podman-desktop": "^0.0.1"
  },
  "main": "./dist/extension.js",
  "contributes": {
    "commands": [
      {
        "command": "kubectl.install",
        "title": "Kubectl: Install..."
      },
      {
        "command": "kubectl.checks",
        "title": "Kubectl: Checks..."
      },
      {
        "command": "kubectl.onboarding.checkDownloadedCommand",
        "title": "Kubectl: Check kubectl Downloaded"
      },
      {
        "command": "kubectl.onboarding.downloadCommand",
        "title": "Kubectl: Download kubectl"
      }
    ],
    "onboarding": {
      "title": "kubectl Setup",
      "enablement": "!kubectl.isKubectlInstalledSystemWide",
      "steps": [
        {
          "id": "checkDownloadedCommand",
          "label": "Check kubectl",
          "title": "Checking for kubectl installation",
          "command": "kubectl.onboarding.checkDownloadedCommand",
          "completionEvents": ["onCommand:kubectl.onboarding.checkDownloadedCommand"]
        },
        {
          "id": "welcomeDownloadView",
          "label": "kubectl Download",
          "title": "kubectl download",
          "when": "!kubectl.isKubectlInstalledSystemWide && onboardingContext:kubectlIsNotDownloaded",
          "content": [
            [
              {
                "value": "kubectl support in Podman Desktop enables you to use kubectl CLI ."
              }
            ],
            [
              {
                "value": "kubectl will be downloaded in the next step (Version ${onboardingContext:kubectlDownloadVersion}). :link[Want to download a different version?]{command=kubectl.onboarding.promptUserForVersion}",
                "when": "!onboardingContext:kubectlShowCustomDownloadDialog"
              }
            ]
          ]
        },
        {
          "id": "downloadCommand",
          "title": "Downloading kubectl ${onboardingContext:kubectlDownloadVersion}",
          "description": "Downloading the binary.\n\nOnce downloaded, the next step will install kubectl system-wide.",
          "when": "!kubectl.isKubectlInstalledSystemWide && onboardingContext:kubectlIsNotDownloaded",
          "command": "kubectl.onboarding.downloadCommand",
          "completionEvents": ["onCommand:kubectl.onboarding.downloadCommand"]
        },
        {
          "id": "downloadFailure",
          "title": "Failed downloading kubectl",
          "when": "!kubectl.isKubectlInstalledSystemWide && onboardingContext:kubectlIsNotDownloaded",
          "state": "failed"
        },
        {
          "id": "downloadSuccessfulView",
          "title": "kubectl successfully downloaded",
          "when": "!kubectl.isKubectlInstalledSystemWide && !onboardingContext:kubectlIsNotDownloaded",
          "content": [
            [
              {
                "value": "kubectl has been successfully downloaded! In order to use kubectl from the terminal, it is required for kubectl to be installed system-wide.\n\nThe next step will install kubectl system-wide. **You will be prompted for system privileges when enabling this.**"
              }
            ]
          ]
        },
        {
          "id": "installSystemWideCommand",
          "title": "Install kubectl",
          "description": "Installing the binary system-wide.\n\n You may be prompted for elevated system privileges.",
          "when": "!kubectl.isKubectlInstalledSystemWide && !kubectl.isKubectlInstalledSystemWide",
          "command": "kubectl.onboarding.installSystemWideCommand",
          "completionEvents": ["onCommand:kubectl.onboarding.installSystemWideCommand"]
        },
        {
          "id": "installSystemWideFailure",
          "title": "Failed installing kubectl",
          "when": "!kubectl.isKubectlInstalledSystemWide && !kubectl.isKubectlInstalledSystemWide",
          "state": "failed"
        },
        {
          "id": "installSystemWideSuccess",
          "title": "kubectl installed",
          "when": "kubectl.isKubectlInstalledSystemWide",
          "state": "completed",
          "content": [
            [
              {
                "value": "#### How to use kubectl \nRun `kubectl help` in the terminal for a list of commands to interact with your Kubernetes cluster. For example, try the 'Deploy to Kubernetes' button within Podman Desktop and view your pods with `kubectl`:\n\n`$ kubectl get pods`",
                "highlight": true
              }
            ]
          ]
        }
      ]
    },
    "configuration": {
      "title": "Kubectl",
      "properties": {
        "kubectl.binary.installKubectlSystemWide": {
          "type": "boolean",
          "default": false,
          "scope": ["DEFAULT", "Onboarding"],
          "hidden": true,
          "description": "Install system-wide instead of just your user directory, so kubectl can be accessed on the command line. Note: You may be prompted for elevated system privileges when enabling this."
        }
      }
    }
  },
  "scripts": {
    "build": "vite build && node ./scripts/build.js",
    "test": "vitest run --coverage",
    "watch": "vite build -w",
    "format:check": "biome format",
    "format:fix": "biome format --write"
  },
  "dependencies": {
    "@octokit/rest": "^21.0.2",
    "@podman-desktop/api": "workspace:*",
    "semver": "^7.6.3",
    "shell-path": "^3.0.0"
  },
  "devDependencies": {
    "@types/semver": "^7.5.8",
    "adm-zip": "^0.5.16",
    "byline": "^5.0.0",
    "copyfiles": "^2.4.1",
    "mkdirp": "^3.0.1",
    "vite": "^6.0.7",
    "vitest": "^2.1.6"
  }
}
