From 5b67483d939a41aa5ffb89cb5a0feaa7f2e5be6f Mon Sep 17 00:00:00 2001 From: Warp Agent Date: Thu, 6 Aug 2026 01:01:17 +0000 Subject: [PATCH 1/2] Add completion spec: Yandex Cloud CLI (yc) Add a script-backed completion generator for the Yandex Cloud CLI (yc). Like kubectl and oc, yc is Cobra-based, so completions are produced by shelling out to the CLI's own `yc __completeNoDesc` command. This keeps subcommand completions in sync with the installed CLI version instead of hand-maintaining the command tree. - command-signatures/src/generators/yc.rs: the yc_builtin_completion generator (command builder + output parser) with unit tests. - command-signatures/json/yc.json: static spec wiring the generator to a top-level variadic arg plus the CLI's persistent global flags. - generators/mod.rs: register the generator. Co-Authored-By: Warp Agent --- command-signatures/json/yc.json | 128 +++++++++++++++++++++++ command-signatures/src/generators/mod.rs | 2 + command-signatures/src/generators/yc.rs | 118 +++++++++++++++++++++ 3 files changed, 248 insertions(+) create mode 100644 command-signatures/json/yc.json create mode 100644 command-signatures/src/generators/yc.rs diff --git a/command-signatures/json/yc.json b/command-signatures/json/yc.json new file mode 100644 index 00000000..1136ceab --- /dev/null +++ b/command-signatures/json/yc.json @@ -0,0 +1,128 @@ +{ + "name": "yc", + "description": "Command line interface for Yandex Cloud", + "args": { + "name": "command", + "description": "Yandex Cloud command or argument", + "isVariadic": true, + "isOptional": true, + "generatorName": "yc_builtin_completion", + "skipGeneratorValidation": true + }, + "options": [ + { + "name": "--profile", + "description": "Set the custom configuration file", + "isPersistent": true, + "args": { + "name": "PROFILE" + } + }, + { + "name": "--debug", + "description": "Debug logging", + "isPersistent": true + }, + { + "name": "--debug-grpc", + "description": "Debug gRPC logging. Very verbose, used for debugging connection problems", + "isPersistent": true + }, + { + "name": "--no-user-output", + "description": "Disable printing user intended output to stderr", + "isPersistent": true + }, + { + "name": "--retry", + "description": "Set the number of gRPC retry attempts (0 disables, negative means infinite)", + "isPersistent": true, + "args": { + "name": "ATTEMPTS" + } + }, + { + "name": "--cloud-id", + "description": "Set the ID of the cloud to use", + "isPersistent": true, + "args": { + "name": "CLOUD_ID" + } + }, + { + "name": "--folder-id", + "description": "Set the ID of the folder to use", + "isPersistent": true, + "args": { + "name": "FOLDER_ID" + } + }, + { + "name": "--folder-name", + "description": "Set the name of the folder to use (will be resolved to id)", + "isPersistent": true, + "args": { + "name": "FOLDER_NAME" + } + }, + { + "name": "--endpoint", + "description": "Set the Cloud API endpoint (host:port)", + "isPersistent": true, + "args": { + "name": "ENDPOINT" + } + }, + { + "name": "--token", + "description": "Set the OAuth token to use", + "isPersistent": true, + "args": { + "name": "TOKEN" + } + }, + { + "name": "--impersonate-service-account-id", + "description": "Set the ID of the service account to impersonate", + "isPersistent": true, + "args": { + "name": "SERVICE_ACCOUNT_ID" + } + }, + { + "name": "--no-browser", + "description": "Disable opening browser for authentication", + "isPersistent": true + }, + { + "name": "--format", + "description": "Set the output format", + "isPersistent": true, + "args": { + "name": "FORMAT", + "suggestions": [ + "text", + "yaml", + "json", + "json-rest" + ] + } + }, + { + "name": "--jq", + "description": "Query to select values from the response using jq syntax", + "isPersistent": true, + "args": { + "name": "EXPRESSION" + } + }, + { + "name": [ + "-h", + "--help" + ], + "description": "Display help for the command", + "isPersistent": true + } + ] +} diff --git a/command-signatures/src/generators/mod.rs b/command-signatures/src/generators/mod.rs index 5f61e727..c9acf056 100644 --- a/command-signatures/src/generators/mod.rs +++ b/command-signatures/src/generators/mod.rs @@ -75,6 +75,7 @@ mod tmux; mod tmuxinator; mod tsh; mod uv; +mod yc; /// Used for gcloud and gsutil completions. mod gcloud; @@ -160,6 +161,7 @@ pub fn dynamic_command_signature_data() -> HashMap