apigee / apigeecli

This is a tool to interact with Apigee APIs. The tool lets you manage (create, del, get, list) environments, proxies, etc.
Apache License 2.0
51 stars 28 forks source link

generate apigeecli tree #503

Closed srinandan closed 1 month ago

adielskaistyael commented 1 month ago

Hi, i used this new feature and is is a great addition, but i would like to make a suggestion. The tree doesn't show the flags options for the commands. i think it can be useful to add those to, and present them in a JSON format. For example:

{ "commands": [ { "name": "apicategories", "commands": [ { "name": "create", "flags": [ { "name": "--name", "type": "string", "short_version": "-n", "description": "API Category name" } ], "discription": "Creates a new API category" }, { "name": "delete", "flags": [ { "name": "--id", "type": "string", "short_version": "-i", "description": "API Category ID" }, { "name": "--name", "type": "string", "short_version": "-n", "description": "API Catalog Name" } ], "discription": "Deletes an API Category by ID or name" }, { "name": "export", "flags": [ { "name": "--folder", "type": "string", "short_version": "-f", "description": "folder to export API Docs" } ], "discription": "Export API Categories across all sites" }, { "name": "get", "flags": [ { "name": "--id", "type": "string", "short_version": "-i", "description": "API Category ID" }, { "name": "--name", "type": "string", "short_version": "-n", "description": "API Catalog Name" } ], "discription": "Gets an API Category by ID or name" }, { "name": "import", "flags": [ { "name": "--file", "type": "string", "short_version": "-f", "description": "A file containing categories" } ], "discription": "Import from a folder containing apicategories" }, { "name": "list", "discription": "Returns the API categories associated with a portal" } ], "flags": [ { "name": "--help", "type": "api", "short_version": "-h", "description": "help for categories" }, { "name": "--org", "type": "string", "short_version": "-o", "description": "Apigee organization name" }, { "name": "--region", "type": "string", "short_version": "-r", "description": "Apigee control plane region name; default is https://gee.googleapis.com" }, { "name": "--siteid", "type": "string", "short_version": "-s", "description": "Name or siteid of the portal" } ], "discription": "Manage Apigee API categories that are tagged on catalog items" }, { "name": "apidocs", "commands": [], "flags": [], "discription": "Manage Apigee API catalog item through ApiDoc" }, { "name": "apihub", "commands": [], "flags": [], "discription": "Manage Apigee API Hub Resources" }, { "name": "apis", "commands": [], "flags": [], "discription": "Manage Apigee API proxies in an org" }, { "name": "appgroups", "commands": [], "flags": [], "discription": "Manage Apigee Application Groups" }, { "name": "apps", "commands": [], "flags": [], "discription": "Manage Apigee Developer Applications" }, { "name": "cache", "commands": [], "flags": [], "discription": "Manage caches within an Apigee environment" }, { "name": "completion", "commands": [], "flags": [], "discription": "Generate the autocompletion script for the specified shell" }, { "name": "datacollectors", "commands": [], "flags": [], "discription": "Manage Apigee datacollectors entities" }, { "name": "datastores", "commands": [], "flags": [], "discription": "Manage data stores to export analytics data" }, { "name": "developers", "commands": [], "flags": [], "discription": "Manage Apigee App Developers" }, { "name": "endpoints", "commands": [], "flags": [], "discription": "Manage Service Endpoints for PSC Consumers in Apigee" }, { "name": "envgroups", "commands": [], "flags": [], "discription": "Manage Apigee environment groups" }, { "name": "environments", "commands": [], "flags": [], "discription": "Manage Apigee environments" }, { "name": "flowhooks", "commands": [], "flags": [], "discription": "Manage Flowhooks" }, { "name": "help", "commands": [], "flags": [], "discription": "Help about any command" }, { "name": "iam", "commands": [], "flags": [], "discription": "Manage IAM permissions for Apigee" }, { "name": "instances", "commands": [], "flags": [], "discription": "Manage Apigee runtime instances" }, { "name": "keyaliases", "commands": [], "flags": [], "discription": "Manage Key Aliases" }, { "name": "keystores", "commands": [], "flags": [], "discription": "Manage Key Stores" }, { "name": "kvms", "commands": [], "flags": [], "discription": "Manage Key Value Maps" }, { "name": "operations", "commands": [], "flags": [], "discription": "View Apigee Operations" }, { "name": "organizations", "commands": [], "flags": [], "discription": "Manage Apigee Orgs" }, { "name": "preferences", "commands": [], "flags": [], "discription": "Manage apigeecli preferences" }, { "name": "products", "commands": [], "flags": [], "discription": "Manage Apigee API products" }, { "name": "projects", "commands": [], "flags": [], "discription": "Manage GCP Projects that have Apigee enabled" }, { "name": "references", "commands": [], "flags": [], "discription": "Manage References within an Apigee environment" }, { "name": "resources", "commands": [], "flags": [], "discription": "Manage resources within an Apigee environment" }, { "name": "securityprofiles", "commands": [], "flags": [], "discription": "Manage Adv API Security Profiles" }, { "name": "sharedflows", "commands": [], "flags": [], "discription": "Manage Apigee shared flows in an org" }, { "name": "sites", "commands": [], "flags": [], "discription": "Manage Apigee API Portals" }, { "name": "sync", "commands": [], "flags": [], "discription": "Manage identities with grant access to control plane resources" }, { "name": "targetservers", "commands": [], "flags": [], "discription": "Manage Target Servers" }, { "name": "token", "commands": [], "flags": [], "discription": "Manage OAuth 2.0 access tokens" } ], "flags": [ { "name": "--account", "discription": "Path Service Account private key in JSON", "type": "string", "short_version": "-a" }, { "name": "--api", "discription": "Sets the control plane API. Must be one of prod, autopush or staging; default is prod", "type": "string", "options": [ "prod", "autopush", "staging" ] }, { "name": "--default-token", "discription": "Use Google default application credentials access token" }, { "name": "--disable-check", "discription": "Disable check for newer versions" }, { "name": "--metadata-token", "discription": "Metadata OAuth2 access token" }, { "name": "--no-output", "discription": "Disable printing all statements to stdout" }, { "name": "--no-warnings", "discription": "Disable printing warnings to stderr" }, { "name": "--print-output", "discription": "Control printing of info log statements (default true)" }, { "name": "--token", "discription": "Google OAuth Token", "type": "string", "short_version": "-t" } ] }

this is obviously incomplete, I started making it for a separate project in order to test some stuff