@robinmordasiewicz/f5xc-xcsh 6.37.0 → 6.39.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/completions/_xcsh +35 -33
- package/completions/xcsh.bash +2 -2
- package/completions/xcsh.fish +35 -33
- package/dist/index.js +1107 -295
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -44109,7 +44109,7 @@ var generatedDomains = /* @__PURE__ */ new Map([
|
|
|
44109
44109
|
name: "admin_console_and_ui",
|
|
44110
44110
|
displayName: "Admin Console And Ui",
|
|
44111
44111
|
description: "Create administrative dashboard building blocks with tailored setup data and view bindings. Organize presentational materials by namespace and fetch them by name or list all available items. Define display parameters, track system object relationships, and maintain consistent portal appearance through centralized resource management workflows.",
|
|
44112
|
-
descriptionShort: "Manage static UI components for admin console",
|
|
44112
|
+
descriptionShort: "Manage static UI components for admin console.",
|
|
44113
44113
|
descriptionMedium: "Deploy and retrieve graphical elements within namespaces. Configure custom startup parameters and view references for display composition.",
|
|
44114
44114
|
aliases: ["console-ui", "ui-assets", "static-components"],
|
|
44115
44115
|
complexity: "simple",
|
|
@@ -44123,7 +44123,7 @@ var generatedDomains = /* @__PURE__ */ new Map([
|
|
|
44123
44123
|
name: "api",
|
|
44124
44124
|
displayName: "Api",
|
|
44125
44125
|
description: "Catalog services automatically to maintain an inventory of operations and their characteristics. Organize related resources by function or ownership through logical groupings. Establish verification procedures that confirm authentication requirements and expected response structures. Link definitions with load balancers for traffic routing decisions. Flag non-standard paths for exclusion from automated scanning. Monitor resource status and metadata throughout deployment zones.",
|
|
44126
|
-
descriptionShort: "Discover, catalog, and test service interfaces",
|
|
44126
|
+
descriptionShort: "Discover, catalog, and test service interfaces.",
|
|
44127
44127
|
descriptionMedium: "Define interface groups and discovery policies. Set up verification rules to check security posture and expected patterns across environments.",
|
|
44128
44128
|
aliases: ["apisec", "api-discovery"],
|
|
44129
44129
|
complexity: "advanced",
|
|
@@ -44201,7 +44201,7 @@ var generatedDomains = /* @__PURE__ */ new Map([
|
|
|
44201
44201
|
name: "bigip",
|
|
44202
44202
|
displayName: "Bigip",
|
|
44203
44203
|
description: "Define custom rule-based policies governing routing decisions and request handling. Build organized collections for network ranges, string patterns, and key-value entries. Map cloud services to physical appliances through connector setups. Link identity workflows using access modules. Track performance metrics and coordinate synchronization between components.",
|
|
44204
|
-
descriptionShort: "Manage iRules, data groups, and virtual servers",
|
|
44204
|
+
descriptionShort: "Manage iRules, data groups, and virtual servers.",
|
|
44205
44205
|
descriptionMedium: "Configure traffic logic scripts and structured list entries. Establish appliance bindings and access module integrations.",
|
|
44206
44206
|
aliases: ["f5-bigip", "irule", "ltm"],
|
|
44207
44207
|
complexity: "moderate",
|
|
@@ -44215,7 +44215,7 @@ var generatedDomains = /* @__PURE__ */ new Map([
|
|
|
44215
44215
|
name: "billing_and_usage",
|
|
44216
44216
|
displayName: "Billing And Usage",
|
|
44217
44217
|
description: "Set up payment methods with primary and secondary designations for redundancy. Initiate plan transitions between subscription tiers with state tracking. Download invoice PDFs and query custom invoice lists by date range or status. Define quota limits per namespace and monitor current usage against allocated capacity. Swap payment method roles without service interruption.",
|
|
44218
|
-
descriptionShort: "Manage subscription plans and payment methods",
|
|
44218
|
+
descriptionShort: "Manage subscription plans and payment methods.",
|
|
44219
44219
|
descriptionMedium: "Configure billing transitions and payment processing. Track invoices and monitor resource quota consumption across namespaces.",
|
|
44220
44220
|
aliases: ["billing-usage", "quotas", "usage-tracking"],
|
|
44221
44221
|
complexity: "moderate",
|
|
@@ -44229,7 +44229,7 @@ var generatedDomains = /* @__PURE__ */ new Map([
|
|
|
44229
44229
|
name: "blindfold",
|
|
44230
44230
|
displayName: "Blindfold",
|
|
44231
44231
|
description: "Define policy rules with label matching and combining algorithms. Set up transformers and matchers to control data safeguarding. Track access patterns through timestamped records with scroll queries and date groupings. Retrieve public keys for cryptographic operations and process policy information for decryption workflows.",
|
|
44232
|
-
descriptionShort: "Manage secret encryption and policy rules",
|
|
44232
|
+
descriptionShort: "Manage secret encryption and policy rules.",
|
|
44233
44233
|
descriptionMedium: "Configure protection policies and access controls for sensitive data. Monitor usage through detailed logs and date-based rollups.",
|
|
44234
44234
|
aliases: ["bf", "encrypt", "secrets"],
|
|
44235
44235
|
complexity: "moderate",
|
|
@@ -44243,7 +44243,7 @@ var generatedDomains = /* @__PURE__ */ new Map([
|
|
|
44243
44243
|
name: "bot_and_threat_defense",
|
|
44244
44244
|
displayName: "Bot And Threat Defense",
|
|
44245
44245
|
description: "Deploy namespace-scoped protection using behavioral analysis and machine learning. Provision dedicated keys for system automation and real-time intelligence feeds. Coordinate detection across protected applications through centralized managers. Configure pre-authentication checks to identify suspicious patterns before they reach backends. Enable adaptive blocking decisions based on risk scoring and historical activity profiles.",
|
|
44246
|
-
descriptionShort: "Detect and block automated attacks",
|
|
44246
|
+
descriptionShort: "Detect and block automated attacks.",
|
|
44247
44247
|
descriptionMedium: "Create bot defense instances with Shape integration. Set up traffic classification rules and automated response policies for malicious actors.",
|
|
44248
44248
|
aliases: ["threat-defense", "tpm", "shape-bot"],
|
|
44249
44249
|
complexity: "moderate",
|
|
@@ -44257,7 +44257,7 @@ var generatedDomains = /* @__PURE__ */ new Map([
|
|
|
44257
44257
|
name: "cdn",
|
|
44258
44258
|
displayName: "Cdn",
|
|
44259
44259
|
description: "Set up cache eligibility based on headers, cookies, and query parameters. Create expression-based rules with custom TTL settings and path matchers. Deploy load balancers that handle content distribution across origin pools. Monitor access logs and metrics, aggregate performance data, and execute cache purge operations when content updates require immediate invalidation.",
|
|
44260
|
-
descriptionShort: "Configure caching rules and load balancing",
|
|
44260
|
+
descriptionShort: "Configure caching rules and load balancing.",
|
|
44261
44261
|
descriptionMedium: "Define cache rules, TTLs, and path matching. Manage load balancers with origin pools and purge operations.",
|
|
44262
44262
|
aliases: ["cache", "content"],
|
|
44263
44263
|
complexity: "advanced",
|
|
@@ -44271,7 +44271,7 @@ var generatedDomains = /* @__PURE__ */ new Map([
|
|
|
44271
44271
|
name: "ce_management",
|
|
44272
44272
|
displayName: "Ce Management",
|
|
44273
44273
|
description: "Define network connectivity parameters including address allocation ranges, dual-stack protocol support, and isolated administrative ports for out-of-band access. Group physical locations under common policy templates for streamlined oversight. Onboard new deployments through secure credential workflows with expiration policies. Execute controlled software transitions featuring pre-flight validation, rollback capabilities, and progress tracking to maintain service continuity.",
|
|
44274
|
-
descriptionShort: "Manage Customer Edge sites and network interfaces",
|
|
44274
|
+
descriptionShort: "Manage Customer Edge sites and network interfaces.",
|
|
44275
44275
|
descriptionMedium: "Configure DHCP pools, IPv6 addressing, and dedicated management ports. Handle site tokens with lifecycle controls and software version transitions.",
|
|
44276
44276
|
aliases: ["ce-mgmt", "edge-management", "ce-lifecycle"],
|
|
44277
44277
|
complexity: "advanced",
|
|
@@ -44285,7 +44285,7 @@ var generatedDomains = /* @__PURE__ */ new Map([
|
|
|
44285
44285
|
name: "certificates",
|
|
44286
44286
|
displayName: "Certificates",
|
|
44287
44287
|
description: "Create PKI artifacts organizing cryptographic identity materials by namespace for multi-tenant isolation. Deploy keypair bundles with issuer hierarchies for TLS termination. Establish verification anchor collections governing which external parties can authenticate. Maintain deny-lists blocking compromised identities from initiating sessions. Organize resources within independent security boundaries supporting granular access control.",
|
|
44288
|
-
descriptionShort: "Manage SSL/TLS certificate chains and trusted CAs",
|
|
44288
|
+
descriptionShort: "Manage SSL/TLS certificate chains and trusted CAs.",
|
|
44289
44289
|
descriptionMedium: "Configure certificate manifests linking keys to credential bundles. Define trust anchors for validating client authenticity during mutual TLS.",
|
|
44290
44290
|
aliases: ["cert", "certs", "ssl", "tls"],
|
|
44291
44291
|
complexity: "moderate",
|
|
@@ -44299,7 +44299,7 @@ var generatedDomains = /* @__PURE__ */ new Map([
|
|
|
44299
44299
|
name: "cloud_infrastructure",
|
|
44300
44300
|
displayName: "Cloud Infrastructure",
|
|
44301
44301
|
description: "Establish connections to AWS, Azure, and GCP environments with secure authentication and network discovery. Define gateway links, edge site peering, and elastic provisioning workflows. Monitor segment performance and connection health across geographic regions. Create automated VPC attachment policies with intelligent path selection between customer locations and cloud workloads.",
|
|
44302
|
-
descriptionShort: "Connect and manage multi-cloud providers",
|
|
44302
|
+
descriptionShort: "Connect and manage multi-cloud providers.",
|
|
44303
44303
|
descriptionMedium: "Configure cloud provider credentials and VPC attachments. Manage AWS transit gateways, Azure route tables, and cross-cloud connectivity.",
|
|
44304
44304
|
aliases: ["cloud", "infra", "provider"],
|
|
44305
44305
|
complexity: "moderate",
|
|
@@ -44313,7 +44313,7 @@ var generatedDomains = /* @__PURE__ */ new Map([
|
|
|
44313
44313
|
name: "container_services",
|
|
44314
44314
|
displayName: "Container Services",
|
|
44315
44315
|
description: "Create definitions for applications running on distributed infrastructure. Establish standardized templates controlling resource consumption and disk limits. Set up partitioned execution contexts supporting namespace separation and multi-tenant isolation. Track persistent volume claims and usage metrics. Connect with mesh networking for traffic routing.",
|
|
44316
|
-
descriptionShort: "Deploy containerized workloads across sites",
|
|
44316
|
+
descriptionShort: "Deploy containerized workloads across sites.",
|
|
44317
44317
|
descriptionMedium: "Run services with simplified orchestration. Define blueprints governing processor and storage allocation.",
|
|
44318
44318
|
aliases: ["vk8s", "containers", "workloads"],
|
|
44319
44319
|
complexity: "moderate",
|
|
@@ -44327,7 +44327,7 @@ var generatedDomains = /* @__PURE__ */ new Map([
|
|
|
44327
44327
|
name: "data_and_privacy_security",
|
|
44328
44328
|
displayName: "Data And Privacy Security",
|
|
44329
44329
|
description: "Set up sensitive data policies that identify and protect personally identifiable information across traffic flows. Create custom data type definitions matching organizational privacy standards and industry regulations. Configure LMA region parameters including Clickhouse, Elastic, and Kafka integrations. Deploy geo-configurations enforcing data residency rules and regional compliance mandates. Monitor detection status through condition tracking and secret management with blindfold encryption.",
|
|
44330
|
-
descriptionShort: "Configure sensitive data detection and privacy policies",
|
|
44330
|
+
descriptionShort: "Configure sensitive data detection and privacy policies.",
|
|
44331
44331
|
descriptionMedium: "Define custom data types for PII classification. Manage LMA regions and geo-configurations to meet regulatory compliance requirements.",
|
|
44332
44332
|
aliases: ["data-privacy", "pii", "sensitive-data", "lma"],
|
|
44333
44333
|
complexity: "simple",
|
|
@@ -44355,7 +44355,7 @@ var generatedDomains = /* @__PURE__ */ new Map([
|
|
|
44355
44355
|
name: "ddos",
|
|
44356
44356
|
displayName: "Ddos",
|
|
44357
44357
|
description: "Deploy definitions that block IP addresses and network segments from accessing protected resources. Organize by threat type or source classification. Manage secure channels routing suspicious packets for analysis before reaching origin servers. Update status for real-time visibility into active defenses. Add items during attacks and monitor health metrics.",
|
|
44358
|
-
descriptionShort: "Configure blocking policies and tunnel protection",
|
|
44358
|
+
descriptionShort: "Configure blocking policies and tunnel protection.",
|
|
44359
44359
|
descriptionMedium: "Set up firewall configurations with deny list rules. Filter malicious traffic through inspection points.",
|
|
44360
44360
|
aliases: ["dos", "ddos-protect"],
|
|
44361
44361
|
complexity: "advanced",
|
|
@@ -44369,7 +44369,7 @@ var generatedDomains = /* @__PURE__ */ new Map([
|
|
|
44369
44369
|
name: "dns",
|
|
44370
44370
|
displayName: "Dns",
|
|
44371
44371
|
description: "Set up primary and secondary zones with support for A, AAAA, CNAME, CAA, CERT, and AFSDB record types. Define health checks to monitor target availability and enable automatic failover between record destinations. Clone existing domains, import zone configurations from external servers, or export zone files for backup. Track query metrics and request logs to analyze resolution patterns across namespaces.",
|
|
44372
|
-
descriptionShort: "Manage zones, records, and load balancing",
|
|
44372
|
+
descriptionShort: "Manage zones, records, and load balancing.",
|
|
44373
44373
|
descriptionMedium: "Configure authoritative name services with record sets and health checks. Import zones from BIND files or transfer via AXFR protocol.",
|
|
44374
44374
|
aliases: ["dns-zone", "zones"],
|
|
44375
44375
|
complexity: "advanced",
|
|
@@ -44433,7 +44433,7 @@ var generatedDomains = /* @__PURE__ */ new Map([
|
|
|
44433
44433
|
name: "generative_ai",
|
|
44434
44434
|
displayName: "Generative Ai",
|
|
44435
44435
|
description: "Set up query evaluation and response handling for intelligent assistant workflows. Manage rating collection with positive and negative outcome tracking. Subscribe to data streams for traffic pattern detection and behavioral analysis. Allocate and deallocate IP resources for ML infrastructure. Control feature enablement and token management for telemetry collection paths.",
|
|
44436
|
-
descriptionShort: "Access AI assistant queries and feedback",
|
|
44436
|
+
descriptionShort: "Access AI assistant queries and feedback.",
|
|
44437
44437
|
descriptionMedium: "Configure machine learning interactions and collect response ratings. Enable flow pattern monitoring through data subscription channels.",
|
|
44438
44438
|
aliases: ["ai", "genai", "assistant"],
|
|
44439
44439
|
complexity: "simple",
|
|
@@ -44447,7 +44447,7 @@ var generatedDomains = /* @__PURE__ */ new Map([
|
|
|
44447
44447
|
name: "managed_kubernetes",
|
|
44448
44448
|
displayName: "Managed Kubernetes",
|
|
44449
44449
|
description: "Create granular access controls for namespace resources and non-resource URLs. Map permissions to users, groups, or service accounts through binding configurations. Deploy security admission enforcement using baseline, restricted, or privileged profiles. Register private image sources with credential management for secure pulls. Integrate with external managed solutions including EKS, AKS, and GKE infrastructure.",
|
|
44450
|
-
descriptionShort: "Configure Kubernetes RBAC and pod security policies",
|
|
44450
|
+
descriptionShort: "Configure Kubernetes RBAC and pod security policies.",
|
|
44451
44451
|
descriptionMedium: "Define permission boundaries for workload access. Set up private image repositories with authentication for enterprise deployments.",
|
|
44452
44452
|
aliases: ["mk8s", "appstack", "k8s-mgmt"],
|
|
44453
44453
|
complexity: "moderate",
|
|
@@ -44461,7 +44461,7 @@ var generatedDomains = /* @__PURE__ */ new Map([
|
|
|
44461
44461
|
name: "marketplace",
|
|
44462
44462
|
displayName: "Marketplace",
|
|
44463
44463
|
description: "Set up secure tunnel connections using IKEv1/IKEv2 parameters, GRE encapsulation with source and destination addressing, or dedicated link types. Manage DPD keep-alive timers and tunnel termination points for reliable connectivity. Activate purchasable services with namespace-scoped status tracking. Create custom portal widgets for interface integration and configure Cloud Manager instances for Terraform and infrastructure automation workflows.",
|
|
44464
|
-
descriptionShort: "Manage third-party integrations and add-ons",
|
|
44464
|
+
descriptionShort: "Manage third-party integrations and add-ons.",
|
|
44465
44465
|
descriptionMedium: "Configure connector tunnels with IPSec, GRE, or direct links. Deploy purchasable services and portal customizations across namespaces.",
|
|
44466
44466
|
aliases: ["market", "addons", "extensions"],
|
|
44467
44467
|
complexity: "moderate",
|
|
@@ -44475,7 +44475,7 @@ var generatedDomains = /* @__PURE__ */ new Map([
|
|
|
44475
44475
|
name: "network",
|
|
44476
44476
|
displayName: "Network",
|
|
44477
44477
|
description: "Deploy secure site connectivity using IPsec tunnels with customizable IKE phase settings, encryption algorithms, and DH groups. Configure BGP routing with peer state monitoring, ASN management, and traffic policies. Set up SRv6 segments, IP prefix sets, and subnet definitions. Manage DC cluster groups for data center integration and define routes for traffic steering across distributed infrastructure.",
|
|
44478
|
-
descriptionShort: "Configure BGP routing, tunnels, and connectivity",
|
|
44478
|
+
descriptionShort: "Configure BGP routing, tunnels, and connectivity.",
|
|
44479
44479
|
descriptionMedium: "Manage IPsec tunnels and IKE configurations. Define BGP peers, ASN assignments, and routing policies for site-to-site connections.",
|
|
44480
44480
|
aliases: ["net", "routing", "bgp"],
|
|
44481
44481
|
complexity: "advanced",
|
|
@@ -44489,7 +44489,7 @@ var generatedDomains = /* @__PURE__ */ new Map([
|
|
|
44489
44489
|
name: "network_security",
|
|
44490
44490
|
displayName: "Network Security",
|
|
44491
44491
|
description: "Manage firewall configurations with match criteria and action rules. Create NAT policies using dynamic pools and port configurations for address translation. Define segment connections to isolate traffic between network zones. Configure policy-based routing to direct packets based on source, destination, or protocol attributes. Set up forward proxy policies and access control lists to govern outbound connections.",
|
|
44492
|
-
descriptionShort: "Configure firewalls, NAT, and routing policies",
|
|
44492
|
+
descriptionShort: "Configure firewalls, NAT, and routing policies.",
|
|
44493
44493
|
descriptionMedium: "Define network firewall rules and NAT policies. Set up policy-based routing with segment connections for traffic control.",
|
|
44494
44494
|
aliases: ["netsec", "nfw"],
|
|
44495
44495
|
complexity: "advanced",
|
|
@@ -44503,7 +44503,7 @@ var generatedDomains = /* @__PURE__ */ new Map([
|
|
|
44503
44503
|
name: "nginx_one",
|
|
44504
44504
|
displayName: "Nginx One",
|
|
44505
44505
|
description: "Set up load balancing configurations with backend server definitions and routing logic. Create monitoring schedules for availability tracking across distributed nodes. Build request handling pipelines with rate controls and authentication layers. Track instance performance metrics and traffic patterns. Coordinate failover mechanisms using weighted distribution and priority-based selection.",
|
|
44506
|
-
descriptionShort: "Configure NGINX proxy instances and deployments",
|
|
44506
|
+
descriptionShort: "Configure NGINX proxy instances and deployments.",
|
|
44507
44507
|
descriptionMedium: "Manage upstream server pools and health monitors. Define SSL termination rules and connection parameters for gateway endpoints.",
|
|
44508
44508
|
aliases: ["nginx", "nms", "nginx-plus"],
|
|
44509
44509
|
complexity: "simple",
|
|
@@ -44517,7 +44517,7 @@ var generatedDomains = /* @__PURE__ */ new Map([
|
|
|
44517
44517
|
name: "object_storage",
|
|
44518
44518
|
displayName: "Object Storage",
|
|
44519
44519
|
description: "Deploy binary artifacts and configuration bundles with automatic version tracking and lifecycle policies. Organize content by category including protection signatures, SDK packages, and third-party connector files. Enable time-limited download links for secure distribution without credential exposure. Track revision history for audit trails and support rollback to previous artifact versions when needed.",
|
|
44520
|
-
descriptionShort: "Manage stored objects and bucket versioning",
|
|
44520
|
+
descriptionShort: "Manage stored objects and bucket versioning.",
|
|
44521
44521
|
descriptionMedium: "Create versioned content within tenant buckets. Generate secure access URLs for SDK distributions and application protection resources.",
|
|
44522
44522
|
aliases: ["storage", "s3", "buckets"],
|
|
44523
44523
|
complexity: "simple",
|
|
@@ -44531,7 +44531,7 @@ var generatedDomains = /* @__PURE__ */ new Map([
|
|
|
44531
44531
|
name: "observability",
|
|
44532
44532
|
displayName: "Observability",
|
|
44533
44533
|
description: "Set up synthetic monitoring for DNS resolution and HTTP services across AWS regions. Generate health reports with historical trends and summary dashboards. Monitor certificate validity, track response times, and aggregate results by namespace for capacity planning.",
|
|
44534
|
-
descriptionShort: "Configure synthetic monitors and health checks",
|
|
44534
|
+
descriptionShort: "Configure synthetic monitors and health checks.",
|
|
44535
44535
|
descriptionMedium: "Define DNS and HTTP monitors with regional testing. Track certificate expiration and service availability across zones.",
|
|
44536
44536
|
aliases: ["obs", "monitoring", "synth"],
|
|
44537
44537
|
complexity: "advanced",
|
|
@@ -44545,7 +44545,7 @@ var generatedDomains = /* @__PURE__ */ new Map([
|
|
|
44545
44545
|
name: "rate_limiting",
|
|
44546
44546
|
displayName: "Rate Limiting",
|
|
44547
44547
|
description: "Create rate limiter policies with configurable time periods using seconds, minutes, or hours granularity. Deploy policers and protocol policers to enforce bandwidth constraints across namespaces. Define limit values, burst allowances, and blocking behaviors when thresholds trigger. Integrate with load balancers and security policies for layered traffic management and abuse prevention.",
|
|
44548
|
-
descriptionShort: "Configure traffic throttling and policer rules",
|
|
44548
|
+
descriptionShort: "Configure traffic throttling and policer rules.",
|
|
44549
44549
|
descriptionMedium: "Define request limits and burst thresholds for traffic control. Set up leaky bucket algorithms and block actions for exceeded quotas.",
|
|
44550
44550
|
aliases: ["ratelimit", "throttle", "policer"],
|
|
44551
44551
|
complexity: "simple",
|
|
@@ -44559,7 +44559,7 @@ var generatedDomains = /* @__PURE__ */ new Map([
|
|
|
44559
44559
|
name: "secops_and_incident_response",
|
|
44560
44560
|
displayName: "Secops And Incident Response",
|
|
44561
44561
|
description: "Manage incident response workflows that detect and mitigate malicious users automatically. Create rules matching threat levels to actions like blocking, rate limiting, or alerting. Set up mitigation policies per namespace to isolate security responses. Define thresholds for user behavior analysis and configure graduated responses based on severity. Integrate with bot defense and WAF systems for coordinated protection across application layers.",
|
|
44562
|
-
descriptionShort: "Configure automated threat mitigation rules",
|
|
44562
|
+
descriptionShort: "Configure automated threat mitigation rules.",
|
|
44563
44563
|
descriptionMedium: "Define malicious user detection policies and response actions. Apply blocking or rate limiting based on threat levels.",
|
|
44564
44564
|
aliases: ["secops", "incident-response", "mitigation"],
|
|
44565
44565
|
complexity: "simple",
|
|
@@ -44573,7 +44573,7 @@ var generatedDomains = /* @__PURE__ */ new Map([
|
|
|
44573
44573
|
name: "service_mesh",
|
|
44574
44574
|
displayName: "Service Mesh",
|
|
44575
44575
|
description: "Create classifications to organize services and support automatic identification of interconnected components. Set up analysis pipelines to understand patterns and build intelligent routing rules. Define network function virtualization for regional architectures. Configure authentication settings including location, state, and type recognition.",
|
|
44576
|
-
descriptionShort: "Configure application types and discovery",
|
|
44576
|
+
descriptionShort: "Configure application types and discovery.",
|
|
44577
44577
|
descriptionMedium: "Manage NFV integrations and workload categories. Enable traffic learning across distributed deployments.",
|
|
44578
44578
|
aliases: ["mesh", "svc-mesh"],
|
|
44579
44579
|
complexity: "advanced",
|
|
@@ -44587,7 +44587,7 @@ var generatedDomains = /* @__PURE__ */ new Map([
|
|
|
44587
44587
|
name: "shape",
|
|
44588
44588
|
displayName: "Shape",
|
|
44589
44589
|
description: "Set up bot defense infrastructure across namespaces with deployment tracking and status monitoring. Integrate mobile SDK attributes for app shielding and device recognition. Subscribe to threat intelligence services for real-time protection updates. Define cluster states and location-based policies for distributed bot mitigation. Track deployment history and manage policy configurations through centralized infrastructure objects.",
|
|
44590
|
-
descriptionShort: "Configure bot defense and threat prevention",
|
|
44590
|
+
descriptionShort: "Configure bot defense and threat prevention.",
|
|
44591
44591
|
descriptionMedium: "Deploy bot infrastructure with mobile SDK integration. Manage subscription services and policy enforcement for automated threat protection.",
|
|
44592
44592
|
aliases: ["shape-sec", "safeap"],
|
|
44593
44593
|
complexity: "advanced",
|
|
@@ -44601,7 +44601,7 @@ var generatedDomains = /* @__PURE__ */ new Map([
|
|
|
44601
44601
|
name: "sites",
|
|
44602
44602
|
displayName: "Sites",
|
|
44603
44603
|
description: "Deploy edge nodes across AWS, Azure, and GCP with automated provisioning. Configure VPC peering, transit gateway attachments, and VPN tunnel settings. Define virtual groupings with label selectors for policy targeting. Manage Kubernetes cluster integrations and secure mesh deployments. Monitor node health, validate configurations, and set IP prefix allocations.",
|
|
44604
|
-
descriptionShort: "Deploy edge nodes across cloud providers",
|
|
44604
|
+
descriptionShort: "Deploy edge nodes across cloud providers.",
|
|
44605
44605
|
descriptionMedium: "Configure AWS, Azure, GCP deployments with VPC integration. Manage transit gateways and VPN tunnels.",
|
|
44606
44606
|
aliases: ["site", "deployment"],
|
|
44607
44607
|
complexity: "advanced",
|
|
@@ -44667,7 +44667,7 @@ var generatedDomains = /* @__PURE__ */ new Map([
|
|
|
44667
44667
|
name: "statistics",
|
|
44668
44668
|
displayName: "Statistics",
|
|
44669
44669
|
description: "Set up alert policies with custom matchers, label filters, and group-by rules for targeted notifications. Define routing channels via email, webhook, or integration receivers with confirmation and verification workflows. Access flow analytics, historical alert data, and namespace-scoped metrics. Build capacity planning graphs and operational summaries. Observe deployment health and service discovery mapping across distributed environments.",
|
|
44670
|
-
descriptionShort: "Monitor alerts, logs, and flow analytics",
|
|
44670
|
+
descriptionShort: "Monitor alerts, logs, and flow analytics.",
|
|
44671
44671
|
descriptionMedium: "Configure alerting policies and notification receivers. Track service topology, build dashboards, and view site health summaries.",
|
|
44672
44672
|
aliases: ["stats", "metrics", "logs"],
|
|
44673
44673
|
complexity: "advanced",
|
|
@@ -44681,7 +44681,7 @@ var generatedDomains = /* @__PURE__ */ new Map([
|
|
|
44681
44681
|
name: "support",
|
|
44682
44682
|
displayName: "Support",
|
|
44683
44683
|
description: "Open new cases and assign severity ratings based on business impact. Append notes throughout resolution workflows. Mark items as closed or reinstate them if symptoms recur. Execute diagnostic packet captures on deployed sites for network troubleshooting. Handle tax exemption verification through certificate submission.",
|
|
44684
|
-
descriptionShort: "Create and track customer tickets",
|
|
44684
|
+
descriptionShort: "Create and track customer tickets.",
|
|
44685
44685
|
descriptionMedium: "Submit requests with file uploads and priority levels. Add comments and escalate critical incidents to engineering teams.",
|
|
44686
44686
|
aliases: ["tickets", "help-desk"],
|
|
44687
44687
|
complexity: "moderate",
|
|
@@ -44709,7 +44709,7 @@ var generatedDomains = /* @__PURE__ */ new Map([
|
|
|
44709
44709
|
name: "tenant_and_identity",
|
|
44710
44710
|
displayName: "Tenant And Identity",
|
|
44711
44711
|
description: "Set up granular alert routing for administrative and combined channels with personalized delivery options. Control active login sessions and enforce one-time password resets for security compliance. Define display layouts and avatar images for customized user experiences. Process onboarding access submissions and toggle account management features. Coordinate support ticket attachments and client relationship interactions across managed tenant hierarchies.",
|
|
44712
|
-
descriptionShort: "Manage user profiles and session controls",
|
|
44712
|
+
descriptionShort: "Manage user profiles and session controls.",
|
|
44713
44713
|
descriptionMedium: "Configure OTP resets and admin alert channels. Handle view settings and profile customization for platform participants.",
|
|
44714
44714
|
aliases: ["tenant-identity", "idm", "user-settings"],
|
|
44715
44715
|
complexity: "advanced",
|
|
@@ -44737,7 +44737,7 @@ var generatedDomains = /* @__PURE__ */ new Map([
|
|
|
44737
44737
|
name: "users",
|
|
44738
44738
|
displayName: "Users",
|
|
44739
44739
|
description: "Deploy namespace-scoped access credentials with lifecycle state tracking for secure machine enrollment. Build hierarchical tagging frameworks that enable systematic organization of infrastructure elements. Retrieve automated provisioning payloads for streamlined node initialization. Enable system-level automatic tagging that applies predefined metadata to newly created objects without operator action.",
|
|
44740
|
-
descriptionShort: "Manage account tokens and label settings",
|
|
44740
|
+
descriptionShort: "Manage account tokens and label settings.",
|
|
44741
44741
|
descriptionMedium: "Configure credential issuance and cloud-init provisioning. Establish key-value taxonomies for consistent resource categorization across deployments.",
|
|
44742
44742
|
aliases: ["user", "accounts", "iam"],
|
|
44743
44743
|
complexity: "simple",
|
|
@@ -44751,7 +44751,7 @@ var generatedDomains = /* @__PURE__ */ new Map([
|
|
|
44751
44751
|
name: "virtual",
|
|
44752
44752
|
displayName: "Virtual",
|
|
44753
44753
|
description: "Deploy load balancers across protocols with origin pool management and service discovery. Set up geo-location routing to direct traffic based on client location. Define rate limiter policies to control request volume and protect services from abuse. Configure health checks for origin monitoring and automatic failover. Manage service policies for access control and traffic filtering. Enable malware protection and threat campaign blocking for security enforcement.",
|
|
44754
|
-
descriptionShort: "Configure load balancers and origin pools",
|
|
44754
|
+
descriptionShort: "Configure load balancers and origin pools.",
|
|
44755
44755
|
descriptionMedium: "Create HTTP, TCP, and UDP load balancers with origin pools. Define routing rules, health checks, and rate limiting policies.",
|
|
44756
44756
|
aliases: ["lb", "loadbalancer", "vhost"],
|
|
44757
44757
|
complexity: "advanced",
|
|
@@ -44831,7 +44831,7 @@ var generatedDomains = /* @__PURE__ */ new Map([
|
|
|
44831
44831
|
name: "waf",
|
|
44832
44832
|
displayName: "Waf",
|
|
44833
44833
|
description: "Set up firewall configurations with attack type settings and violation detection. Create exclusion policies to tune false positives and customize blocking responses. Deploy staged signatures before production release and monitor rule hits through security event metrics. Integrate with virtual hosts for layered protection using AI-based risk blocking and anonymization settings for sensitive data handling.",
|
|
44834
|
-
descriptionShort: "Configure application firewall rules and bot protection",
|
|
44834
|
+
descriptionShort: "Configure application firewall rules and bot protection.",
|
|
44835
44835
|
descriptionMedium: "Define security policies for web applications. Manage attack signatures, exclusion rules, and threat detection settings.",
|
|
44836
44836
|
aliases: ["firewall", "appfw"],
|
|
44837
44837
|
complexity: "advanced",
|
|
@@ -45354,8 +45354,8 @@ function getLogoModeFromEnv(envPrefix) {
|
|
|
45354
45354
|
var CLI_NAME = "xcsh";
|
|
45355
45355
|
var CLI_FULL_NAME = "F5 Distributed Cloud Shell";
|
|
45356
45356
|
function getVersion() {
|
|
45357
|
-
if ("6.
|
|
45358
|
-
return "6.
|
|
45357
|
+
if ("6.39.0") {
|
|
45358
|
+
return "6.39.0";
|
|
45359
45359
|
}
|
|
45360
45360
|
if (process.env.XCSH_VERSION) {
|
|
45361
45361
|
return process.env.XCSH_VERSION;
|
|
@@ -46024,6 +46024,728 @@ var APIClient = class {
|
|
|
46024
46024
|
}
|
|
46025
46025
|
};
|
|
46026
46026
|
|
|
46027
|
+
// src/output/formatter.ts
|
|
46028
|
+
var import_yaml2 = __toESM(require_dist(), 1);
|
|
46029
|
+
|
|
46030
|
+
// src/output/types.ts
|
|
46031
|
+
var DEFAULT_TABLE_STYLE = {
|
|
46032
|
+
unicode: true,
|
|
46033
|
+
coloredBorders: true,
|
|
46034
|
+
headerStyle: "bold"
|
|
46035
|
+
};
|
|
46036
|
+
var PLAIN_TABLE_STYLE = {
|
|
46037
|
+
unicode: false,
|
|
46038
|
+
coloredBorders: false,
|
|
46039
|
+
headerStyle: "normal"
|
|
46040
|
+
};
|
|
46041
|
+
function isValidOutputFormat(format) {
|
|
46042
|
+
return ["json", "yaml", "table", "text", "tsv", "none", "spec"].includes(
|
|
46043
|
+
format.toLowerCase()
|
|
46044
|
+
);
|
|
46045
|
+
}
|
|
46046
|
+
|
|
46047
|
+
// src/output/resolver.ts
|
|
46048
|
+
var OUTPUT_FORMAT_ENV_VAR = `${ENV_PREFIX}_OUTPUT_FORMAT`;
|
|
46049
|
+
function getOutputFormatFromEnv() {
|
|
46050
|
+
const envValue = process.env[OUTPUT_FORMAT_ENV_VAR]?.toLowerCase().trim();
|
|
46051
|
+
if (envValue && isValidOutputFormat(envValue)) {
|
|
46052
|
+
return envValue;
|
|
46053
|
+
}
|
|
46054
|
+
return void 0;
|
|
46055
|
+
}
|
|
46056
|
+
function shouldUseColors(isTTY = process.stdout.isTTY ?? false, noColorFlag = false) {
|
|
46057
|
+
if (noColorFlag) {
|
|
46058
|
+
return false;
|
|
46059
|
+
}
|
|
46060
|
+
if (process.env.NO_COLOR !== void 0) {
|
|
46061
|
+
return false;
|
|
46062
|
+
}
|
|
46063
|
+
if (process.env.FORCE_COLOR !== void 0) {
|
|
46064
|
+
return true;
|
|
46065
|
+
}
|
|
46066
|
+
return isTTY;
|
|
46067
|
+
}
|
|
46068
|
+
|
|
46069
|
+
// src/output/table.ts
|
|
46070
|
+
var UNICODE_BOX = {
|
|
46071
|
+
topLeft: "\u256D",
|
|
46072
|
+
// ╭
|
|
46073
|
+
topRight: "\u256E",
|
|
46074
|
+
// ╮
|
|
46075
|
+
bottomLeft: "\u2570",
|
|
46076
|
+
// ╰
|
|
46077
|
+
bottomRight: "\u256F",
|
|
46078
|
+
// ╯
|
|
46079
|
+
horizontal: "\u2500",
|
|
46080
|
+
// ─
|
|
46081
|
+
vertical: "\u2502",
|
|
46082
|
+
// │
|
|
46083
|
+
leftT: "\u251C",
|
|
46084
|
+
// ├
|
|
46085
|
+
rightT: "\u2524",
|
|
46086
|
+
// ┤
|
|
46087
|
+
topT: "\u252C",
|
|
46088
|
+
// ┬
|
|
46089
|
+
bottomT: "\u2534",
|
|
46090
|
+
// ┴
|
|
46091
|
+
cross: "\u253C"
|
|
46092
|
+
// ┼
|
|
46093
|
+
};
|
|
46094
|
+
var ASCII_BOX = {
|
|
46095
|
+
topLeft: "+",
|
|
46096
|
+
topRight: "+",
|
|
46097
|
+
bottomLeft: "+",
|
|
46098
|
+
bottomRight: "+",
|
|
46099
|
+
horizontal: "-",
|
|
46100
|
+
vertical: "|",
|
|
46101
|
+
leftT: "+",
|
|
46102
|
+
rightT: "+",
|
|
46103
|
+
topT: "+",
|
|
46104
|
+
bottomT: "+",
|
|
46105
|
+
cross: "+"
|
|
46106
|
+
};
|
|
46107
|
+
function getBoxCharacters(style) {
|
|
46108
|
+
return style.unicode ? UNICODE_BOX : ASCII_BOX;
|
|
46109
|
+
}
|
|
46110
|
+
function applyColor(text, color, useColors) {
|
|
46111
|
+
if (!useColors) {
|
|
46112
|
+
return text;
|
|
46113
|
+
}
|
|
46114
|
+
return `${color}${text}${colors.reset}`;
|
|
46115
|
+
}
|
|
46116
|
+
function wrapText2(text, maxWidth) {
|
|
46117
|
+
if (text.length <= maxWidth) {
|
|
46118
|
+
return [text];
|
|
46119
|
+
}
|
|
46120
|
+
const lines = [];
|
|
46121
|
+
let remaining = text;
|
|
46122
|
+
while (remaining.length > 0) {
|
|
46123
|
+
if (remaining.length <= maxWidth) {
|
|
46124
|
+
lines.push(remaining);
|
|
46125
|
+
break;
|
|
46126
|
+
}
|
|
46127
|
+
let breakPoint = maxWidth;
|
|
46128
|
+
for (let i = maxWidth - 1; i > 0; i--) {
|
|
46129
|
+
if (remaining[i] === " ") {
|
|
46130
|
+
breakPoint = i;
|
|
46131
|
+
break;
|
|
46132
|
+
}
|
|
46133
|
+
}
|
|
46134
|
+
lines.push(remaining.slice(0, breakPoint));
|
|
46135
|
+
remaining = remaining.slice(breakPoint).trimStart();
|
|
46136
|
+
}
|
|
46137
|
+
return lines;
|
|
46138
|
+
}
|
|
46139
|
+
function getValue(row, accessor) {
|
|
46140
|
+
if (typeof accessor === "function") {
|
|
46141
|
+
return accessor(row);
|
|
46142
|
+
}
|
|
46143
|
+
const value = row[accessor];
|
|
46144
|
+
if (value === null || value === void 0) {
|
|
46145
|
+
return "";
|
|
46146
|
+
}
|
|
46147
|
+
if (typeof value === "object") {
|
|
46148
|
+
if (accessor === "labels") {
|
|
46149
|
+
return formatLabelsValue(value);
|
|
46150
|
+
}
|
|
46151
|
+
return JSON.stringify(value);
|
|
46152
|
+
}
|
|
46153
|
+
return String(value);
|
|
46154
|
+
}
|
|
46155
|
+
function formatLabelsValue(labels) {
|
|
46156
|
+
const entries = Object.entries(labels).sort(([a], [b]) => a.localeCompare(b)).map(([k, v]) => `${k}:${v}`);
|
|
46157
|
+
if (entries.length === 0) {
|
|
46158
|
+
return "";
|
|
46159
|
+
}
|
|
46160
|
+
return `map[${entries.join(" ")}]`;
|
|
46161
|
+
}
|
|
46162
|
+
function calculateColumnWidths(columns, rows, maxTableWidth) {
|
|
46163
|
+
const widths = columns.map((col) => {
|
|
46164
|
+
let width = col.header.length;
|
|
46165
|
+
for (const row of rows) {
|
|
46166
|
+
const value = getValue(row, col.accessor);
|
|
46167
|
+
width = Math.max(width, value.length);
|
|
46168
|
+
}
|
|
46169
|
+
if (col.minWidth) {
|
|
46170
|
+
width = Math.max(width, col.minWidth);
|
|
46171
|
+
}
|
|
46172
|
+
if (col.maxWidth) {
|
|
46173
|
+
width = Math.min(width, col.maxWidth);
|
|
46174
|
+
}
|
|
46175
|
+
if (col.width) {
|
|
46176
|
+
width = col.width;
|
|
46177
|
+
}
|
|
46178
|
+
return width;
|
|
46179
|
+
});
|
|
46180
|
+
if (maxTableWidth) {
|
|
46181
|
+
const totalWidth = widths.reduce((a, b) => a + b, 0) + columns.length * 3 + 1;
|
|
46182
|
+
if (totalWidth > maxTableWidth) {
|
|
46183
|
+
const ratio = (maxTableWidth - columns.length * 3 - 1) / totalWidth;
|
|
46184
|
+
for (let i = 0; i < widths.length; i++) {
|
|
46185
|
+
widths[i] = Math.max(5, Math.floor(widths[i] * ratio));
|
|
46186
|
+
}
|
|
46187
|
+
}
|
|
46188
|
+
}
|
|
46189
|
+
return widths;
|
|
46190
|
+
}
|
|
46191
|
+
function formatBeautifulTable(data, config, noColor = false) {
|
|
46192
|
+
if (data.length === 0) {
|
|
46193
|
+
return "";
|
|
46194
|
+
}
|
|
46195
|
+
const useColors = shouldUseColors(void 0, noColor);
|
|
46196
|
+
const style = useColors ? config.style ?? DEFAULT_TABLE_STYLE : PLAIN_TABLE_STYLE;
|
|
46197
|
+
const box = getBoxCharacters(style);
|
|
46198
|
+
const borderColor = style.borderColor ?? colors.red;
|
|
46199
|
+
const widths = calculateColumnWidths(config.columns, data, config.maxWidth);
|
|
46200
|
+
const lines = [];
|
|
46201
|
+
const colorBorder = (text) => applyColor(text, borderColor, useColors && style.coloredBorders);
|
|
46202
|
+
const buildHorizontalLine = (left, mid, right, fill) => {
|
|
46203
|
+
const segments = widths.map((w) => fill.repeat(w + 2));
|
|
46204
|
+
return colorBorder(left + segments.join(mid) + right);
|
|
46205
|
+
};
|
|
46206
|
+
if (config.title) {
|
|
46207
|
+
const title = ` ${config.title} `;
|
|
46208
|
+
const totalWidth = widths.reduce((a, b) => a + b, 0) + widths.length * 3 - 1;
|
|
46209
|
+
const remainingWidth = totalWidth - title.length;
|
|
46210
|
+
const leftDashes = 1;
|
|
46211
|
+
const rightDashes = Math.max(0, remainingWidth - leftDashes);
|
|
46212
|
+
lines.push(
|
|
46213
|
+
colorBorder(box.topLeft + box.horizontal.repeat(leftDashes)) + title + colorBorder(box.horizontal.repeat(rightDashes) + box.topRight)
|
|
46214
|
+
);
|
|
46215
|
+
} else {
|
|
46216
|
+
lines.push(
|
|
46217
|
+
buildHorizontalLine(
|
|
46218
|
+
box.topLeft,
|
|
46219
|
+
box.topT,
|
|
46220
|
+
box.topRight,
|
|
46221
|
+
box.horizontal
|
|
46222
|
+
)
|
|
46223
|
+
);
|
|
46224
|
+
}
|
|
46225
|
+
const headerCells = config.columns.map((col, i) => {
|
|
46226
|
+
const padding = widths[i] - col.header.length;
|
|
46227
|
+
const leftPad = Math.floor(padding / 2);
|
|
46228
|
+
const rightPad = padding - leftPad;
|
|
46229
|
+
const content = " ".repeat(leftPad) + col.header + " ".repeat(rightPad);
|
|
46230
|
+
return ` ${content} `;
|
|
46231
|
+
});
|
|
46232
|
+
lines.push(
|
|
46233
|
+
colorBorder(box.vertical) + headerCells.join(colorBorder(box.vertical)) + colorBorder(box.vertical)
|
|
46234
|
+
);
|
|
46235
|
+
lines.push(
|
|
46236
|
+
buildHorizontalLine(box.leftT, box.cross, box.rightT, box.horizontal)
|
|
46237
|
+
);
|
|
46238
|
+
for (let rowIndex = 0; rowIndex < data.length; rowIndex++) {
|
|
46239
|
+
const row = data[rowIndex];
|
|
46240
|
+
const cellValues = config.columns.map((col, i) => {
|
|
46241
|
+
const value = getValue(row, col.accessor) || "<None>";
|
|
46242
|
+
return config.wrapText !== false ? wrapText2(value, widths[i]) : [value.slice(0, widths[i])];
|
|
46243
|
+
});
|
|
46244
|
+
const maxLines = Math.max(...cellValues.map((c) => c.length));
|
|
46245
|
+
for (let lineIndex = 0; lineIndex < maxLines; lineIndex++) {
|
|
46246
|
+
const cells = cellValues.map((cellLines, i) => {
|
|
46247
|
+
const text = cellLines[lineIndex] ?? "";
|
|
46248
|
+
const padding = widths[i] - text.length;
|
|
46249
|
+
const align = config.columns[i]?.align ?? "left";
|
|
46250
|
+
let content;
|
|
46251
|
+
if (align === "center") {
|
|
46252
|
+
const leftPad = Math.floor(padding / 2);
|
|
46253
|
+
const rightPad = padding - leftPad;
|
|
46254
|
+
content = " ".repeat(leftPad) + text + " ".repeat(rightPad);
|
|
46255
|
+
} else if (align === "right") {
|
|
46256
|
+
content = " ".repeat(padding) + text;
|
|
46257
|
+
} else {
|
|
46258
|
+
content = text + " ".repeat(padding);
|
|
46259
|
+
}
|
|
46260
|
+
return ` ${content} `;
|
|
46261
|
+
});
|
|
46262
|
+
lines.push(
|
|
46263
|
+
colorBorder(box.vertical) + cells.join(colorBorder(box.vertical)) + colorBorder(box.vertical)
|
|
46264
|
+
);
|
|
46265
|
+
}
|
|
46266
|
+
if (rowIndex < data.length - 1 && config.rowSeparators) {
|
|
46267
|
+
lines.push(
|
|
46268
|
+
buildHorizontalLine(
|
|
46269
|
+
box.leftT,
|
|
46270
|
+
box.cross,
|
|
46271
|
+
box.rightT,
|
|
46272
|
+
box.horizontal
|
|
46273
|
+
)
|
|
46274
|
+
);
|
|
46275
|
+
}
|
|
46276
|
+
}
|
|
46277
|
+
lines.push(
|
|
46278
|
+
buildHorizontalLine(
|
|
46279
|
+
box.bottomLeft,
|
|
46280
|
+
box.bottomT,
|
|
46281
|
+
box.bottomRight,
|
|
46282
|
+
box.horizontal
|
|
46283
|
+
)
|
|
46284
|
+
);
|
|
46285
|
+
return lines.join("\n");
|
|
46286
|
+
}
|
|
46287
|
+
var DEFAULT_RESOURCE_COLUMNS = [
|
|
46288
|
+
{ header: "NAMESPACE", accessor: "namespace", minWidth: 9 },
|
|
46289
|
+
{ header: "NAME", accessor: "name", minWidth: 10, maxWidth: 40 },
|
|
46290
|
+
{ header: "LABELS", accessor: "labels", minWidth: 10, maxWidth: 35 }
|
|
46291
|
+
];
|
|
46292
|
+
function formatResourceTable(data, noColor = false) {
|
|
46293
|
+
const items = extractItems(data);
|
|
46294
|
+
if (items.length === 0) {
|
|
46295
|
+
return "";
|
|
46296
|
+
}
|
|
46297
|
+
return formatBeautifulTable(
|
|
46298
|
+
items,
|
|
46299
|
+
{
|
|
46300
|
+
columns: DEFAULT_RESOURCE_COLUMNS,
|
|
46301
|
+
wrapText: true
|
|
46302
|
+
},
|
|
46303
|
+
noColor
|
|
46304
|
+
);
|
|
46305
|
+
}
|
|
46306
|
+
function extractItems(data) {
|
|
46307
|
+
if (data && typeof data === "object" && "items" in data) {
|
|
46308
|
+
const items = data.items;
|
|
46309
|
+
if (Array.isArray(items)) {
|
|
46310
|
+
return items.filter(
|
|
46311
|
+
(item) => item !== null && typeof item === "object"
|
|
46312
|
+
);
|
|
46313
|
+
}
|
|
46314
|
+
}
|
|
46315
|
+
if (Array.isArray(data)) {
|
|
46316
|
+
return data.filter(
|
|
46317
|
+
(item) => item !== null && typeof item === "object"
|
|
46318
|
+
);
|
|
46319
|
+
}
|
|
46320
|
+
if (data && typeof data === "object") {
|
|
46321
|
+
return [data];
|
|
46322
|
+
}
|
|
46323
|
+
return [];
|
|
46324
|
+
}
|
|
46325
|
+
|
|
46326
|
+
// src/output/formatter.ts
|
|
46327
|
+
function formatOutput(data, format = "table", noColor = false) {
|
|
46328
|
+
if (format === "none") {
|
|
46329
|
+
return "";
|
|
46330
|
+
}
|
|
46331
|
+
const useNoColor = noColor || !shouldUseColors();
|
|
46332
|
+
switch (format) {
|
|
46333
|
+
case "json":
|
|
46334
|
+
return formatJSON(data);
|
|
46335
|
+
case "yaml":
|
|
46336
|
+
return formatYAML(data);
|
|
46337
|
+
case "table":
|
|
46338
|
+
case "text":
|
|
46339
|
+
return formatTable(data, useNoColor);
|
|
46340
|
+
case "tsv":
|
|
46341
|
+
return formatTSV(data);
|
|
46342
|
+
case "spec":
|
|
46343
|
+
return formatJSON(data);
|
|
46344
|
+
default:
|
|
46345
|
+
return formatTable(data, useNoColor);
|
|
46346
|
+
}
|
|
46347
|
+
}
|
|
46348
|
+
function formatJSON(data) {
|
|
46349
|
+
return JSON.stringify(data, null, 2);
|
|
46350
|
+
}
|
|
46351
|
+
function formatYAML(data) {
|
|
46352
|
+
return import_yaml2.default.stringify(data, { indent: 2 });
|
|
46353
|
+
}
|
|
46354
|
+
function extractItems2(data) {
|
|
46355
|
+
if (data && typeof data === "object" && "items" in data) {
|
|
46356
|
+
const items = data.items;
|
|
46357
|
+
if (Array.isArray(items)) {
|
|
46358
|
+
return items.filter(
|
|
46359
|
+
(item) => item !== null && typeof item === "object"
|
|
46360
|
+
);
|
|
46361
|
+
}
|
|
46362
|
+
}
|
|
46363
|
+
if (Array.isArray(data)) {
|
|
46364
|
+
return data.filter(
|
|
46365
|
+
(item) => item !== null && typeof item === "object"
|
|
46366
|
+
);
|
|
46367
|
+
}
|
|
46368
|
+
if (data && typeof data === "object") {
|
|
46369
|
+
return [data];
|
|
46370
|
+
}
|
|
46371
|
+
return [];
|
|
46372
|
+
}
|
|
46373
|
+
function formatTable(data, noColor = false) {
|
|
46374
|
+
return formatResourceTable(data, noColor);
|
|
46375
|
+
}
|
|
46376
|
+
function formatTSV(data) {
|
|
46377
|
+
const items = extractItems2(data);
|
|
46378
|
+
if (items.length === 0) {
|
|
46379
|
+
return "";
|
|
46380
|
+
}
|
|
46381
|
+
const allKeys = /* @__PURE__ */ new Set();
|
|
46382
|
+
for (const item of items) {
|
|
46383
|
+
Object.keys(item).forEach((k) => allKeys.add(k));
|
|
46384
|
+
}
|
|
46385
|
+
const priority = ["name", "namespace", "status", "created", "modified"];
|
|
46386
|
+
const headers = [
|
|
46387
|
+
...priority.filter((p) => allKeys.has(p)),
|
|
46388
|
+
...[...allKeys].filter((k) => !priority.includes(k)).sort()
|
|
46389
|
+
];
|
|
46390
|
+
const lines = [];
|
|
46391
|
+
for (const item of items) {
|
|
46392
|
+
const values = headers.map((h) => {
|
|
46393
|
+
const val = item[h];
|
|
46394
|
+
if (val === null || val === void 0) return "";
|
|
46395
|
+
if (typeof val === "object") return JSON.stringify(val);
|
|
46396
|
+
return String(val);
|
|
46397
|
+
});
|
|
46398
|
+
lines.push(values.join(" "));
|
|
46399
|
+
}
|
|
46400
|
+
return lines.join("\n");
|
|
46401
|
+
}
|
|
46402
|
+
function parseOutputFormat(format) {
|
|
46403
|
+
switch (format.toLowerCase()) {
|
|
46404
|
+
case "json":
|
|
46405
|
+
return "json";
|
|
46406
|
+
case "yaml":
|
|
46407
|
+
return "yaml";
|
|
46408
|
+
case "table":
|
|
46409
|
+
case "text":
|
|
46410
|
+
case "":
|
|
46411
|
+
return "table";
|
|
46412
|
+
case "tsv":
|
|
46413
|
+
return "tsv";
|
|
46414
|
+
case "none":
|
|
46415
|
+
return "none";
|
|
46416
|
+
default:
|
|
46417
|
+
return "table";
|
|
46418
|
+
}
|
|
46419
|
+
}
|
|
46420
|
+
function formatAPIError(statusCode, body, operation) {
|
|
46421
|
+
const lines = [];
|
|
46422
|
+
lines.push(`ERROR: ${operation} failed (HTTP ${statusCode})`);
|
|
46423
|
+
if (body && typeof body === "object") {
|
|
46424
|
+
const errResp = body;
|
|
46425
|
+
if (errResp.message) {
|
|
46426
|
+
lines.push(` Message: ${errResp.message}`);
|
|
46427
|
+
}
|
|
46428
|
+
if (errResp.code) {
|
|
46429
|
+
lines.push(` Code: ${errResp.code}`);
|
|
46430
|
+
}
|
|
46431
|
+
if (errResp.details) {
|
|
46432
|
+
lines.push(` Details: ${errResp.details}`);
|
|
46433
|
+
}
|
|
46434
|
+
}
|
|
46435
|
+
switch (statusCode) {
|
|
46436
|
+
case 401:
|
|
46437
|
+
lines.push(
|
|
46438
|
+
"\nHint: Authentication failed. Check your credentials with 'login profile show'"
|
|
46439
|
+
);
|
|
46440
|
+
break;
|
|
46441
|
+
case 403:
|
|
46442
|
+
lines.push(
|
|
46443
|
+
"\nHint: Permission denied. You may not have access to this resource."
|
|
46444
|
+
);
|
|
46445
|
+
break;
|
|
46446
|
+
case 404:
|
|
46447
|
+
lines.push(
|
|
46448
|
+
"\nHint: Resource not found. Verify the name and namespace are correct."
|
|
46449
|
+
);
|
|
46450
|
+
break;
|
|
46451
|
+
case 409:
|
|
46452
|
+
lines.push(
|
|
46453
|
+
"\nHint: Conflict - resource may already exist or be in a conflicting state."
|
|
46454
|
+
);
|
|
46455
|
+
break;
|
|
46456
|
+
case 429:
|
|
46457
|
+
lines.push("\nHint: Rate limited. Please wait and try again.");
|
|
46458
|
+
break;
|
|
46459
|
+
case 500:
|
|
46460
|
+
case 502:
|
|
46461
|
+
case 503:
|
|
46462
|
+
lines.push(
|
|
46463
|
+
"\nHint: Server error. Please try again later or contact support."
|
|
46464
|
+
);
|
|
46465
|
+
break;
|
|
46466
|
+
}
|
|
46467
|
+
return lines.join("\n");
|
|
46468
|
+
}
|
|
46469
|
+
|
|
46470
|
+
// src/output/spec.ts
|
|
46471
|
+
function buildCommandSpec(options) {
|
|
46472
|
+
const spec = {
|
|
46473
|
+
command: options.command,
|
|
46474
|
+
description: options.description,
|
|
46475
|
+
usage: options.usage ?? `xcsh ${options.command} [options]`,
|
|
46476
|
+
flags: options.flags ?? [],
|
|
46477
|
+
examples: options.examples ?? [],
|
|
46478
|
+
outputFormats: options.outputFormats ?? ["table", "json", "yaml"]
|
|
46479
|
+
};
|
|
46480
|
+
if (options.related !== void 0) {
|
|
46481
|
+
spec.related = options.related;
|
|
46482
|
+
}
|
|
46483
|
+
if (options.category !== void 0) {
|
|
46484
|
+
spec.category = options.category;
|
|
46485
|
+
}
|
|
46486
|
+
return spec;
|
|
46487
|
+
}
|
|
46488
|
+
function formatSpec(spec) {
|
|
46489
|
+
return JSON.stringify(spec, null, 2);
|
|
46490
|
+
}
|
|
46491
|
+
function buildCloudstatusSpecs() {
|
|
46492
|
+
return {
|
|
46493
|
+
status: buildCommandSpec({
|
|
46494
|
+
command: "cloudstatus status",
|
|
46495
|
+
description: "Get the overall health indicator for F5 Distributed Cloud services. Returns status level (operational, degraded, major outage) with description.",
|
|
46496
|
+
usage: "xcsh cloudstatus status [--quiet]",
|
|
46497
|
+
flags: [
|
|
46498
|
+
{
|
|
46499
|
+
name: "--quiet",
|
|
46500
|
+
alias: "-q",
|
|
46501
|
+
description: "Return exit code only (0=operational, 1=degraded, 2=outage)",
|
|
46502
|
+
type: "boolean"
|
|
46503
|
+
}
|
|
46504
|
+
],
|
|
46505
|
+
examples: [
|
|
46506
|
+
{
|
|
46507
|
+
command: "xcsh cloudstatus status",
|
|
46508
|
+
description: "Check current F5 XC service status"
|
|
46509
|
+
},
|
|
46510
|
+
{
|
|
46511
|
+
command: "xcsh cloudstatus status --quiet && echo 'All systems operational'",
|
|
46512
|
+
description: "Use in scripts for health checks"
|
|
46513
|
+
},
|
|
46514
|
+
{
|
|
46515
|
+
command: "xcsh cloudstatus status --output json",
|
|
46516
|
+
description: "Get status as JSON for automation"
|
|
46517
|
+
}
|
|
46518
|
+
],
|
|
46519
|
+
category: "cloudstatus",
|
|
46520
|
+
related: [
|
|
46521
|
+
"cloudstatus summary",
|
|
46522
|
+
"cloudstatus components",
|
|
46523
|
+
"cloudstatus incidents"
|
|
46524
|
+
]
|
|
46525
|
+
}),
|
|
46526
|
+
summary: buildCommandSpec({
|
|
46527
|
+
command: "cloudstatus summary",
|
|
46528
|
+
description: "Get complete status summary including overall health, component status, and active incidents.",
|
|
46529
|
+
usage: "xcsh cloudstatus summary",
|
|
46530
|
+
examples: [
|
|
46531
|
+
{
|
|
46532
|
+
command: "xcsh cloudstatus summary",
|
|
46533
|
+
description: "View full infrastructure health overview"
|
|
46534
|
+
},
|
|
46535
|
+
{
|
|
46536
|
+
command: "xcsh cloudstatus summary --output json",
|
|
46537
|
+
description: "Get complete summary as JSON"
|
|
46538
|
+
}
|
|
46539
|
+
],
|
|
46540
|
+
category: "cloudstatus",
|
|
46541
|
+
related: ["cloudstatus status", "cloudstatus components"]
|
|
46542
|
+
}),
|
|
46543
|
+
components: buildCommandSpec({
|
|
46544
|
+
command: "cloudstatus components",
|
|
46545
|
+
description: "List all infrastructure components and their current operational status.",
|
|
46546
|
+
usage: "xcsh cloudstatus components",
|
|
46547
|
+
examples: [
|
|
46548
|
+
{
|
|
46549
|
+
command: "xcsh cloudstatus components",
|
|
46550
|
+
description: "List all components with status"
|
|
46551
|
+
},
|
|
46552
|
+
{
|
|
46553
|
+
command: "xcsh cloudstatus components --output json",
|
|
46554
|
+
description: "Get components as JSON for monitoring integration"
|
|
46555
|
+
}
|
|
46556
|
+
],
|
|
46557
|
+
category: "cloudstatus",
|
|
46558
|
+
related: ["cloudstatus status", "cloudstatus summary"]
|
|
46559
|
+
}),
|
|
46560
|
+
incidents: buildCommandSpec({
|
|
46561
|
+
command: "cloudstatus incidents",
|
|
46562
|
+
description: "List active and recent incidents affecting F5 Distributed Cloud services.",
|
|
46563
|
+
usage: "xcsh cloudstatus incidents",
|
|
46564
|
+
examples: [
|
|
46565
|
+
{
|
|
46566
|
+
command: "xcsh cloudstatus incidents",
|
|
46567
|
+
description: "View active incidents"
|
|
46568
|
+
},
|
|
46569
|
+
{
|
|
46570
|
+
command: "xcsh cloudstatus incidents --output json",
|
|
46571
|
+
description: "Get incidents as JSON for alerting systems"
|
|
46572
|
+
}
|
|
46573
|
+
],
|
|
46574
|
+
category: "cloudstatus",
|
|
46575
|
+
related: ["cloudstatus status", "cloudstatus maintenance"]
|
|
46576
|
+
}),
|
|
46577
|
+
maintenance: buildCommandSpec({
|
|
46578
|
+
command: "cloudstatus maintenance",
|
|
46579
|
+
description: "List scheduled maintenance windows for F5 Distributed Cloud services.",
|
|
46580
|
+
usage: "xcsh cloudstatus maintenance",
|
|
46581
|
+
examples: [
|
|
46582
|
+
{
|
|
46583
|
+
command: "xcsh cloudstatus maintenance",
|
|
46584
|
+
description: "View upcoming maintenance windows"
|
|
46585
|
+
},
|
|
46586
|
+
{
|
|
46587
|
+
command: "xcsh cloudstatus maintenance --output json",
|
|
46588
|
+
description: "Get maintenance schedule as JSON"
|
|
46589
|
+
}
|
|
46590
|
+
],
|
|
46591
|
+
category: "cloudstatus",
|
|
46592
|
+
related: ["cloudstatus status", "cloudstatus incidents"]
|
|
46593
|
+
})
|
|
46594
|
+
};
|
|
46595
|
+
}
|
|
46596
|
+
function buildLoginSpecs() {
|
|
46597
|
+
return {
|
|
46598
|
+
banner: buildCommandSpec({
|
|
46599
|
+
command: "login banner",
|
|
46600
|
+
description: "Display xcsh banner with logo and connection information.",
|
|
46601
|
+
usage: "xcsh login banner",
|
|
46602
|
+
examples: [
|
|
46603
|
+
{
|
|
46604
|
+
command: "xcsh login banner",
|
|
46605
|
+
description: "Show the xcsh welcome banner"
|
|
46606
|
+
}
|
|
46607
|
+
],
|
|
46608
|
+
category: "login",
|
|
46609
|
+
related: ["login profile show"]
|
|
46610
|
+
}),
|
|
46611
|
+
"profile list": buildCommandSpec({
|
|
46612
|
+
command: "login profile list",
|
|
46613
|
+
description: "List all saved connection profiles.",
|
|
46614
|
+
usage: "xcsh login profile list",
|
|
46615
|
+
examples: [
|
|
46616
|
+
{
|
|
46617
|
+
command: "xcsh login profile list",
|
|
46618
|
+
description: "List saved profiles"
|
|
46619
|
+
},
|
|
46620
|
+
{
|
|
46621
|
+
command: "xcsh login profile list --output json",
|
|
46622
|
+
description: "Get profiles as JSON"
|
|
46623
|
+
}
|
|
46624
|
+
],
|
|
46625
|
+
category: "login",
|
|
46626
|
+
related: [
|
|
46627
|
+
"login profile show",
|
|
46628
|
+
"login profile create",
|
|
46629
|
+
"login profile use"
|
|
46630
|
+
]
|
|
46631
|
+
}),
|
|
46632
|
+
"profile show": buildCommandSpec({
|
|
46633
|
+
command: "login profile show",
|
|
46634
|
+
description: "Show current connection profile and authentication status.",
|
|
46635
|
+
usage: "xcsh login profile show [name]",
|
|
46636
|
+
flags: [
|
|
46637
|
+
{
|
|
46638
|
+
name: "name",
|
|
46639
|
+
description: "Profile name to show (optional, defaults to active)",
|
|
46640
|
+
type: "string"
|
|
46641
|
+
}
|
|
46642
|
+
],
|
|
46643
|
+
examples: [
|
|
46644
|
+
{
|
|
46645
|
+
command: "xcsh login profile show",
|
|
46646
|
+
description: "Show active profile"
|
|
46647
|
+
},
|
|
46648
|
+
{
|
|
46649
|
+
command: "xcsh login profile show production",
|
|
46650
|
+
description: "Show specific profile"
|
|
46651
|
+
}
|
|
46652
|
+
],
|
|
46653
|
+
category: "login",
|
|
46654
|
+
related: ["login profile list", "login profile use"]
|
|
46655
|
+
}),
|
|
46656
|
+
"profile create": buildCommandSpec({
|
|
46657
|
+
command: "login profile create",
|
|
46658
|
+
description: "Create a new connection profile with URL and credentials.",
|
|
46659
|
+
usage: "xcsh login profile create <name>",
|
|
46660
|
+
flags: [
|
|
46661
|
+
{
|
|
46662
|
+
name: "name",
|
|
46663
|
+
description: "Profile name",
|
|
46664
|
+
type: "string",
|
|
46665
|
+
required: true
|
|
46666
|
+
}
|
|
46667
|
+
],
|
|
46668
|
+
examples: [
|
|
46669
|
+
{
|
|
46670
|
+
command: "xcsh login profile create production",
|
|
46671
|
+
description: "Create a new profile named 'production'"
|
|
46672
|
+
}
|
|
46673
|
+
],
|
|
46674
|
+
category: "login",
|
|
46675
|
+
related: ["login profile list", "login profile use"]
|
|
46676
|
+
}),
|
|
46677
|
+
"profile use": buildCommandSpec({
|
|
46678
|
+
command: "login profile use",
|
|
46679
|
+
description: "Switch to a different connection profile.",
|
|
46680
|
+
usage: "xcsh login profile use <name>",
|
|
46681
|
+
flags: [
|
|
46682
|
+
{
|
|
46683
|
+
name: "name",
|
|
46684
|
+
description: "Profile name to activate",
|
|
46685
|
+
type: "string",
|
|
46686
|
+
required: true
|
|
46687
|
+
}
|
|
46688
|
+
],
|
|
46689
|
+
examples: [
|
|
46690
|
+
{
|
|
46691
|
+
command: "xcsh login profile use staging",
|
|
46692
|
+
description: "Switch to staging profile"
|
|
46693
|
+
}
|
|
46694
|
+
],
|
|
46695
|
+
category: "login",
|
|
46696
|
+
related: ["login profile list", "login profile show"]
|
|
46697
|
+
}),
|
|
46698
|
+
"context show": buildCommandSpec({
|
|
46699
|
+
command: "login context show",
|
|
46700
|
+
description: "Show the current default namespace context.",
|
|
46701
|
+
usage: "xcsh login context show",
|
|
46702
|
+
examples: [
|
|
46703
|
+
{
|
|
46704
|
+
command: "xcsh login context show",
|
|
46705
|
+
description: "Display current namespace"
|
|
46706
|
+
}
|
|
46707
|
+
],
|
|
46708
|
+
category: "login",
|
|
46709
|
+
related: ["login context set", "login context list"]
|
|
46710
|
+
}),
|
|
46711
|
+
"context set": buildCommandSpec({
|
|
46712
|
+
command: "login context set",
|
|
46713
|
+
description: "Set the default namespace for subsequent operations.",
|
|
46714
|
+
usage: "xcsh login context set <namespace>",
|
|
46715
|
+
flags: [
|
|
46716
|
+
{
|
|
46717
|
+
name: "namespace",
|
|
46718
|
+
description: "Namespace to set as default",
|
|
46719
|
+
type: "string",
|
|
46720
|
+
required: true
|
|
46721
|
+
}
|
|
46722
|
+
],
|
|
46723
|
+
examples: [
|
|
46724
|
+
{
|
|
46725
|
+
command: "xcsh login context set production",
|
|
46726
|
+
description: "Set production as default namespace"
|
|
46727
|
+
}
|
|
46728
|
+
],
|
|
46729
|
+
category: "login",
|
|
46730
|
+
related: ["login context show", "login context list"]
|
|
46731
|
+
})
|
|
46732
|
+
};
|
|
46733
|
+
}
|
|
46734
|
+
function getCommandSpec(commandPath) {
|
|
46735
|
+
const cloudstatusSpecs = buildCloudstatusSpecs();
|
|
46736
|
+
const loginSpecs = buildLoginSpecs();
|
|
46737
|
+
const normalized = commandPath.toLowerCase().trim();
|
|
46738
|
+
if (normalized.startsWith("cloudstatus ")) {
|
|
46739
|
+
const subcommand = normalized.replace("cloudstatus ", "");
|
|
46740
|
+
return cloudstatusSpecs[subcommand];
|
|
46741
|
+
}
|
|
46742
|
+
if (normalized.startsWith("login ")) {
|
|
46743
|
+
const subcommand = normalized.replace("login ", "");
|
|
46744
|
+
return loginSpecs[subcommand];
|
|
46745
|
+
}
|
|
46746
|
+
return void 0;
|
|
46747
|
+
}
|
|
46748
|
+
|
|
46027
46749
|
// src/repl/session.ts
|
|
46028
46750
|
var NAMESPACE_CACHE_TTL = 5 * 60 * 1e3;
|
|
46029
46751
|
var REPLSession = class {
|
|
@@ -46037,7 +46759,7 @@ var REPLSession = class {
|
|
|
46037
46759
|
_serverUrl = "";
|
|
46038
46760
|
_apiToken = "";
|
|
46039
46761
|
_apiClient = null;
|
|
46040
|
-
_outputFormat = "
|
|
46762
|
+
_outputFormat = "table";
|
|
46041
46763
|
_debug = false;
|
|
46042
46764
|
_profileManager;
|
|
46043
46765
|
_activeProfile = null;
|
|
@@ -46051,7 +46773,7 @@ var REPLSession = class {
|
|
|
46051
46773
|
this._profileManager = getProfileManager();
|
|
46052
46774
|
this._serverUrl = config.serverUrl ?? process.env[`${ENV_PREFIX}_API_URL`] ?? "";
|
|
46053
46775
|
this._apiToken = config.apiToken ?? process.env[`${ENV_PREFIX}_API_TOKEN`] ?? "";
|
|
46054
|
-
this._outputFormat = config.outputFormat ?? "
|
|
46776
|
+
this._outputFormat = config.outputFormat ?? getOutputFormatFromEnv() ?? "table";
|
|
46055
46777
|
this._debug = config.debug ?? process.env[`${ENV_PREFIX}_DEBUG`] === "true";
|
|
46056
46778
|
if (this._serverUrl) {
|
|
46057
46779
|
this._tenant = this.extractTenant(this._serverUrl);
|
|
@@ -46098,10 +46820,19 @@ var REPLSession = class {
|
|
|
46098
46820
|
/**
|
|
46099
46821
|
* Load the active profile from profile manager
|
|
46100
46822
|
* Note: Environment variables take priority over profile settings
|
|
46823
|
+
* If no active profile is set but exactly one profile exists, auto-activate it
|
|
46101
46824
|
*/
|
|
46102
46825
|
async loadActiveProfile() {
|
|
46103
46826
|
try {
|
|
46104
|
-
|
|
46827
|
+
let activeName = await this._profileManager.getActive();
|
|
46828
|
+
if (!activeName) {
|
|
46829
|
+
const profiles = await this._profileManager.list();
|
|
46830
|
+
if (profiles.length === 1 && profiles[0]) {
|
|
46831
|
+
const singleProfile = profiles[0];
|
|
46832
|
+
await this._profileManager.setActive(singleProfile.name);
|
|
46833
|
+
activeName = singleProfile.name;
|
|
46834
|
+
}
|
|
46835
|
+
}
|
|
46105
46836
|
if (activeName) {
|
|
46106
46837
|
const profile = await this._profileManager.get(activeName);
|
|
46107
46838
|
if (profile) {
|
|
@@ -46900,7 +47631,7 @@ function formatConfigSection() {
|
|
|
46900
47631
|
}
|
|
46901
47632
|
|
|
46902
47633
|
// src/repl/help.ts
|
|
46903
|
-
function
|
|
47634
|
+
function wrapText3(text, width, indent) {
|
|
46904
47635
|
const prefix = " ".repeat(indent);
|
|
46905
47636
|
const words = text.split(/\s+/);
|
|
46906
47637
|
const lines = [];
|
|
@@ -46924,7 +47655,7 @@ function formatRootHelp() {
|
|
|
46924
47655
|
colorBoldWhite(`${CLI_NAME} - ${CLI_FULL_NAME} v${CLI_VERSION}`),
|
|
46925
47656
|
"",
|
|
46926
47657
|
"DESCRIPTION",
|
|
46927
|
-
...
|
|
47658
|
+
...wrapText3(CLI_DESCRIPTION_LONG, 80, 2),
|
|
46928
47659
|
"",
|
|
46929
47660
|
"USAGE",
|
|
46930
47661
|
` ${CLI_NAME} Enter interactive REPL mode`,
|
|
@@ -46968,7 +47699,8 @@ function formatGlobalFlags() {
|
|
|
46968
47699
|
" -h, --help Show this help",
|
|
46969
47700
|
" --no-color Disable color output",
|
|
46970
47701
|
" -o, --output <fmt> Output format (json, yaml, table)",
|
|
46971
|
-
" -ns, --namespace <ns> Target namespace"
|
|
47702
|
+
" -ns, --namespace <ns> Target namespace",
|
|
47703
|
+
" --spec Output command specification as JSON (for AI)"
|
|
46972
47704
|
];
|
|
46973
47705
|
}
|
|
46974
47706
|
function formatEnvironmentVariables() {
|
|
@@ -47233,7 +47965,7 @@ function formatDomainsSection() {
|
|
|
47233
47965
|
function formatCustomDomainHelp(domain) {
|
|
47234
47966
|
const output = ["", colorBoldWhite(domain.name), ""];
|
|
47235
47967
|
output.push("DESCRIPTION");
|
|
47236
|
-
output.push(...
|
|
47968
|
+
output.push(...wrapText3(domain.description, 80, 2));
|
|
47237
47969
|
output.push("");
|
|
47238
47970
|
output.push("USAGE");
|
|
47239
47971
|
output.push(` ${CLI_NAME} ${domain.name} <command> [options]`);
|
|
@@ -47263,7 +47995,7 @@ function formatSubcommandHelp(domainName, subcommand) {
|
|
|
47263
47995
|
""
|
|
47264
47996
|
];
|
|
47265
47997
|
output.push("DESCRIPTION");
|
|
47266
|
-
output.push(...
|
|
47998
|
+
output.push(...wrapText3(subcommand.description, 80, 2));
|
|
47267
47999
|
output.push("");
|
|
47268
48000
|
output.push("USAGE");
|
|
47269
48001
|
output.push(
|
|
@@ -47614,7 +48346,115 @@ var showCommand = {
|
|
|
47614
48346
|
(name) => name.toLowerCase().startsWith(partial.toLowerCase())
|
|
47615
48347
|
);
|
|
47616
48348
|
}
|
|
47617
|
-
};
|
|
48349
|
+
};
|
|
48350
|
+
|
|
48351
|
+
// src/domains/login/profile/connection-table.ts
|
|
48352
|
+
var UNICODE_BOX2 = {
|
|
48353
|
+
topLeft: "\u256D",
|
|
48354
|
+
// ╭
|
|
48355
|
+
topRight: "\u256E",
|
|
48356
|
+
// ╮
|
|
48357
|
+
bottomLeft: "\u2570",
|
|
48358
|
+
// ╰
|
|
48359
|
+
bottomRight: "\u256F",
|
|
48360
|
+
// ╯
|
|
48361
|
+
horizontal: "\u2500",
|
|
48362
|
+
// ─
|
|
48363
|
+
vertical: "\u2502",
|
|
48364
|
+
// │
|
|
48365
|
+
leftT: "\u251C",
|
|
48366
|
+
// ├
|
|
48367
|
+
rightT: "\u2524"
|
|
48368
|
+
// ┤
|
|
48369
|
+
};
|
|
48370
|
+
var ASCII_BOX2 = {
|
|
48371
|
+
topLeft: "+",
|
|
48372
|
+
topRight: "+",
|
|
48373
|
+
bottomLeft: "+",
|
|
48374
|
+
bottomRight: "+",
|
|
48375
|
+
horizontal: "-",
|
|
48376
|
+
vertical: "|",
|
|
48377
|
+
leftT: "+",
|
|
48378
|
+
rightT: "+"
|
|
48379
|
+
};
|
|
48380
|
+
function extractTenantFromUrl(url) {
|
|
48381
|
+
try {
|
|
48382
|
+
const parsed = new URL(url);
|
|
48383
|
+
const hostname = parsed.hostname;
|
|
48384
|
+
const parts = hostname.split(".");
|
|
48385
|
+
if (parts.length > 0 && parts[0]) {
|
|
48386
|
+
return parts[0];
|
|
48387
|
+
}
|
|
48388
|
+
return hostname;
|
|
48389
|
+
} catch {
|
|
48390
|
+
return "unknown";
|
|
48391
|
+
}
|
|
48392
|
+
}
|
|
48393
|
+
function formatConnectionTable(info, noColor = false) {
|
|
48394
|
+
const useColors = shouldUseColors(void 0, noColor);
|
|
48395
|
+
const box = useColors ? UNICODE_BOX2 : ASCII_BOX2;
|
|
48396
|
+
const borderColor = colors.red;
|
|
48397
|
+
const successColor = colors.green;
|
|
48398
|
+
const errorColor = colors.red;
|
|
48399
|
+
const colorBorder = (text) => useColors ? `${borderColor}${text}${colors.reset}` : text;
|
|
48400
|
+
const colorStatus = (text, isGood) => useColors ? `${isGood ? successColor : errorColor}${text}${colors.reset}` : text;
|
|
48401
|
+
const rows = [
|
|
48402
|
+
{ label: "Profile", value: info.profileName },
|
|
48403
|
+
{ label: "Tenant", value: info.tenant },
|
|
48404
|
+
{ label: "API URL", value: info.apiUrl },
|
|
48405
|
+
{
|
|
48406
|
+
label: "Auth",
|
|
48407
|
+
value: info.hasToken ? colorStatus("\u2713 Token configured", true) : colorStatus("\u2717 No token", false)
|
|
48408
|
+
},
|
|
48409
|
+
{ label: "Namespace", value: info.namespace || "default" },
|
|
48410
|
+
{
|
|
48411
|
+
label: "Status",
|
|
48412
|
+
value: info.isConnected ? colorStatus("\u25CF Connected", true) : colorStatus("\u25CB Not connected", false)
|
|
48413
|
+
}
|
|
48414
|
+
];
|
|
48415
|
+
const labelWidth = Math.max(...rows.map((r) => r.label.length));
|
|
48416
|
+
const valueWidth = Math.max(
|
|
48417
|
+
...rows.map((r) => stripAnsi2(r.value).length),
|
|
48418
|
+
30
|
|
48419
|
+
);
|
|
48420
|
+
const innerWidth = labelWidth + valueWidth + 5;
|
|
48421
|
+
const title = " Connection Summary ";
|
|
48422
|
+
const remainingWidth = innerWidth - title.length;
|
|
48423
|
+
const leftDashes = 1;
|
|
48424
|
+
const rightDashes = Math.max(0, remainingWidth - leftDashes);
|
|
48425
|
+
const lines = [];
|
|
48426
|
+
lines.push(
|
|
48427
|
+
colorBorder(box.topLeft + box.horizontal.repeat(leftDashes)) + title + colorBorder(box.horizontal.repeat(rightDashes) + box.topRight)
|
|
48428
|
+
);
|
|
48429
|
+
for (const row of rows) {
|
|
48430
|
+
const paddedLabel = row.label.padEnd(labelWidth);
|
|
48431
|
+
const valueLen = stripAnsi2(row.value).length;
|
|
48432
|
+
const paddedValue = row.value + " ".repeat(Math.max(0, valueWidth - valueLen));
|
|
48433
|
+
const content = ` ${paddedLabel} ${colorBorder(box.vertical)} ${paddedValue} `;
|
|
48434
|
+
lines.push(
|
|
48435
|
+
colorBorder(box.vertical) + content + colorBorder(box.vertical)
|
|
48436
|
+
);
|
|
48437
|
+
}
|
|
48438
|
+
lines.push(
|
|
48439
|
+
colorBorder(
|
|
48440
|
+
box.bottomLeft + box.horizontal.repeat(innerWidth) + box.bottomRight
|
|
48441
|
+
)
|
|
48442
|
+
);
|
|
48443
|
+
return lines;
|
|
48444
|
+
}
|
|
48445
|
+
function stripAnsi2(str) {
|
|
48446
|
+
return str.replace(/\x1b\[[0-9;]*m/g, "");
|
|
48447
|
+
}
|
|
48448
|
+
function buildConnectionInfo(profileName, apiUrl, hasToken, namespace, isConnected) {
|
|
48449
|
+
return {
|
|
48450
|
+
profileName,
|
|
48451
|
+
tenant: extractTenantFromUrl(apiUrl),
|
|
48452
|
+
apiUrl,
|
|
48453
|
+
hasToken,
|
|
48454
|
+
namespace,
|
|
48455
|
+
isConnected
|
|
48456
|
+
};
|
|
48457
|
+
}
|
|
47618
48458
|
|
|
47619
48459
|
// src/domains/login/profile/create.ts
|
|
47620
48460
|
var createCommand2 = {
|
|
@@ -47684,9 +48524,21 @@ var createCommand2 = {
|
|
|
47684
48524
|
if (!result.success) {
|
|
47685
48525
|
return errorResult(result.message);
|
|
47686
48526
|
}
|
|
48527
|
+
const connectionInfo = buildConnectionInfo(
|
|
48528
|
+
name,
|
|
48529
|
+
apiUrl,
|
|
48530
|
+
true,
|
|
48531
|
+
// hasToken - we just saved it
|
|
48532
|
+
defaultNamespace || "default",
|
|
48533
|
+
false
|
|
48534
|
+
// Not connected yet - profile just created
|
|
48535
|
+
);
|
|
48536
|
+
const tableLines = formatConnectionTable(connectionInfo);
|
|
47687
48537
|
return successResult([
|
|
47688
48538
|
`Profile '${name}' created successfully.`,
|
|
47689
48539
|
``,
|
|
48540
|
+
...tableLines,
|
|
48541
|
+
``,
|
|
47690
48542
|
`Use 'login profile use ${name}' to activate this profile.`
|
|
47691
48543
|
]);
|
|
47692
48544
|
}
|
|
@@ -47711,12 +48563,16 @@ var useCommand = {
|
|
|
47711
48563
|
return errorResult(`Profile '${name}' not found.`);
|
|
47712
48564
|
}
|
|
47713
48565
|
const profile = session.getActiveProfile();
|
|
48566
|
+
const connectionInfo = buildConnectionInfo(
|
|
48567
|
+
name,
|
|
48568
|
+
profile?.apiUrl || "",
|
|
48569
|
+
!!profile?.apiToken,
|
|
48570
|
+
profile?.defaultNamespace || session.getNamespace(),
|
|
48571
|
+
session.isAuthenticated()
|
|
48572
|
+
);
|
|
48573
|
+
const tableLines = formatConnectionTable(connectionInfo);
|
|
47714
48574
|
return successResult(
|
|
47715
|
-
[
|
|
47716
|
-
`Switched to profile '${name}'.`,
|
|
47717
|
-
profile?.apiUrl ? ` API URL: ${profile.apiUrl}` : "",
|
|
47718
|
-
profile?.defaultNamespace ? ` Namespace: ${profile.defaultNamespace}` : ""
|
|
47719
|
-
].filter(Boolean),
|
|
48575
|
+
[`Switched to profile '${name}'.`, ``, ...tableLines],
|
|
47720
48576
|
true
|
|
47721
48577
|
// contextChanged - prompt should update
|
|
47722
48578
|
);
|
|
@@ -47982,7 +48838,7 @@ var contextSubcommands = {
|
|
|
47982
48838
|
};
|
|
47983
48839
|
|
|
47984
48840
|
// src/config/settings.ts
|
|
47985
|
-
var
|
|
48841
|
+
var import_yaml3 = __toESM(require_dist(), 1);
|
|
47986
48842
|
import { homedir as homedir3 } from "os";
|
|
47987
48843
|
import { join as join3 } from "path";
|
|
47988
48844
|
var LOGO_MODES = [
|
|
@@ -48013,7 +48869,7 @@ function loadSettingsSync() {
|
|
|
48013
48869
|
configPath,
|
|
48014
48870
|
"utf-8"
|
|
48015
48871
|
);
|
|
48016
|
-
const parsed =
|
|
48872
|
+
const parsed = import_yaml3.default.parse(content);
|
|
48017
48873
|
return {
|
|
48018
48874
|
...DEFAULT_SETTINGS,
|
|
48019
48875
|
...validateSettings(parsed)
|
|
@@ -48880,6 +49736,34 @@ function calculateRegionalStatus(components) {
|
|
|
48880
49736
|
}
|
|
48881
49737
|
|
|
48882
49738
|
// src/domains/cloudstatus/index.ts
|
|
49739
|
+
function parseOutputArgs(args, session) {
|
|
49740
|
+
let format;
|
|
49741
|
+
let spec = false;
|
|
49742
|
+
const filteredArgs = [];
|
|
49743
|
+
for (let i = 0; i < args.length; i++) {
|
|
49744
|
+
const arg = args[i] ?? "";
|
|
49745
|
+
const nextArg = args[i + 1];
|
|
49746
|
+
if (arg === "--output" || arg === "-o") {
|
|
49747
|
+
if (nextArg) {
|
|
49748
|
+
format = parseOutputFormat(nextArg);
|
|
49749
|
+
i++;
|
|
49750
|
+
}
|
|
49751
|
+
} else if (arg === "--spec") {
|
|
49752
|
+
spec = true;
|
|
49753
|
+
} else if (arg.startsWith("--output=")) {
|
|
49754
|
+
format = parseOutputFormat(arg.split("=")[1] ?? "table");
|
|
49755
|
+
} else if (arg.startsWith("-o=")) {
|
|
49756
|
+
format = parseOutputFormat(arg.split("=")[1] ?? "table");
|
|
49757
|
+
} else {
|
|
49758
|
+
filteredArgs.push(arg);
|
|
49759
|
+
}
|
|
49760
|
+
}
|
|
49761
|
+
return {
|
|
49762
|
+
format: format ?? session.getOutputFormat(),
|
|
49763
|
+
spec,
|
|
49764
|
+
filteredArgs
|
|
49765
|
+
};
|
|
49766
|
+
}
|
|
48883
49767
|
var cloudstatusClient = null;
|
|
48884
49768
|
function getClient() {
|
|
48885
49769
|
if (!cloudstatusClient) {
|
|
@@ -48895,8 +49779,14 @@ var statusCommand = {
|
|
|
48895
49779
|
usage: "[--quiet]",
|
|
48896
49780
|
aliases: ["st"],
|
|
48897
49781
|
async execute(args, session) {
|
|
48898
|
-
const
|
|
48899
|
-
const
|
|
49782
|
+
const { format, spec, filteredArgs } = parseOutputArgs(args, session);
|
|
49783
|
+
const quiet = filteredArgs.includes("--quiet") || filteredArgs.includes("-q");
|
|
49784
|
+
if (spec) {
|
|
49785
|
+
const cmdSpec = getCommandSpec("cloudstatus status");
|
|
49786
|
+
if (cmdSpec) {
|
|
49787
|
+
return successResult([formatSpec(cmdSpec)]);
|
|
49788
|
+
}
|
|
49789
|
+
}
|
|
48900
49790
|
try {
|
|
48901
49791
|
const client = getClient();
|
|
48902
49792
|
const response = await client.getStatus();
|
|
@@ -48946,8 +49836,14 @@ var summaryCommand = {
|
|
|
48946
49836
|
usage: "[--brief]",
|
|
48947
49837
|
aliases: ["sum"],
|
|
48948
49838
|
async execute(args, session) {
|
|
48949
|
-
const
|
|
48950
|
-
const
|
|
49839
|
+
const { format, spec, filteredArgs } = parseOutputArgs(args, session);
|
|
49840
|
+
const brief = filteredArgs.includes("--brief") || filteredArgs.includes("-b");
|
|
49841
|
+
if (spec) {
|
|
49842
|
+
const cmdSpec = getCommandSpec("cloudstatus summary");
|
|
49843
|
+
if (cmdSpec) {
|
|
49844
|
+
return successResult([formatSpec(cmdSpec)]);
|
|
49845
|
+
}
|
|
49846
|
+
}
|
|
48951
49847
|
try {
|
|
48952
49848
|
const client = getClient();
|
|
48953
49849
|
const response = await client.getSummary();
|
|
@@ -48975,8 +49871,14 @@ var componentsCommand = {
|
|
|
48975
49871
|
usage: "[--degraded-only]",
|
|
48976
49872
|
aliases: ["comp"],
|
|
48977
49873
|
async execute(args, session) {
|
|
48978
|
-
const
|
|
48979
|
-
const
|
|
49874
|
+
const { format, spec, filteredArgs } = parseOutputArgs(args, session);
|
|
49875
|
+
const degradedOnly = filteredArgs.includes("--degraded-only") || filteredArgs.includes("-d");
|
|
49876
|
+
if (spec) {
|
|
49877
|
+
const cmdSpec = getCommandSpec("cloudstatus components");
|
|
49878
|
+
if (cmdSpec) {
|
|
49879
|
+
return successResult([formatSpec(cmdSpec)]);
|
|
49880
|
+
}
|
|
49881
|
+
}
|
|
48980
49882
|
try {
|
|
48981
49883
|
const client = getClient();
|
|
48982
49884
|
const response = await client.getComponents();
|
|
@@ -49018,8 +49920,14 @@ var incidentsCommand = {
|
|
|
49018
49920
|
usage: "[--active-only]",
|
|
49019
49921
|
aliases: ["inc"],
|
|
49020
49922
|
async execute(args, session) {
|
|
49021
|
-
const
|
|
49022
|
-
const
|
|
49923
|
+
const { format, spec, filteredArgs } = parseOutputArgs(args, session);
|
|
49924
|
+
const activeOnly = filteredArgs.includes("--active-only") || filteredArgs.includes("-a");
|
|
49925
|
+
if (spec) {
|
|
49926
|
+
const cmdSpec = getCommandSpec("cloudstatus incidents");
|
|
49927
|
+
if (cmdSpec) {
|
|
49928
|
+
return successResult([formatSpec(cmdSpec)]);
|
|
49929
|
+
}
|
|
49930
|
+
}
|
|
49023
49931
|
try {
|
|
49024
49932
|
const client = getClient();
|
|
49025
49933
|
const response = activeOnly ? await client.getUnresolvedIncidents() : await client.getIncidents();
|
|
@@ -49059,8 +49967,14 @@ var maintenanceCommand = {
|
|
|
49059
49967
|
usage: "[--upcoming]",
|
|
49060
49968
|
aliases: ["maint"],
|
|
49061
49969
|
async execute(args, session) {
|
|
49062
|
-
const
|
|
49063
|
-
const
|
|
49970
|
+
const { format, spec, filteredArgs } = parseOutputArgs(args, session);
|
|
49971
|
+
const upcomingOnly = filteredArgs.includes("--upcoming") || filteredArgs.includes("-u");
|
|
49972
|
+
if (spec) {
|
|
49973
|
+
const cmdSpec = getCommandSpec("cloudstatus maintenance");
|
|
49974
|
+
if (cmdSpec) {
|
|
49975
|
+
return successResult([formatSpec(cmdSpec)]);
|
|
49976
|
+
}
|
|
49977
|
+
}
|
|
49064
49978
|
try {
|
|
49065
49979
|
const client = getClient();
|
|
49066
49980
|
const response = upcomingOnly ? await client.getUpcomingMaintenances() : await client.getMaintenances();
|
|
@@ -49532,7 +50446,7 @@ _xcsh_completions() {
|
|
|
49532
50446
|
local commands="${domainNames} ${allAliases.join(" ")} help quit exit clear history"
|
|
49533
50447
|
local actions="${actions}"
|
|
49534
50448
|
local builtins="help quit exit clear history context ctx"
|
|
49535
|
-
local global_flags="--help -h --version -v --no-color --output -o --namespace -ns"
|
|
50449
|
+
local global_flags="--help -h --version -v --no-color --output -o --namespace -ns --spec"
|
|
49536
50450
|
|
|
49537
50451
|
# Handle completion based on position
|
|
49538
50452
|
case \${cword} in
|
|
@@ -49563,7 +50477,7 @@ ${customDomainCompletions.join("\n")}
|
|
|
49563
50477
|
*)
|
|
49564
50478
|
# Third+ word: flags
|
|
49565
50479
|
if [[ "\${cur}" == -* ]]; then
|
|
49566
|
-
local action_flags="--name -n --namespace -ns --output -o --json --yaml --limit --label"
|
|
50480
|
+
local action_flags="--name -n --namespace -ns --output -o --json --yaml --limit --label --spec"
|
|
49567
50481
|
COMPREPLY=($(compgen -W "\${action_flags}" -- "\${cur}"))
|
|
49568
50482
|
fi
|
|
49569
50483
|
return 0
|
|
@@ -49617,6 +50531,7 @@ _xcsh() {
|
|
|
49617
50531
|
'--no-color[Disable color output]'
|
|
49618
50532
|
'(-o --output)'{-o,--output}'[Output format]:format:(json yaml table)'
|
|
49619
50533
|
'(-ns --namespace)'{-ns,--namespace}'[Namespace]:namespace:_xcsh_namespaces'
|
|
50534
|
+
'--spec[Output command specification as JSON for AI assistants]'
|
|
49620
50535
|
)
|
|
49621
50536
|
|
|
49622
50537
|
_arguments -C \\
|
|
@@ -49667,6 +50582,7 @@ ${customDomainCompletions.join("\n")}
|
|
|
49667
50582
|
'--limit[Maximum results]:limit:'
|
|
49668
50583
|
'--label[Filter by label]:label:'
|
|
49669
50584
|
'(-f --file)'{-f,--file}'[Configuration file]:file:_files'
|
|
50585
|
+
'--spec[Output command specification as JSON for AI assistants]'
|
|
49670
50586
|
)
|
|
49671
50587
|
_arguments "\${action_opts[@]}"
|
|
49672
50588
|
;;
|
|
@@ -49730,6 +50646,7 @@ complete -c xcsh -s v -l version -d 'Show version number'
|
|
|
49730
50646
|
complete -c xcsh -l no-color -d 'Disable color output'
|
|
49731
50647
|
complete -c xcsh -s o -l output -d 'Output format' -xa 'json yaml table'
|
|
49732
50648
|
complete -c xcsh -l namespace -s ns -d 'Namespace' -xa 'default system shared'
|
|
50649
|
+
complete -c xcsh -l spec -d 'Output command specification as JSON for AI assistants'
|
|
49733
50650
|
|
|
49734
50651
|
# Builtin commands
|
|
49735
50652
|
complete -c xcsh -n "__fish_use_subcommand" -a "help" -d 'Show help information'
|
|
@@ -49759,6 +50676,7 @@ complete -c xcsh -l label -d 'Filter by label'
|
|
|
49759
50676
|
complete -c xcsh -s f -l file -d 'Configuration file' -r
|
|
49760
50677
|
complete -c xcsh -l force -d 'Force deletion'
|
|
49761
50678
|
complete -c xcsh -l cascade -d 'Cascade delete'
|
|
50679
|
+
complete -c xcsh -l spec -d 'Output command specification as JSON for AI assistants'
|
|
49762
50680
|
`;
|
|
49763
50681
|
}
|
|
49764
50682
|
|
|
@@ -50925,219 +51843,6 @@ function useCompletion(options) {
|
|
|
50925
51843
|
};
|
|
50926
51844
|
}
|
|
50927
51845
|
|
|
50928
|
-
// src/output/formatter.ts
|
|
50929
|
-
var import_yaml3 = __toESM(require_dist(), 1);
|
|
50930
|
-
function formatOutput(data, format = "yaml") {
|
|
50931
|
-
if (format === "none") {
|
|
50932
|
-
return "";
|
|
50933
|
-
}
|
|
50934
|
-
switch (format) {
|
|
50935
|
-
case "json":
|
|
50936
|
-
return formatJSON(data);
|
|
50937
|
-
case "yaml":
|
|
50938
|
-
return formatYAML(data);
|
|
50939
|
-
case "table":
|
|
50940
|
-
case "text":
|
|
50941
|
-
return formatTable(data);
|
|
50942
|
-
case "tsv":
|
|
50943
|
-
return formatTSV(data);
|
|
50944
|
-
default:
|
|
50945
|
-
return formatYAML(data);
|
|
50946
|
-
}
|
|
50947
|
-
}
|
|
50948
|
-
function formatJSON(data) {
|
|
50949
|
-
return JSON.stringify(data, null, 2);
|
|
50950
|
-
}
|
|
50951
|
-
function formatYAML(data) {
|
|
50952
|
-
return import_yaml3.default.stringify(data, { indent: 2 });
|
|
50953
|
-
}
|
|
50954
|
-
function extractItems(data) {
|
|
50955
|
-
if (data && typeof data === "object" && "items" in data) {
|
|
50956
|
-
const items = data.items;
|
|
50957
|
-
if (Array.isArray(items)) {
|
|
50958
|
-
return items.filter(
|
|
50959
|
-
(item) => item !== null && typeof item === "object"
|
|
50960
|
-
);
|
|
50961
|
-
}
|
|
50962
|
-
}
|
|
50963
|
-
if (Array.isArray(data)) {
|
|
50964
|
-
return data.filter(
|
|
50965
|
-
(item) => item !== null && typeof item === "object"
|
|
50966
|
-
);
|
|
50967
|
-
}
|
|
50968
|
-
if (data && typeof data === "object") {
|
|
50969
|
-
return [data];
|
|
50970
|
-
}
|
|
50971
|
-
return [];
|
|
50972
|
-
}
|
|
50973
|
-
function getStringField(obj, key) {
|
|
50974
|
-
const value = obj[key];
|
|
50975
|
-
if (typeof value === "string") {
|
|
50976
|
-
return value;
|
|
50977
|
-
}
|
|
50978
|
-
if (value !== null && value !== void 0) {
|
|
50979
|
-
return String(value);
|
|
50980
|
-
}
|
|
50981
|
-
return "";
|
|
50982
|
-
}
|
|
50983
|
-
function formatLabels(obj) {
|
|
50984
|
-
const labels = obj["labels"];
|
|
50985
|
-
if (!labels || typeof labels !== "object") {
|
|
50986
|
-
return "";
|
|
50987
|
-
}
|
|
50988
|
-
const labelMap = labels;
|
|
50989
|
-
const entries = Object.entries(labelMap).sort(([a], [b]) => a.localeCompare(b)).map(([k, v]) => `${k}:${v}`);
|
|
50990
|
-
if (entries.length === 0) {
|
|
50991
|
-
return "";
|
|
50992
|
-
}
|
|
50993
|
-
return `map[${entries.join(" ")}]`;
|
|
50994
|
-
}
|
|
50995
|
-
function wrapText3(text, maxWidth) {
|
|
50996
|
-
if (text.length <= maxWidth) {
|
|
50997
|
-
return [text];
|
|
50998
|
-
}
|
|
50999
|
-
const lines = [];
|
|
51000
|
-
let remaining = text;
|
|
51001
|
-
while (remaining.length > 0) {
|
|
51002
|
-
if (remaining.length <= maxWidth) {
|
|
51003
|
-
lines.push(remaining);
|
|
51004
|
-
break;
|
|
51005
|
-
}
|
|
51006
|
-
let breakPoint = maxWidth;
|
|
51007
|
-
for (let i = maxWidth - 1; i > 0; i--) {
|
|
51008
|
-
if (remaining[i] === " ") {
|
|
51009
|
-
breakPoint = i;
|
|
51010
|
-
break;
|
|
51011
|
-
}
|
|
51012
|
-
}
|
|
51013
|
-
lines.push(remaining.slice(0, breakPoint));
|
|
51014
|
-
remaining = remaining.slice(breakPoint).trimStart();
|
|
51015
|
-
}
|
|
51016
|
-
return lines;
|
|
51017
|
-
}
|
|
51018
|
-
function formatTable(data) {
|
|
51019
|
-
const items = extractItems(data);
|
|
51020
|
-
if (items.length === 0) {
|
|
51021
|
-
return "";
|
|
51022
|
-
}
|
|
51023
|
-
const headers = ["NAMESPACE", "NAME", "LABELS"];
|
|
51024
|
-
const widths = [9, 27, 30];
|
|
51025
|
-
const rows = [];
|
|
51026
|
-
for (const item of items) {
|
|
51027
|
-
const row = [
|
|
51028
|
-
getStringField(item, "namespace") || "<None>",
|
|
51029
|
-
getStringField(item, "name") || "<None>",
|
|
51030
|
-
formatLabels(item) || "<None>"
|
|
51031
|
-
];
|
|
51032
|
-
const wrappedCells = row.map((cell, i) => wrapText3(cell, widths[i]));
|
|
51033
|
-
const maxLines = Math.max(...wrappedCells.map((c) => c.length));
|
|
51034
|
-
const wrappedRows = [];
|
|
51035
|
-
for (let line = 0; line < maxLines; line++) {
|
|
51036
|
-
wrappedRows.push(wrappedCells.map((c) => c[line] ?? ""));
|
|
51037
|
-
}
|
|
51038
|
-
rows.push(wrappedRows);
|
|
51039
|
-
}
|
|
51040
|
-
const lines = [];
|
|
51041
|
-
const boxLine = "+" + widths.map((w) => "-".repeat(w + 2)).join("+") + "+";
|
|
51042
|
-
lines.push(boxLine);
|
|
51043
|
-
lines.push(
|
|
51044
|
-
"|" + headers.map((h, i) => {
|
|
51045
|
-
const padding = widths[i] - h.length;
|
|
51046
|
-
const leftPad = Math.floor(padding / 2);
|
|
51047
|
-
const rightPad = padding - leftPad;
|
|
51048
|
-
return " " + " ".repeat(leftPad) + h + " ".repeat(rightPad) + " ";
|
|
51049
|
-
}).join("|") + "|"
|
|
51050
|
-
);
|
|
51051
|
-
lines.push(boxLine);
|
|
51052
|
-
for (const wrappedRows of rows) {
|
|
51053
|
-
for (const row of wrappedRows) {
|
|
51054
|
-
lines.push(
|
|
51055
|
-
"|" + row.map((cell, i) => {
|
|
51056
|
-
const padding = widths[i] - cell.length;
|
|
51057
|
-
return " " + cell + " ".repeat(padding) + " ";
|
|
51058
|
-
}).join("|") + "|"
|
|
51059
|
-
);
|
|
51060
|
-
}
|
|
51061
|
-
lines.push(boxLine);
|
|
51062
|
-
}
|
|
51063
|
-
return lines.join("\n");
|
|
51064
|
-
}
|
|
51065
|
-
function formatTSV(data) {
|
|
51066
|
-
const items = extractItems(data);
|
|
51067
|
-
if (items.length === 0) {
|
|
51068
|
-
return "";
|
|
51069
|
-
}
|
|
51070
|
-
const allKeys = /* @__PURE__ */ new Set();
|
|
51071
|
-
for (const item of items) {
|
|
51072
|
-
Object.keys(item).forEach((k) => allKeys.add(k));
|
|
51073
|
-
}
|
|
51074
|
-
const priority = ["name", "namespace", "status", "created", "modified"];
|
|
51075
|
-
const headers = [
|
|
51076
|
-
...priority.filter((p) => allKeys.has(p)),
|
|
51077
|
-
...[...allKeys].filter((k) => !priority.includes(k)).sort()
|
|
51078
|
-
];
|
|
51079
|
-
const lines = [];
|
|
51080
|
-
for (const item of items) {
|
|
51081
|
-
const values = headers.map((h) => {
|
|
51082
|
-
const val = item[h];
|
|
51083
|
-
if (val === null || val === void 0) return "";
|
|
51084
|
-
if (typeof val === "object") return JSON.stringify(val);
|
|
51085
|
-
return String(val);
|
|
51086
|
-
});
|
|
51087
|
-
lines.push(values.join(" "));
|
|
51088
|
-
}
|
|
51089
|
-
return lines.join("\n");
|
|
51090
|
-
}
|
|
51091
|
-
function formatAPIError(statusCode, body, operation) {
|
|
51092
|
-
const lines = [];
|
|
51093
|
-
lines.push(`ERROR: ${operation} failed (HTTP ${statusCode})`);
|
|
51094
|
-
if (body && typeof body === "object") {
|
|
51095
|
-
const errResp = body;
|
|
51096
|
-
if (errResp.message) {
|
|
51097
|
-
lines.push(` Message: ${errResp.message}`);
|
|
51098
|
-
}
|
|
51099
|
-
if (errResp.code) {
|
|
51100
|
-
lines.push(` Code: ${errResp.code}`);
|
|
51101
|
-
}
|
|
51102
|
-
if (errResp.details) {
|
|
51103
|
-
lines.push(` Details: ${errResp.details}`);
|
|
51104
|
-
}
|
|
51105
|
-
}
|
|
51106
|
-
switch (statusCode) {
|
|
51107
|
-
case 401:
|
|
51108
|
-
lines.push(
|
|
51109
|
-
"\nHint: Authentication failed. Check your credentials with 'login profile show'"
|
|
51110
|
-
);
|
|
51111
|
-
break;
|
|
51112
|
-
case 403:
|
|
51113
|
-
lines.push(
|
|
51114
|
-
"\nHint: Permission denied. You may not have access to this resource."
|
|
51115
|
-
);
|
|
51116
|
-
break;
|
|
51117
|
-
case 404:
|
|
51118
|
-
lines.push(
|
|
51119
|
-
"\nHint: Resource not found. Verify the name and namespace are correct."
|
|
51120
|
-
);
|
|
51121
|
-
break;
|
|
51122
|
-
case 409:
|
|
51123
|
-
lines.push(
|
|
51124
|
-
"\nHint: Conflict - resource may already exist or be in a conflicting state."
|
|
51125
|
-
);
|
|
51126
|
-
break;
|
|
51127
|
-
case 429:
|
|
51128
|
-
lines.push("\nHint: Rate limited. Please wait and try again.");
|
|
51129
|
-
break;
|
|
51130
|
-
case 500:
|
|
51131
|
-
case 502:
|
|
51132
|
-
case 503:
|
|
51133
|
-
lines.push(
|
|
51134
|
-
"\nHint: Server error. Please try again later or contact support."
|
|
51135
|
-
);
|
|
51136
|
-
break;
|
|
51137
|
-
}
|
|
51138
|
-
return lines.join("\n");
|
|
51139
|
-
}
|
|
51140
|
-
|
|
51141
51846
|
// src/repl/executor.ts
|
|
51142
51847
|
var BUILTIN_COMMANDS = /* @__PURE__ */ new Set([
|
|
51143
51848
|
"help",
|
|
@@ -51687,34 +52392,66 @@ function domainToResourcePath(domain) {
|
|
|
51687
52392
|
function parseCommandArgs(args) {
|
|
51688
52393
|
let name;
|
|
51689
52394
|
let namespace;
|
|
52395
|
+
let outputFormat;
|
|
52396
|
+
let spec = false;
|
|
52397
|
+
let noColor = false;
|
|
51690
52398
|
for (let i = 0; i < args.length; i++) {
|
|
51691
52399
|
const arg = args[i] ?? "";
|
|
51692
52400
|
if (arg.startsWith("--")) {
|
|
51693
|
-
const flagName = arg.slice(2);
|
|
52401
|
+
const flagName = arg.slice(2).toLowerCase();
|
|
51694
52402
|
const nextArg = args[i + 1];
|
|
51695
|
-
|
|
51696
|
-
namespace
|
|
51697
|
-
|
|
51698
|
-
|
|
51699
|
-
|
|
51700
|
-
|
|
51701
|
-
|
|
51702
|
-
|
|
52403
|
+
switch (flagName) {
|
|
52404
|
+
case "namespace":
|
|
52405
|
+
case "ns":
|
|
52406
|
+
namespace = nextArg;
|
|
52407
|
+
i++;
|
|
52408
|
+
break;
|
|
52409
|
+
case "name":
|
|
52410
|
+
name = nextArg;
|
|
52411
|
+
i++;
|
|
52412
|
+
break;
|
|
52413
|
+
case "output":
|
|
52414
|
+
if (nextArg) {
|
|
52415
|
+
outputFormat = parseOutputFormat(nextArg);
|
|
52416
|
+
i++;
|
|
52417
|
+
}
|
|
52418
|
+
break;
|
|
52419
|
+
case "spec":
|
|
52420
|
+
spec = true;
|
|
52421
|
+
break;
|
|
52422
|
+
case "no-color":
|
|
52423
|
+
noColor = true;
|
|
52424
|
+
break;
|
|
52425
|
+
default:
|
|
52426
|
+
if (nextArg && !nextArg.startsWith("--")) {
|
|
52427
|
+
i++;
|
|
52428
|
+
}
|
|
51703
52429
|
}
|
|
51704
52430
|
} else if (arg.startsWith("-")) {
|
|
51705
52431
|
const flagName = arg.slice(1);
|
|
51706
52432
|
const nextArg = args[i + 1];
|
|
51707
|
-
|
|
51708
|
-
|
|
51709
|
-
|
|
51710
|
-
|
|
51711
|
-
|
|
52433
|
+
switch (flagName) {
|
|
52434
|
+
case "n":
|
|
52435
|
+
case "ns":
|
|
52436
|
+
namespace = nextArg;
|
|
52437
|
+
i++;
|
|
52438
|
+
break;
|
|
52439
|
+
case "o":
|
|
52440
|
+
if (nextArg) {
|
|
52441
|
+
outputFormat = parseOutputFormat(nextArg);
|
|
52442
|
+
i++;
|
|
52443
|
+
}
|
|
52444
|
+
break;
|
|
52445
|
+
default:
|
|
52446
|
+
if (nextArg && !nextArg.startsWith("-")) {
|
|
52447
|
+
i++;
|
|
52448
|
+
}
|
|
51712
52449
|
}
|
|
51713
52450
|
} else if (!name) {
|
|
51714
52451
|
name = arg;
|
|
51715
52452
|
}
|
|
51716
52453
|
}
|
|
51717
|
-
return { name, namespace };
|
|
52454
|
+
return { name, namespace, outputFormat, spec, noColor };
|
|
51718
52455
|
}
|
|
51719
52456
|
async function executeAPICommand(session, ctx, cmd) {
|
|
51720
52457
|
const client = session.getAPIClient();
|
|
@@ -51763,8 +52500,51 @@ async function executeAPICommand(session, ctx, cmd) {
|
|
|
51763
52500
|
}
|
|
51764
52501
|
}
|
|
51765
52502
|
const canonicalDomain = resolveDomain(domain) ?? domain;
|
|
51766
|
-
const { name, namespace } = parseCommandArgs(args);
|
|
52503
|
+
const { name, namespace, outputFormat, spec, noColor } = parseCommandArgs(args);
|
|
51767
52504
|
const effectiveNamespace = namespace ?? session.getNamespace();
|
|
52505
|
+
if (spec) {
|
|
52506
|
+
const commandPath = `${canonicalDomain} ${action}`;
|
|
52507
|
+
const cmdSpec = getCommandSpec(commandPath);
|
|
52508
|
+
if (cmdSpec) {
|
|
52509
|
+
return {
|
|
52510
|
+
output: [formatSpec(cmdSpec)],
|
|
52511
|
+
shouldExit: false,
|
|
52512
|
+
shouldClear: false,
|
|
52513
|
+
contextChanged: false
|
|
52514
|
+
};
|
|
52515
|
+
}
|
|
52516
|
+
const basicSpec = {
|
|
52517
|
+
command: `${CLI_NAME} ${canonicalDomain} ${action}`,
|
|
52518
|
+
description: `Execute ${action} on ${canonicalDomain} resources`,
|
|
52519
|
+
usage: `${CLI_NAME} ${canonicalDomain} ${action} [name] [options]`,
|
|
52520
|
+
flags: [
|
|
52521
|
+
{
|
|
52522
|
+
name: "--namespace",
|
|
52523
|
+
alias: "-ns",
|
|
52524
|
+
type: "string",
|
|
52525
|
+
description: "Target namespace"
|
|
52526
|
+
},
|
|
52527
|
+
{
|
|
52528
|
+
name: "--output",
|
|
52529
|
+
alias: "-o",
|
|
52530
|
+
type: "string",
|
|
52531
|
+
description: "Output format (json, yaml, table)"
|
|
52532
|
+
},
|
|
52533
|
+
{
|
|
52534
|
+
name: "--name",
|
|
52535
|
+
type: "string",
|
|
52536
|
+
description: "Resource name"
|
|
52537
|
+
}
|
|
52538
|
+
],
|
|
52539
|
+
outputFormats: ["table", "json", "yaml"]
|
|
52540
|
+
};
|
|
52541
|
+
return {
|
|
52542
|
+
output: [JSON.stringify(basicSpec, null, 2)],
|
|
52543
|
+
shouldExit: false,
|
|
52544
|
+
shouldClear: false,
|
|
52545
|
+
contextChanged: false
|
|
52546
|
+
};
|
|
52547
|
+
}
|
|
51768
52548
|
const resourcePath = domainToResourcePath(canonicalDomain);
|
|
51769
52549
|
let apiPath = `/api/config/namespaces/${effectiveNamespace}/${resourcePath}`;
|
|
51770
52550
|
try {
|
|
@@ -51849,8 +52629,8 @@ async function executeAPICommand(session, ctx, cmd) {
|
|
|
51849
52629
|
};
|
|
51850
52630
|
}
|
|
51851
52631
|
}
|
|
51852
|
-
const
|
|
51853
|
-
const formatted = formatOutput(result,
|
|
52632
|
+
const effectiveFormat = outputFormat ?? session.getOutputFormat();
|
|
52633
|
+
const formatted = formatOutput(result, effectiveFormat, noColor);
|
|
51854
52634
|
return {
|
|
51855
52635
|
output: formatted ? [formatted] : ["(no output)"],
|
|
51856
52636
|
shouldExit: false,
|
|
@@ -52241,7 +53021,7 @@ var program2 = new Command();
|
|
|
52241
53021
|
program2.configureHelp({
|
|
52242
53022
|
formatHelp: () => formatRootHelp().join("\n")
|
|
52243
53023
|
});
|
|
52244
|
-
program2.name(CLI_NAME).description("F5 Distributed Cloud Shell - Interactive CLI for F5 XC").version(CLI_VERSION, "-v, --version", "Show version number").option("--no-color", "Disable color output").option("--logo <mode>", "Logo display mode: image, ascii, none").option("-h, --help", "Show help").argument("[command...]", "Command to execute non-interactively").allowUnknownOption(true).helpOption(false).action(
|
|
53024
|
+
program2.name(CLI_NAME).description("F5 Distributed Cloud Shell - Interactive CLI for F5 XC").version(CLI_VERSION, "-v, --version", "Show version number").option("--no-color", "Disable color output").option("--logo <mode>", "Logo display mode: image, ascii, none").option("-o, --output <format>", "Output format (json, yaml, table)").option("--spec", "Output command specification as JSON (for AI)").option("-h, --help", "Show help").argument("[command...]", "Command to execute non-interactively").allowUnknownOption(true).helpOption(false).action(
|
|
52245
53025
|
async (commandArgs, options) => {
|
|
52246
53026
|
if (options.help && commandArgs.length === 0) {
|
|
52247
53027
|
formatRootHelp().forEach((line) => console.log(line));
|
|
@@ -52253,6 +53033,12 @@ program2.name(CLI_NAME).description("F5 Distributed Cloud Shell - Interactive CL
|
|
|
52253
53033
|
if (options.logo && commandArgs.length > 0) {
|
|
52254
53034
|
commandArgs.push("--logo", options.logo);
|
|
52255
53035
|
}
|
|
53036
|
+
if (options.output && commandArgs.length > 0) {
|
|
53037
|
+
commandArgs.push("--output", options.output);
|
|
53038
|
+
}
|
|
53039
|
+
if (options.spec && commandArgs.length > 0) {
|
|
53040
|
+
commandArgs.push("--spec");
|
|
53041
|
+
}
|
|
52256
53042
|
if (commandArgs.length === 0) {
|
|
52257
53043
|
if (!process.stdin.isTTY) {
|
|
52258
53044
|
console.error(
|
|
@@ -52269,6 +53055,32 @@ program2.name(CLI_NAME).description("F5 Distributed Cloud Shell - Interactive CL
|
|
|
52269
53055
|
await session.initialize();
|
|
52270
53056
|
process.stdout.write("\r\x1B[K");
|
|
52271
53057
|
renderBanner(cliLogoMode, "startup");
|
|
53058
|
+
const profiles = await session.getProfileManager().list();
|
|
53059
|
+
const envConfigured = process.env[`${ENV_PREFIX}_API_URL`] && process.env[`${ENV_PREFIX}_API_TOKEN`];
|
|
53060
|
+
if (profiles.length === 0 && !envConfigured) {
|
|
53061
|
+
console.log("");
|
|
53062
|
+
console.log(
|
|
53063
|
+
`${colors.yellow}No connection profiles found.${colors.reset}`
|
|
53064
|
+
);
|
|
53065
|
+
console.log("");
|
|
53066
|
+
console.log(
|
|
53067
|
+
"Create a profile to connect to F5 Distributed Cloud:"
|
|
53068
|
+
);
|
|
53069
|
+
console.log("");
|
|
53070
|
+
console.log(
|
|
53071
|
+
` ${colors.blue}login profile create${colors.reset} <name> --url <api-url> --token <api-token>`
|
|
53072
|
+
);
|
|
53073
|
+
console.log("");
|
|
53074
|
+
console.log("Or set environment variables:");
|
|
53075
|
+
console.log("");
|
|
53076
|
+
console.log(
|
|
53077
|
+
` ${colors.blue}export ${ENV_PREFIX}_API_URL${colors.reset}=https://tenant.console.ves.volterra.io`
|
|
53078
|
+
);
|
|
53079
|
+
console.log(
|
|
53080
|
+
` ${colors.blue}export ${ENV_PREFIX}_API_TOKEN${colors.reset}=<your-api-token>`
|
|
53081
|
+
);
|
|
53082
|
+
console.log("");
|
|
53083
|
+
}
|
|
52272
53084
|
process.stdin.resume();
|
|
52273
53085
|
const appProps = { initialSession: session };
|
|
52274
53086
|
render_default(/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(App2, { ...appProps }));
|