Skip to content

Commit 5f0c5cf

Browse files
committed
Fish shell completions for roxctl
1 parent e463a1f commit 5f0c5cf

File tree

1 file changed

+67
-0
lines changed

1 file changed

+67
-0
lines changed

completions/fish/roxctl.fish

+67
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# Command Sets
2+
set -l base_commands central cluster collector deployment helm help image scanner sensor version
3+
set -l central_commands backup cert db debug generate init-bundles license userpki whoami
4+
set -l image_commands check scan
5+
set -l deployment_commands check
6+
set -l scanner_commands generate upload-db
7+
set -l sensor_commands generate generate-certs get-bundle
8+
9+
# Disable file completions
10+
complete -c roxctl -f
11+
12+
# Base flags
13+
complete -c roxctl -s h -l help -d "more information about a command"
14+
complete -c roxctl -s e -l endpoint -d "endpoint for service to contact"
15+
complete -c roxctl -l insecure -d "skip tls certification validation"
16+
complete -c roxctl -s p -l password -d "password for basic auth"
17+
complete -c roxctl -s e -l endpoint -d "stackrox central endpoint"
18+
complete -c roxctl -l token-file -d "use API token in the provided file"
19+
20+
21+
# Base commands
22+
complete -c roxctl -n "not __fish_seen_subcommand_from $base_commands" -a "$base_commands"
23+
24+
# Central subcommands
25+
complete -c roxctl -n "__fish_seen_subcommand_from central; and not __fish_seen_subcommand_from $central_commands" -a "backup" -d "backup the StackRox database and certificates"
26+
complete -c roxctl -n "__fish_seen_subcommand_from central; and not __fish_seen_subcommand_from $central_commands" -a "cert" -d "download certificate chain for the Central service"
27+
complete -c roxctl -n "__fish_seen_subcommand_from central; and not __fish_seen_subcommand_from $central_commands" -a "db" -d "commands related to the StackRox database"
28+
complete -c roxctl -n "__fish_seen_subcommand_from central; and not __fish_seen_subcommand_from $central_commands" -a "debug" -d "debug the Central Service"
29+
complete -c roxctl -n "__fish_seen_subcommand_from central; and not __fish_seen_subcommand_from $central_commands" -a "generate" -d "generate k8s manifests to deploy StackRox Central"
30+
complete -c roxctl -n "__fish_seen_subcommand_from central; and not __fish_seen_subcommand_from $central_commands" -a "init-bundles" -d "manage cluster init bundle"
31+
complete -c roxctl -n "__fish_seen_subcommand_from central; and not __fish_seen_subcommand_from $central_commands" -a "license" -d "add and display license information"
32+
complete -c roxctl -n "__fish_seen_subcommand_from central; and not __fish_seen_subcommand_from $central_commands" -a "userpki" -d "manage user certificate authorization providers"
33+
complete -c roxctl -n "__fish_seen_subcommand_from central; and not __fish_seen_subcommand_from $central_commands" -a "whoami" -d "info about the current user"
34+
35+
# Image flags
36+
complete -c roxctl -n "__fish_seen_subcommand_from $image_commands" -s t -l timeout -d "timeout for api requests (default 10m0s)"
37+
complete -c roxctl -n "__fish_seen_subcommand_from $image_commands" -s i -l image -d "image name and tag" -a "(docker image list --format '{{.Repository}}:{{.Tag}}')"
38+
complete -c roxctl -n "__fish_seen_subcommand_from $image_commands" -s a -l include-snoozed -d "return both snoozed and unsnoozed CVEs if set to false"
39+
40+
# Image subcommands
41+
complete -c roxctl -n "__fish_seen_subcommand_from image; and not __fish_seen_subcommand_from $image_commands" -a "check" -d "check images for build time policy violations"
42+
complete -c roxctl -n "__fish_seen_subcommand_from image; and not __fish_seen_subcommand_from $image_commands" -a "scan" -d "scan the specified images"
43+
44+
# Deployment flags
45+
complete -c roxctl -n "__fish_seen_subcommand_from $deployment_commands" -s t -l timeout -d "timeout for api requests (default 10m0s)"
46+
complete -c roxctl -n "__fish_seen_subcommand_from $deployment_commands" -s f -l file -d "evaluate policies against yaml file" -a "(find . | grep -i -e '\.y\(aml\|ml\)' | head -n 10 | sort -d -u)"
47+
48+
49+
# Deployment subcommands
50+
complete -c roxctl -n "__fish_seen_subcommand_from deployment; and not __fish_seen_subcommand_from $deployment_commands" -a "check" -d "check deployments for deploy time policy violations"
51+
52+
# Scanner flags
53+
complete -c roxctl -n "__fish_seen_subcommand_from $scanner_commands" -s t -l timeout -d "timeout for api requests (default 10m0s)"
54+
55+
# Scanner subcommands
56+
complete -c roxctl -n "__fish_seen_subcommand_from scanner; and not __fish_seen_subcommand_from $scanner_commands" -a "generate" -d "generate k8s manifests to deploy StackRox Scanner"
57+
complete -c roxctl -n "__fish_seen_subcommand_from scanner; and not __fish_seen_subcommand_from $scanner_commands" -a "upload-db" -d "upload a vulnerability database for the StackRox Scanner"
58+
59+
# Sensor flags
60+
complete -c roxctl -n "__fish_seen_subcommand_from $sensor_commands" -s t -l timeout -d "timeout for api requests (default 10m0s)"
61+
62+
# Sensor subcommands
63+
complete -c roxctl -n "__fish_seen_subcommand_from sensor; and not __fish_seen_subcommand_from $sensor_commands" -a "generate" -d "generate k8s manifests to deploy StackRox services into secured clusters"
64+
complete -c roxctl -n "__fish_seen_subcommand_from sensor; and not __fish_seen_subcommand_from $sensor_commands" -a "generate-certs" -d "download a YAML file with renewed certificates"
65+
complete -c roxctl -n "__fish_seen_subcommand_from sensor; and not __fish_seen_subcommand_from $sensor_commands" -a "get-bundle" -d "download a bundle with the files to deploy StackRox services into a cluster"
66+
67+

0 commit comments

Comments
 (0)