{
  "id": "kubectl",
  "name": "kubectl",
  "homepage": "https://kubernetes.io/docs/reference/kubectl/",
  "description": "The Kubernetes command line tool, pointed at whichever cluster its kubeconfig context names.",
  "icon": "theSVG:kubernetes",
  "executables": [
    "kubectl"
  ],
  "dotfiles": {
    "paths": [
      "~/.kube/config"
    ],
    "exclude": [
      "~/.kube/cache/",
      "~/.kube/http-cache/"
    ],
    "secret": [],
    "secret_paths": [
      {
        "file": "~/.kube/config",
        "format": "yaml",
        "match": {
          "key_path": [
            "users.*.user.token",
            "users.*.user.client-key-data",
            "users.*.user.password"
          ]
        }
      }
    ],
    "machine_lines": [
      {
        "file": "~/.kube/config",
        "format": "yaml",
        "match": {
          "key_path": [
            "current-context"
          ]
        },
        "scope": "backup"
      }
    ]
  },
  "commands": {
    "format": 1,
    "label": "kubectl",
    "description": "Common read-only jobs: get resources and read pod logs. Cluster-changing commands are left out.",
    "quality": "ai-draft",
    "base": "fig:kubectl",
    "parser": {
      "end_of_options": "--",
      "interleave": "permute",
      "long_equals": true,
      "short_attached": true,
      "short_bundles": false
    },
    "source": [
      {
        "id": "fig",
        "kind": "completion",
        "url": "https://github.com/withfig/autocomplete/blob/master/src/kubectl.ts",
        "license": "MIT"
      }
    ],
    "field": [
      {
        "id": "namespace",
        "label": "Namespace",
        "type": "string",
        "option": [
          "-n",
          "--namespace"
        ],
        "sources": [
          "fig"
        ]
      }
    ],
    "group": [
      {
        "id": "basic",
        "label": "Basic",
        "fields": [
          "namespace"
        ]
      }
    ],
    "subcommand": [
      {
        "path": [
          "get"
        ],
        "label": "Get resources",
        "description": "List or fetch resources. Watch, templates and raw requests are left out.",
        "source": [
          {
            "id": "fig",
            "kind": "completion",
            "url": "https://github.com/withfig/autocomplete/blob/master/src/kubectl.ts",
            "license": "MIT"
          }
        ],
        "field": [
          {
            "id": "resource",
            "label": "Resource type or TYPE/NAME",
            "type": "string",
            "position": 0,
            "suggestions": [
              {
                "value": "pods",
                "label": "Pods"
              },
              {
                "value": "deployments",
                "label": "Deployments"
              },
              {
                "value": "services",
                "label": "Services"
              },
              {
                "value": "nodes",
                "label": "Nodes"
              },
              {
                "value": "namespaces",
                "label": "Namespaces"
              }
            ],
            "sources": [
              "fig"
            ]
          },
          {
            "id": "output",
            "label": "Output format",
            "type": "string",
            "option": [
              "-o",
              "--output"
            ],
            "suggestions": [
              {
                "value": "wide",
                "label": "wide"
              },
              {
                "value": "yaml",
                "label": "YAML"
              },
              {
                "value": "json",
                "label": "JSON"
              },
              {
                "value": "name",
                "label": "name"
              }
            ],
            "sources": [
              "fig"
            ]
          },
          {
            "id": "selector",
            "label": "Label selector",
            "type": "string",
            "option": [
              "-l",
              "--selector"
            ],
            "sources": [
              "fig"
            ]
          },
          {
            "id": "all_namespaces",
            "label": "All namespaces",
            "type": "boolean",
            "option": [
              "-A",
              "--all-namespaces"
            ],
            "sources": [
              "fig"
            ]
          },
          {
            "id": "show_labels",
            "label": "Show labels",
            "type": "boolean",
            "option": [
              "--show-labels"
            ],
            "sources": [
              "fig"
            ]
          },
          {
            "id": "watch",
            "label": "Watch for changes",
            "type": "boolean",
            "option": [
              "-w",
              "--watch"
            ],
            "sources": [
              "fig"
            ]
          }
        ],
        "task": [
          {
            "id": "list-all",
            "label": "List across namespaces",
            "set": {
              "all_namespaces": [
                true
              ]
            },
            "fields": [
              "resource",
              "all_namespaces",
              "output"
            ],
            "required": [
              "resource"
            ]
          }
        ],
        "group": [
          {
            "id": "basic",
            "label": "Basic",
            "fields": [
              "resource",
              "output",
              "selector",
              "all_namespaces",
              "show_labels",
              "watch"
            ]
          }
        ]
      },
      {
        "path": [
          "logs"
        ],
        "label": "Read pod logs",
        "source": [
          {
            "id": "fig",
            "kind": "completion",
            "url": "https://github.com/withfig/autocomplete/blob/master/src/kubectl.ts",
            "license": "MIT"
          }
        ],
        "field": [
          {
            "id": "target",
            "label": "Pod or TYPE/NAME",
            "type": "string",
            "position": 0,
            "sources": [
              "fig"
            ]
          },
          {
            "id": "container",
            "label": "Container",
            "type": "string",
            "option": [
              "-c",
              "--container"
            ],
            "sources": [
              "fig"
            ]
          },
          {
            "id": "follow",
            "label": "Follow",
            "type": "boolean",
            "option": [
              "-f",
              "--follow"
            ],
            "sources": [
              "fig"
            ]
          },
          {
            "id": "tail",
            "label": "Last N lines",
            "type": "integer",
            "option": [
              "--tail"
            ],
            "sources": [
              "fig"
            ]
          },
          {
            "id": "since",
            "label": "Since (5s, 2m, 3h)",
            "type": "string",
            "option": [
              "--since"
            ],
            "sources": [
              "fig"
            ]
          },
          {
            "id": "previous",
            "label": "Previous container instance",
            "type": "boolean",
            "option": [
              "-p",
              "--previous"
            ],
            "sources": [
              "fig"
            ]
          },
          {
            "id": "timestamps",
            "label": "Timestamps",
            "type": "boolean",
            "option": [
              "--timestamps"
            ],
            "sources": [
              "fig"
            ]
          }
        ],
        "task": [
          {
            "id": "tail",
            "label": "Follow recent logs",
            "set": {
              "follow": [
                true
              ],
              "tail": [
                100
              ]
            },
            "fields": [
              "target",
              "follow",
              "tail",
              "container"
            ],
            "required": [
              "target"
            ]
          }
        ],
        "group": [
          {
            "id": "basic",
            "label": "Basic",
            "fields": [
              "target",
              "container",
              "follow",
              "tail",
              "since",
              "previous",
              "timestamps"
            ]
          }
        ]
      }
    ]
  }
}
