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] # The upstream README documents ~/.config/ocm/ocm.json on Linux, and # ~/Library/Application Support/ocm/ocm.json on macOS. It also documents the # pre-0.1.56 legacy ~/.ocm.json location; retain it for existing installs. # https://github.com/openshift-online/ocm-cli#log-in 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 } [[commands.subcommand]] path = ["login"] label = "Log in" [[commands.subcommand.source]] id = "readme" kind = "help" url = "https://github.com/openshift-online/ocm-cli/blob/main/README.md" revision = "main" evidence = ''' $ ocm login --token=eyJ... $ ocm login \ --token=eyJ... \ --url=https://localhost:8000 \ --insecure $ ocm login --url=production --token=... $ ocm get /api/clusters_mgmt/v1/clusters --parameter search="name like 'my%'" The `--parameter` option is used to specify query parameters. $ ocm post /api/clusters_mgmt/v1/clusters --body=mycluster.json $ ocm --opaque-token get /api/clusters_mgmt/v1/clusters $ ocm whoami $ ocm logout ''' [[commands.subcommand.field]] id = "url" label = "API URL or alias" type = "string" option = ["--url"] suggestions = [{ value = "production", label = "production" }, { value = "staging", label = "staging" }] sources = ["readme"] [[commands.subcommand.field]] id = "insecure" label = "Skip TLS verification" type = "boolean" option = ["--insecure"] sources = ["readme"] [[commands.subcommand.task]] id = "login" label = "Log in" fields = ["url", "insecure"] required = [] [[commands.subcommand.group]] id = "basic" label = "Basic" fields = ["url", "insecure"] [[commands.subcommand]] path = ["get"] label = "GET an API path" [[commands.subcommand.source]] id = "readme" kind = "help" url = "https://github.com/openshift-online/ocm-cli/blob/main/README.md" revision = "main" evidence = ''' $ ocm login --token=eyJ... $ ocm login \ --token=eyJ... \ --url=https://localhost:8000 \ --insecure $ ocm login --url=production --token=... $ ocm get /api/clusters_mgmt/v1/clusters --parameter search="name like 'my%'" The `--parameter` option is used to specify query parameters. $ ocm post /api/clusters_mgmt/v1/clusters --body=mycluster.json $ ocm --opaque-token get /api/clusters_mgmt/v1/clusters $ ocm whoami $ ocm logout ''' [[commands.subcommand.field]] id = "path" label = "API path" description = "For example /api/clusters_mgmt/v1/clusters." type = "string" position = 0 min = 1 sources = ["readme"] [[commands.subcommand.field]] id = "parameter" label = "Query parameter (name=value)" description = "For example search=name like 'my%'." type = "string" option = ["--parameter"] multiple = true sources = ["readme"] [[commands.subcommand.field]] id = "opaque_token" label = "Use opaque token" type = "boolean" option = ["--opaque-token"] sources = ["readme"] [[commands.subcommand.task]] id = "list_clusters" label = "List clusters" fields = ["path", "parameter"] required = ["path"] set = { path = ["/api/clusters_mgmt/v1/clusters"] } [[commands.subcommand.group]] id = "basic" label = "Basic" fields = ["path", "parameter"] [[commands.subcommand.group]] id = "advanced" label = "Advanced" fields = ["opaque_token"]