Skip to content

Commit 631f8ce

Browse files
authored
Merge pull request #184 from annkots/master
TCR-869: Add docs for `imunify360-agent completions <shell>` — …
2 parents 9692c00 + a863111 commit 631f8ce

1 file changed

Lines changed: 66 additions & 0 deletions

File tree

docs/command_line_interface/README.md

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ Available commands:
6969
|[<span class="notranslate">`check-domains`</span>](/command_line_interface/#check-domains)|Send domain list check|
7070
|[<span class="notranslate">`check modsec directives`</span>](/command_line_interface/#check-modsec-directives)|Allows to check whether the global ModSecurity<br>directives have values recommended by Imunify360|
7171
|[<span class="notranslate">`clean`</span>](/command_line_interface/#clean)|Clean the incidents|
72+
|[<span class="notranslate">`completions`</span>](/command_line_interface/#completions)|Generate shell auto-completion scripts (bash/zsh/fish)|
7273
|[<span class="notranslate">`config`</span>](/command_line_interface/#config)|Allows to update and show configuration file via CLI|
7374
|[<span class="notranslate">`doctor`</span>](/command_line_interface/#doctor)|Collect info about system and send it to the Imunify support team|
7475
|[<span class="notranslate">`eula`</span>](/command_line_interface/#eula)|Allows to show and accept the end-user license agreement to automate installation|
@@ -467,6 +468,71 @@ The following command deletes all incidents that are older than 5 days from toda
467468

468469
</div>
469470

471+
## Completions
472+
473+
Prints a shell auto-completion script for <span class="notranslate">`imunify360-agent`</span> to stdout. Once installed, it enables tab-completion for all subcommands and flags.
474+
475+
Supported shells: <span class="notranslate">`bash`</span>, <span class="notranslate">`zsh`</span>, <span class="notranslate">`fish`</span>.
476+
477+
:::tip Note
478+
The command runs locally and does not require the Imunify360 agent service to be running.
479+
:::
480+
481+
**Usage:**
482+
483+
<div class="notranslate">
484+
485+
```
486+
imunify360-agent completions <shell>
487+
```
488+
489+
</div>
490+
491+
<span class="notranslate">`shell`</span> is a positional argument and can be:
492+
493+
| | |
494+
|-|-|
495+
|<span class="notranslate">`bash`</span>|Generate completion script for Bash|
496+
|<span class="notranslate">`zsh`</span>|Generate completion script for Zsh|
497+
|<span class="notranslate">`fish`</span>|Generate completion script for Fish|
498+
499+
**Installation examples:**
500+
501+
1. Install for <span class="notranslate">Bash</span> (system-wide):
502+
503+
<div class="notranslate">
504+
505+
```
506+
imunify360-agent completions bash | sudo tee /etc/bash_completion.d/imunify360-agent > /dev/null
507+
```
508+
509+
</div>
510+
511+
Start a new shell session afterwards for completions to take effect.
512+
513+
2. Install for <span class="notranslate">Zsh</span> (per-user):
514+
515+
<div class="notranslate">
516+
517+
```
518+
mkdir -p ~/.zsh/completions
519+
imunify360-agent completions zsh > ~/.zsh/completions/_imunify360-agent
520+
```
521+
522+
</div>
523+
524+
Ensure <span class="notranslate">`~/.zsh/completions`</span> is on your <span class="notranslate">`fpath`</span> and <span class="notranslate">`compinit`</span> is loaded in your <span class="notranslate">`~/.zshrc`</span>.
525+
526+
3. Install for <span class="notranslate">Fish</span> (per-user):
527+
528+
<div class="notranslate">
529+
530+
```
531+
imunify360-agent completions fish > ~/.config/fish/completions/imunify360-agent.fish
532+
```
533+
534+
</div>
535+
470536
## Config
471537

472538
Allows to update and show configuration file via CLI.

0 commit comments

Comments
 (0)