@robinmordasiewicz/f5xc-xcsh 6.23.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/README.md +206 -0
- package/completions/_xcsh +219 -0
- package/completions/xcsh.bash +70 -0
- package/completions/xcsh.fish +602 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +52539 -0
- package/package.json +89 -0
package/README.md
ADDED
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
# xcsh
|
|
2
|
+
|
|
3
|
+
F5 Distributed Cloud Shell - A command-line interface for managing F5 Distributed Cloud resources.
|
|
4
|
+
|
|
5
|
+
## Documentation
|
|
6
|
+
|
|
7
|
+
Full documentation is available at **[robinmordasiewicz.github.io/f5xc-xcsh](https://robinmordasiewicz.github.io/f5xc-xcsh)**
|
|
8
|
+
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
11
|
+
### Homebrew
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
brew tap robinmordasiewicz/tap
|
|
15
|
+
brew install --cask xcsh
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
### Install Script
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
curl -fsSL https://raw.githubusercontent.com/robinmordasiewicz/f5xc-xcsh/main/install.sh | sh
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Usage
|
|
25
|
+
|
|
26
|
+
### Basic Command Structure
|
|
27
|
+
|
|
28
|
+
The CLI is organized around **domains** matching F5 Distributed Cloud API structure:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
xcsh <domain> <operation> <resource-type> [resource-name] [flags]
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### Domain-Based Commands
|
|
35
|
+
|
|
36
|
+
Common domains include:
|
|
37
|
+
|
|
38
|
+
| Domain | Alias | Purpose |
|
|
39
|
+
|--------|-------|---------|
|
|
40
|
+
| `load_balancer` | `lb` | Load balancing and origin pools |
|
|
41
|
+
| `infrastructure` | `infra` | Core infrastructure resources |
|
|
42
|
+
| `security` | `sec` | WAF, DDoS, bot defense |
|
|
43
|
+
| `networking` | `net` | Network routing and configuration |
|
|
44
|
+
| `observability` | `obs`, `o11y` | Monitoring and observability |
|
|
45
|
+
| `api_security` | `apisec` | API protection and security |
|
|
46
|
+
| `identity` | `iam` | Identity and access management |
|
|
47
|
+
|
|
48
|
+
### Examples
|
|
49
|
+
|
|
50
|
+
#### List Resources
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
# List HTTP load balancers in default namespace
|
|
54
|
+
xcsh load_balancer list http_loadbalancer
|
|
55
|
+
|
|
56
|
+
# Using alias for shorter command
|
|
57
|
+
xcsh lb list http_loadbalancer
|
|
58
|
+
|
|
59
|
+
# List in specific namespace
|
|
60
|
+
xcsh lb list http_loadbalancer -n production
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
#### Get a Specific Resource
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
# Get a load balancer configuration
|
|
67
|
+
xcsh load_balancer get http_loadbalancer example-lb
|
|
68
|
+
|
|
69
|
+
# Get from specific namespace
|
|
70
|
+
xcsh lb get http_loadbalancer example-lb -n production
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
#### Create a Resource
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
# Create from YAML file
|
|
77
|
+
xcsh load_balancer create http_loadbalancer -i lb-config.yaml
|
|
78
|
+
|
|
79
|
+
# Create from inline JSON
|
|
80
|
+
xcsh lb create origin_pool --json-data '{"metadata":{"name":"example-pool"},...}'
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
#### Delete a Resource
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
# Delete with confirmation
|
|
87
|
+
xcsh load_balancer delete http_loadbalancer example-lb
|
|
88
|
+
|
|
89
|
+
# Delete without confirmation (for scripts)
|
|
90
|
+
xcsh lb delete http_loadbalancer example-lb --yes
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
#### Apply (Create or Update)
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
# Apply from YAML (creates if not exists, updates if does)
|
|
97
|
+
xcsh load_balancer apply http_loadbalancer -i lb-config.yaml
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
#### Get Help
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
# Show available domains
|
|
104
|
+
xcsh --help
|
|
105
|
+
|
|
106
|
+
# Show domain-specific operations
|
|
107
|
+
xcsh load_balancer --help
|
|
108
|
+
|
|
109
|
+
# Show operation-specific help
|
|
110
|
+
xcsh load_balancer list --help
|
|
111
|
+
|
|
112
|
+
# Show resource-type help
|
|
113
|
+
xcsh load_balancer list http_loadbalancer --help
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
## Development & Domain System
|
|
117
|
+
|
|
118
|
+
### Automated Domain Synchronization
|
|
119
|
+
|
|
120
|
+
xcsh uses an **automated CI/CD-driven system** to keep domain definitions synchronized with upstream F5 Distributed Cloud API changes. This ensures the CLI always reflects the latest API structure without manual intervention.
|
|
121
|
+
|
|
122
|
+
#### How It Works
|
|
123
|
+
|
|
124
|
+
1. **Daily Checks**: GitHub Actions workflow (`sync-upstream-specs.yml`) checks for new upstream spec versions daily at 6 AM UTC
|
|
125
|
+
2. **Automatic Regeneration**: When updates are detected, the system:
|
|
126
|
+
- Downloads latest enriched API specifications
|
|
127
|
+
- Regenerates domain and resource registries
|
|
128
|
+
- Validates code quality and tests pass
|
|
129
|
+
- Creates a pull request with all changes
|
|
130
|
+
3. **Idempotent Generation**: Code generation is deterministic - running it twice with identical inputs produces byte-for-byte identical output
|
|
131
|
+
4. **CI/CD Validation**: Every commit validates that generated files match upstream specs and are reproducible
|
|
132
|
+
|
|
133
|
+
#### Domain Registry
|
|
134
|
+
|
|
135
|
+
The domain registry (`pkg/types/domains_generated.go`) is **automatically generated** from upstream API specifications (``.specs/index.json`). It currently contains **40 domains** organized by functional area:
|
|
136
|
+
|
|
137
|
+
- **Infrastructure**: cloud_infrastructure, site, site_management, container_services
|
|
138
|
+
- **Security**: waf, bot_and_threat_defense, network_security
|
|
139
|
+
- **Networking**: network, dns, network_connectivity, vpn
|
|
140
|
+
- **Observability**: observability_and_analytics, telemetry_and_insights, statistics
|
|
141
|
+
- **Identity**: identity, user_and_account_management, users
|
|
142
|
+
- **And 24 more...**
|
|
143
|
+
|
|
144
|
+
#### Manual Domain Configuration
|
|
145
|
+
|
|
146
|
+
Team-specific domain customization is managed in `.specs/domain_config.yaml`:
|
|
147
|
+
|
|
148
|
+
```yaml
|
|
149
|
+
# Domain aliases (short command shortcuts)
|
|
150
|
+
aliases:
|
|
151
|
+
load_balancer: [lb]
|
|
152
|
+
security: [sec]
|
|
153
|
+
networking: [net]
|
|
154
|
+
infrastructure: [infra]
|
|
155
|
+
|
|
156
|
+
# Deprecated domains with migration guidance
|
|
157
|
+
deprecated_domains:
|
|
158
|
+
config:
|
|
159
|
+
maps_to: system
|
|
160
|
+
reason: "Configuration management merged into system domain"
|
|
161
|
+
deprecated_since: "v1.0.25"
|
|
162
|
+
|
|
163
|
+
# Missing metadata requiring upstream attention
|
|
164
|
+
missing_metadata:
|
|
165
|
+
- domain: api_security
|
|
166
|
+
missing_field: "is_preview"
|
|
167
|
+
reason: "Need to mark preview/beta domains"
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
This file is **version-controlled** and survives automated spec updates, allowing teams to maintain consistent domain aliases across releases.
|
|
171
|
+
|
|
172
|
+
#### For Developers
|
|
173
|
+
|
|
174
|
+
To regenerate domain definitions:
|
|
175
|
+
|
|
176
|
+
```bash
|
|
177
|
+
# Full generation pipeline
|
|
178
|
+
make generate
|
|
179
|
+
|
|
180
|
+
# Just regenerate domains
|
|
181
|
+
make generate-domains
|
|
182
|
+
|
|
183
|
+
# Verify idempotency (CI safety check)
|
|
184
|
+
make ci-generate
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
The generation pipeline:
|
|
188
|
+
|
|
189
|
+
1. Downloads latest specs via `scripts/download-specs.sh`
|
|
190
|
+
2. Runs `scripts/generate-domains.go` to create domain registry
|
|
191
|
+
3. Runs `scripts/generate-schemas.go` to create resource schemas
|
|
192
|
+
4. Validates against `scripts/validate-specs.go`
|
|
193
|
+
|
|
194
|
+
#### Upstream Spec Quality
|
|
195
|
+
|
|
196
|
+
When spec organization issues are detected, the system can automatically report them to the upstream repository. Use the GitHub issue template to report specification problems:
|
|
197
|
+
|
|
198
|
+
- Missing metadata fields
|
|
199
|
+
- Resource classification issues
|
|
200
|
+
- Domain organization concerns
|
|
201
|
+
|
|
202
|
+
See `.github/ISSUE_TEMPLATE/upstream-spec-quality.md` for the standardized reporting format.
|
|
203
|
+
|
|
204
|
+
## License
|
|
205
|
+
|
|
206
|
+
This project is open source. See the LICENSE file for details.
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
#compdef xcsh
|
|
2
|
+
# zsh completion for xcsh
|
|
3
|
+
# Generated by xcsh completion zsh
|
|
4
|
+
|
|
5
|
+
_xcsh() {
|
|
6
|
+
local curcontext="$curcontext" state line
|
|
7
|
+
typeset -A opt_args
|
|
8
|
+
|
|
9
|
+
local -a global_opts
|
|
10
|
+
global_opts=(
|
|
11
|
+
'(-h --help)'{-h,--help}'[Show help information]'
|
|
12
|
+
'(-v --version)'{-v,--version}'[Show version number]'
|
|
13
|
+
'(-i --interactive)'{-i,--interactive}'[Force interactive mode]'
|
|
14
|
+
'--no-color[Disable color output]'
|
|
15
|
+
'(-o --output)'{-o,--output}'[Output format]:format:(json yaml table)'
|
|
16
|
+
'(-ns --namespace)'{-ns,--namespace}'[Namespace]:namespace:_xcsh_namespaces'
|
|
17
|
+
)
|
|
18
|
+
|
|
19
|
+
_arguments -C \
|
|
20
|
+
"${global_opts[@]}" \
|
|
21
|
+
'1: :->domain' \
|
|
22
|
+
'2: :->action' \
|
|
23
|
+
'*: :->args'
|
|
24
|
+
|
|
25
|
+
case $state in
|
|
26
|
+
(domain)
|
|
27
|
+
local -a domains builtins
|
|
28
|
+
domains=(
|
|
29
|
+
'admin_console_and_ui:Static UI component and console asset management'
|
|
30
|
+
'api:API discovery, security testing, and credential management'
|
|
31
|
+
'authentication:Authentication API'
|
|
32
|
+
'bigip:BigIP appliance management, iRules, and data groups'
|
|
33
|
+
'billing_and_usage:Subscription billing, payment methods, and usage tracking'
|
|
34
|
+
'blindfold:Secret encryption and policy-based data protection'
|
|
35
|
+
'bot_and_threat_defense:Bot detection, threat categorization, and defense management'
|
|
36
|
+
'cdn:CDN load balancing, caching rules, and content delivery'
|
|
37
|
+
'ce_management:Customer Edge site lifecycle and network configuration'
|
|
38
|
+
'certificates:SSL/TLS certificate and trusted CA management'
|
|
39
|
+
'cloud_infrastructure:Multi-cloud provider connectivity and credential management'
|
|
40
|
+
'cloudstatus:F5 XC service status and incidents'
|
|
41
|
+
'completion:Shell completion script generation'
|
|
42
|
+
'container_services:Edge container workloads and virtual Kubernetes management'
|
|
43
|
+
'data_and_privacy_security:Sensitive data detection, classification, and privacy...'
|
|
44
|
+
'data_intelligence:Data Intelligence API'
|
|
45
|
+
'ddos:DDoS protection and infrastructure security policies'
|
|
46
|
+
'dns:DNS zone management, load balancing, and record...'
|
|
47
|
+
'generative_ai:AI-powered features, assistants, and data collection'
|
|
48
|
+
'login:Authentication and session management'
|
|
49
|
+
'managed_kubernetes:Kubernetes RBAC, pod security, and container registries'
|
|
50
|
+
'marketplace:Third-party integrations, add-ons, and extensions'
|
|
51
|
+
'network:BGP routing, IPsec tunnels, and network connectivity'
|
|
52
|
+
'network_security:Network firewall, NAT, ACL, and policy-based routing'
|
|
53
|
+
'nginx_one:NGINX One platform integration and instance management'
|
|
54
|
+
'object_storage:Object storage for mobile SDK artifacts and integrations'
|
|
55
|
+
'observability:Synthetic monitoring, health checks, and observability...'
|
|
56
|
+
'rate_limiting:Traffic rate limiting, policers, and throttling controls'
|
|
57
|
+
'secops_and_incident_response:Malicious user detection and automated threat mitigation'
|
|
58
|
+
'service_mesh:Service mesh connectivity, discovery, and NFV management'
|
|
59
|
+
'shape:Bot defense and threat prevention with Shape Security'
|
|
60
|
+
'sites:Multi-cloud site deployment and edge infrastructure'
|
|
61
|
+
'statistics:Flow statistics, alerts, logs, and operational analytics'
|
|
62
|
+
'subscription:xcsh-specific subscription management commands (overview, quota analysis, validation)'
|
|
63
|
+
'support:Customer support ticket lifecycle and site diagnostics'
|
|
64
|
+
'telemetry_and_insights:Telemetry And Insights API'
|
|
65
|
+
'tenant_and_identity:User settings, notifications, sessions, and identity...'
|
|
66
|
+
'threat_campaign:Threat Campaign API'
|
|
67
|
+
'users:User accounts, tokens, and label management'
|
|
68
|
+
'virtual:HTTP/HTTPS load balancing and traffic management'
|
|
69
|
+
'vpm_and_node_management:Vpm And Node Management API'
|
|
70
|
+
'waf:Web application firewall rules and security policies'
|
|
71
|
+
'apisec:Alias for api'
|
|
72
|
+
'api-discovery:Alias for api'
|
|
73
|
+
'authn:Alias for authentication'
|
|
74
|
+
'oidc:Alias for authentication'
|
|
75
|
+
'sso:Alias for authentication'
|
|
76
|
+
'f5-bigip:Alias for bigip'
|
|
77
|
+
'irule:Alias for bigip'
|
|
78
|
+
'ltm:Alias for bigip'
|
|
79
|
+
'bf:Alias for blindfold'
|
|
80
|
+
'encrypt:Alias for blindfold'
|
|
81
|
+
'secrets:Alias for blindfold'
|
|
82
|
+
'cache:Alias for cdn'
|
|
83
|
+
'content:Alias for cdn'
|
|
84
|
+
'cert:Alias for certificates'
|
|
85
|
+
'certs:Alias for certificates'
|
|
86
|
+
'ssl:Alias for certificates'
|
|
87
|
+
'tls:Alias for certificates'
|
|
88
|
+
'cloud:Alias for cloud_infrastructure'
|
|
89
|
+
'infra:Alias for cloud_infrastructure'
|
|
90
|
+
'provider:Alias for cloud_infrastructure'
|
|
91
|
+
'vk8s:Alias for container_services'
|
|
92
|
+
'containers:Alias for container_services'
|
|
93
|
+
'workloads:Alias for container_services'
|
|
94
|
+
'di:Alias for data_intelligence'
|
|
95
|
+
'intelligence:Alias for data_intelligence'
|
|
96
|
+
'insights:Alias for data_intelligence'
|
|
97
|
+
'dos:Alias for ddos'
|
|
98
|
+
'ddos-protect:Alias for ddos'
|
|
99
|
+
'dns-zone:Alias for dns'
|
|
100
|
+
'zones:Alias for dns'
|
|
101
|
+
'ai:Alias for generative_ai'
|
|
102
|
+
'genai:Alias for generative_ai'
|
|
103
|
+
'assistant:Alias for generative_ai'
|
|
104
|
+
'mk8s:Alias for managed_kubernetes'
|
|
105
|
+
'appstack:Alias for managed_kubernetes'
|
|
106
|
+
'k8s-mgmt:Alias for managed_kubernetes'
|
|
107
|
+
'market:Alias for marketplace'
|
|
108
|
+
'addons:Alias for marketplace'
|
|
109
|
+
'extensions:Alias for marketplace'
|
|
110
|
+
'net:Alias for network'
|
|
111
|
+
'routing:Alias for network'
|
|
112
|
+
'bgp:Alias for network'
|
|
113
|
+
'netsec:Alias for network_security'
|
|
114
|
+
'nfw:Alias for network_security'
|
|
115
|
+
'nginx:Alias for nginx_one'
|
|
116
|
+
'nms:Alias for nginx_one'
|
|
117
|
+
'nginx-plus:Alias for nginx_one'
|
|
118
|
+
'storage:Alias for object_storage'
|
|
119
|
+
's3:Alias for object_storage'
|
|
120
|
+
'buckets:Alias for object_storage'
|
|
121
|
+
'obs:Alias for observability'
|
|
122
|
+
'monitoring:Alias for observability'
|
|
123
|
+
'synth:Alias for observability'
|
|
124
|
+
'ratelimit:Alias for rate_limiting'
|
|
125
|
+
'throttle:Alias for rate_limiting'
|
|
126
|
+
'policer:Alias for rate_limiting'
|
|
127
|
+
'mesh:Alias for service_mesh'
|
|
128
|
+
'svc-mesh:Alias for service_mesh'
|
|
129
|
+
'shape-sec:Alias for shape'
|
|
130
|
+
'safeap:Alias for shape'
|
|
131
|
+
'site:Alias for sites'
|
|
132
|
+
'deployment:Alias for sites'
|
|
133
|
+
'stats:Alias for statistics'
|
|
134
|
+
'metrics:Alias for statistics'
|
|
135
|
+
'logs:Alias for statistics'
|
|
136
|
+
'tickets:Alias for support'
|
|
137
|
+
'help-desk:Alias for support'
|
|
138
|
+
'telemetry:Alias for telemetry_and_insights'
|
|
139
|
+
'ti:Alias for telemetry_and_insights'
|
|
140
|
+
'threats:Alias for threat_campaign'
|
|
141
|
+
'campaigns:Alias for threat_campaign'
|
|
142
|
+
'threat-intel:Alias for threat_campaign'
|
|
143
|
+
'user:Alias for users'
|
|
144
|
+
'accounts:Alias for users'
|
|
145
|
+
'iam:Alias for users'
|
|
146
|
+
'lb:Alias for virtual'
|
|
147
|
+
'loadbalancer:Alias for virtual'
|
|
148
|
+
'vhost:Alias for virtual'
|
|
149
|
+
'vpm:Alias for vpm_and_node_management'
|
|
150
|
+
'nodes:Alias for vpm_and_node_management'
|
|
151
|
+
'node-mgmt:Alias for vpm_and_node_management'
|
|
152
|
+
'firewall:Alias for waf'
|
|
153
|
+
'appfw:Alias for waf'
|
|
154
|
+
)
|
|
155
|
+
builtins=(
|
|
156
|
+
'help:Show help information'
|
|
157
|
+
'quit:Exit the shell'
|
|
158
|
+
'exit:Exit the shell'
|
|
159
|
+
'clear:Clear the screen'
|
|
160
|
+
'history:Show command history'
|
|
161
|
+
'context:Show current navigation context'
|
|
162
|
+
'ctx:Show current navigation context'
|
|
163
|
+
)
|
|
164
|
+
_describe -t domains 'domain' domains
|
|
165
|
+
_describe -t builtins 'builtin' builtins
|
|
166
|
+
;;
|
|
167
|
+
(action)
|
|
168
|
+
case ${line[1]} in
|
|
169
|
+
(login)
|
|
170
|
+
_values 'command' 'show:Command' 'profile:Subcommand group' 'context:Subcommand group'
|
|
171
|
+
;;
|
|
172
|
+
(cloudstatus)
|
|
173
|
+
_values 'command' 'status:Command' 'summary:Command' 'components:Command' 'incidents:Command' 'maintenance:Command'
|
|
174
|
+
;;
|
|
175
|
+
(completion)
|
|
176
|
+
_values 'command' 'bash:Command' 'zsh:Command' 'fish:Command'
|
|
177
|
+
;;
|
|
178
|
+
(help|quit|exit|clear|history|context|ctx)
|
|
179
|
+
;;
|
|
180
|
+
(*)
|
|
181
|
+
local -a actions
|
|
182
|
+
actions=(
|
|
183
|
+
'list:List resources'
|
|
184
|
+
'get:Get a specific resource'
|
|
185
|
+
'create:Create a new resource'
|
|
186
|
+
'delete:Delete a resource'
|
|
187
|
+
'replace:Replace a resource'
|
|
188
|
+
'apply:Apply configuration from file'
|
|
189
|
+
'status:Get resource status'
|
|
190
|
+
'patch:Patch a resource'
|
|
191
|
+
'add-labels:Add labels to a resource'
|
|
192
|
+
'remove-labels:Remove labels from a resource'
|
|
193
|
+
)
|
|
194
|
+
_describe -t actions 'action' actions
|
|
195
|
+
;;
|
|
196
|
+
esac
|
|
197
|
+
;;
|
|
198
|
+
(args)
|
|
199
|
+
local -a action_opts
|
|
200
|
+
action_opts=(
|
|
201
|
+
'(-n --name)'{-n,--name}'[Resource name]:name:'
|
|
202
|
+
'(-ns --namespace)'{-ns,--namespace}'[Namespace]:namespace:_xcsh_namespaces'
|
|
203
|
+
'(-o --output)'{-o,--output}'[Output format]:format:(json yaml table)'
|
|
204
|
+
'--limit[Maximum results]:limit:'
|
|
205
|
+
'--label[Filter by label]:label:'
|
|
206
|
+
'(-f --file)'{-f,--file}'[Configuration file]:file:_files'
|
|
207
|
+
)
|
|
208
|
+
_arguments "${action_opts[@]}"
|
|
209
|
+
;;
|
|
210
|
+
esac
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
_xcsh_namespaces() {
|
|
214
|
+
local -a namespaces
|
|
215
|
+
namespaces=('default' 'system' 'shared')
|
|
216
|
+
_describe -t namespaces 'namespace' namespaces
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
_xcsh "$@"
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# bash completion for xcsh
|
|
2
|
+
# Generated by xcsh completion bash
|
|
3
|
+
# shellcheck disable=SC2034,SC2207
|
|
4
|
+
|
|
5
|
+
_xcsh_completions() {
|
|
6
|
+
local cur prev words cword
|
|
7
|
+
_init_completion || return
|
|
8
|
+
|
|
9
|
+
local commands="admin_console_and_ui api authentication bigip billing_and_usage blindfold bot_and_threat_defense cdn ce_management certificates cloud_infrastructure cloudstatus completion container_services data_and_privacy_security data_intelligence ddos dns generative_ai login managed_kubernetes marketplace network network_security nginx_one object_storage observability rate_limiting secops_and_incident_response service_mesh shape sites statistics subscription support telemetry_and_insights tenant_and_identity threat_campaign users virtual vpm_and_node_management waf apisec api-discovery authn oidc sso f5-bigip irule ltm bf encrypt secrets cache content cert certs ssl tls cloud infra provider vk8s containers workloads di intelligence insights dos ddos-protect dns-zone zones ai genai assistant mk8s appstack k8s-mgmt market addons extensions net routing bgp netsec nfw nginx nms nginx-plus storage s3 buckets obs monitoring synth ratelimit throttle policer mesh svc-mesh shape-sec safeap site deployment stats metrics logs tickets help-desk telemetry ti threats campaigns threat-intel user accounts iam lb loadbalancer vhost vpm nodes node-mgmt firewall appfw help quit exit clear history"
|
|
10
|
+
local actions="list get create delete replace apply status patch add-labels remove-labels"
|
|
11
|
+
local builtins="help quit exit clear history context ctx"
|
|
12
|
+
local global_flags="--help -h --version -v --interactive -i --no-color --output -o --namespace -ns"
|
|
13
|
+
|
|
14
|
+
# Handle completion based on position
|
|
15
|
+
case ${cword} in
|
|
16
|
+
1)
|
|
17
|
+
# First word: domains, builtins, or flags
|
|
18
|
+
if [[ "${cur}" == -* ]]; then
|
|
19
|
+
COMPREPLY=($(compgen -W "${global_flags}" -- "${cur}"))
|
|
20
|
+
else
|
|
21
|
+
COMPREPLY=($(compgen -W "${commands} ${builtins}" -- "${cur}"))
|
|
22
|
+
fi
|
|
23
|
+
return 0
|
|
24
|
+
;;
|
|
25
|
+
2)
|
|
26
|
+
# Second word: actions or subcommands based on first word
|
|
27
|
+
local domain="${words[1]}"
|
|
28
|
+
case "${domain}" in
|
|
29
|
+
login)
|
|
30
|
+
COMPREPLY=($(compgen -W "show profile context" -- "${cur}"))
|
|
31
|
+
return 0
|
|
32
|
+
;;
|
|
33
|
+
login/profile)
|
|
34
|
+
COMPREPLY=($(compgen -W "list show create use delete" -- "${cur}"))
|
|
35
|
+
return 0
|
|
36
|
+
;;
|
|
37
|
+
login/context)
|
|
38
|
+
COMPREPLY=($(compgen -W "show set list" -- "${cur}"))
|
|
39
|
+
return 0
|
|
40
|
+
;;
|
|
41
|
+
cloudstatus)
|
|
42
|
+
COMPREPLY=($(compgen -W "status summary components incidents maintenance" -- "${cur}"))
|
|
43
|
+
return 0
|
|
44
|
+
;;
|
|
45
|
+
completion)
|
|
46
|
+
COMPREPLY=($(compgen -W "bash zsh fish" -- "${cur}"))
|
|
47
|
+
return 0
|
|
48
|
+
;;
|
|
49
|
+
help | quit | exit | clear | history | context | ctx)
|
|
50
|
+
return 0
|
|
51
|
+
;;
|
|
52
|
+
*)
|
|
53
|
+
# API domain - suggest actions
|
|
54
|
+
COMPREPLY=($(compgen -W "${actions}" -- "${cur}"))
|
|
55
|
+
return 0
|
|
56
|
+
;;
|
|
57
|
+
esac
|
|
58
|
+
;;
|
|
59
|
+
*)
|
|
60
|
+
# Third+ word: flags
|
|
61
|
+
if [[ "${cur}" == -* ]]; then
|
|
62
|
+
local action_flags="--name -n --namespace -ns --output -o --json --yaml --limit --label"
|
|
63
|
+
COMPREPLY=($(compgen -W "${action_flags}" -- "${cur}"))
|
|
64
|
+
fi
|
|
65
|
+
return 0
|
|
66
|
+
;;
|
|
67
|
+
esac
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
complete -F _xcsh_completions xcsh
|