@@ -5,6 +5,8 @@ sidebar_class_name: command
5
5
description : Use this command to generate completion scripts for `Bash`, `Zsh`, `Fish` and `PowerShell`.
6
6
---
7
7
import Screengrab from ' @site/src/components/Screengrab'
8
+ import Tabs from ' @theme/Tabs' ;
9
+ import TabItem from ' @theme/TabItem' ;
8
10
9
11
:::note Purpose
10
12
Use this command to generate completion scripts for ` Bash ` , ` Zsh ` , ` Fish ` and ` PowerShell ` .
@@ -29,6 +31,71 @@ Run `atmos completion --help` to see all the available options
29
31
:::
30
32
31
33
34
+
35
+ <Tabs >
36
+ <TabItem value = " bash" label = " Bash" default >
37
+ ## Bash Completion Setup
38
+
39
+ To enable tab completion for Atmos in ` bash ` , follow the steps given bellow
40
+
41
+ ``` bash
42
+ # execute and capture the autocompletion script
43
+ atmos completion bash & > ~ /.atmos_completion.sh
44
+
45
+ # add the permissions
46
+ chmod +x ~ /.atmos_completion.sh
47
+ ```
48
+
49
+ Add the following line to your ` .bashrc `
50
+ ``` bash
51
+ source ~ /.atmos_completion.sh
52
+ ```
53
+
54
+ After saving the file, apply the changes by running:
55
+ ``` bash
56
+ source ~ /.bashrc
57
+ ```
58
+
59
+ Now, pressing ` <Tab> ` after atmos will display available subcommands.
60
+
61
+ </TabItem >
62
+ <TabItem value = " zsh" name = " Zsh" >
63
+
64
+ ## Zsh Completion Setup
65
+
66
+ To enable tab completion for Atmos in ` Zsh ` , add the following to your ` ~/.zshrc ` :
67
+
68
+ ``` zsh
69
+ # Initialize Zsh completion system
70
+ autoload -Uz compinit && compinit
71
+
72
+ # Enable Atmos CLI completion
73
+ source <( atmos completion zsh)
74
+
75
+ # Improve completion behavior
76
+ zstyle ' :completion:*' menu select # Enable menu selection
77
+ zstyle ' :completion:*' force-list always # Force vertical menu listing
78
+
79
+ # Ensure the Tab key triggers autocompletion
80
+ bindkey ' \t' expand-or-complete
81
+ ` ` `
82
+
83
+ After saving the file, apply the changes by running:
84
+
85
+ ` ` ` zsh
86
+ source ~ /.zshrc
87
+ ` ` `
88
+
89
+ Now, pressing ` < Tab> ` after atmos will display available subcommands.
90
+
91
+ If completions do not work, try regenerating the completion cache:
92
+
93
+ ` ` ` zsh
94
+ rm -f ~ /.zcompdump; compinit
95
+ ` ` `
96
+ < /TabItem>
97
+ < /Tabs>
98
+
32
99
# ## Examples
33
100
34
101
` ` ` shell
0 commit comments