{
  "id": "ocm",
  "name": "OpenShift Cluster Manager CLI",
  "homepage": "https://github.com/openshift-online/ocm-cli",
  "description": "CLI for the Red Hat OpenShift Cluster Manager",
  "executables": [
    "ocm"
  ],
  "platforms": [
    "macos",
    "linux"
  ],
  "dotfiles": {
    "paths": [],
    "secret": [
      "[configHome]/ocm/ocm.json",
      "[appData]/ocm/ocm.json",
      "~/.ocm.json"
    ]
  },
  "commands": {
    "format": 1,
    "label": "OpenShift Cluster Manager",
    "description": "Log in and query the OCM API. Tokens are not offered as a field. Other API verbs and cluster commands are left out.",
    "quality": "ai-draft",
    "parser": {
      "end_of_options": "--",
      "interleave": "permute",
      "long_equals": true,
      "short_attached": false,
      "short_bundles": false
    },
    "subcommand": [
      {
        "path": [
          "login"
        ],
        "label": "Log in",
        "source": [
          {
            "id": "readme",
            "kind": "help",
            "url": "https://github.com/openshift-online/ocm-cli/blob/main/README.md",
            "revision": "main",
            "evidence": "$ ocm login --token=eyJ...\n$ ocm login \\\n--token=eyJ... \\\n--url=https://localhost:8000 \\\n--insecure\n$ ocm login --url=production --token=...\n$ ocm get /api/clusters_mgmt/v1/clusters --parameter search=\"name like 'my%'\"\nThe `--parameter` option is used to specify query parameters.\n$ ocm post /api/clusters_mgmt/v1/clusters --body=mycluster.json\n$ ocm --opaque-token get /api/clusters_mgmt/v1/clusters\n$ ocm whoami\n$ ocm logout\n"
          }
        ],
        "field": [
          {
            "id": "url",
            "label": "API URL or alias",
            "type": "string",
            "option": [
              "--url"
            ],
            "suggestions": [
              {
                "value": "production",
                "label": "production"
              },
              {
                "value": "staging",
                "label": "staging"
              }
            ],
            "sources": [
              "readme"
            ]
          },
          {
            "id": "insecure",
            "label": "Skip TLS verification",
            "type": "boolean",
            "option": [
              "--insecure"
            ],
            "sources": [
              "readme"
            ]
          }
        ],
        "task": [
          {
            "id": "login",
            "label": "Log in",
            "fields": [
              "url",
              "insecure"
            ],
            "required": []
          }
        ],
        "group": [
          {
            "id": "basic",
            "label": "Basic",
            "fields": [
              "url",
              "insecure"
            ]
          }
        ]
      },
      {
        "path": [
          "get"
        ],
        "label": "GET an API path",
        "source": [
          {
            "id": "readme",
            "kind": "help",
            "url": "https://github.com/openshift-online/ocm-cli/blob/main/README.md",
            "revision": "main",
            "evidence": "$ ocm login --token=eyJ...\n$ ocm login \\\n--token=eyJ... \\\n--url=https://localhost:8000 \\\n--insecure\n$ ocm login --url=production --token=...\n$ ocm get /api/clusters_mgmt/v1/clusters --parameter search=\"name like 'my%'\"\nThe `--parameter` option is used to specify query parameters.\n$ ocm post /api/clusters_mgmt/v1/clusters --body=mycluster.json\n$ ocm --opaque-token get /api/clusters_mgmt/v1/clusters\n$ ocm whoami\n$ ocm logout\n"
          }
        ],
        "field": [
          {
            "id": "path",
            "label": "API path",
            "description": "For example /api/clusters_mgmt/v1/clusters.",
            "type": "string",
            "position": 0,
            "min": 1,
            "sources": [
              "readme"
            ]
          },
          {
            "id": "parameter",
            "label": "Query parameter (name=value)",
            "description": "For example search=name like 'my%'.",
            "type": "string",
            "option": [
              "--parameter"
            ],
            "multiple": true,
            "sources": [
              "readme"
            ]
          },
          {
            "id": "opaque_token",
            "label": "Use opaque token",
            "type": "boolean",
            "option": [
              "--opaque-token"
            ],
            "sources": [
              "readme"
            ]
          }
        ],
        "task": [
          {
            "id": "list_clusters",
            "label": "List clusters",
            "fields": [
              "path",
              "parameter"
            ],
            "required": [
              "path"
            ],
            "set": {
              "path": [
                "/api/clusters_mgmt/v1/clusters"
              ]
            }
          }
        ],
        "group": [
          {
            "id": "basic",
            "label": "Basic",
            "fields": [
              "path",
              "parameter"
            ]
          },
          {
            "id": "advanced",
            "label": "Advanced",
            "fields": [
              "opaque_token"
            ]
          }
        ]
      }
    ]
  }
}
