Skip to content

Commit e15575c

Browse files
committed
updated doc
1 parent f0bd5ef commit e15575c

File tree

4 files changed

+67
-82
lines changed

4 files changed

+67
-82
lines changed

website/docs/cli/commands/completion/usage.mdx renamed to website/docs/cli/commands/completion.mdx

+67
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ sidebar_class_name: command
55
description: Use this command to generate completion scripts for `Bash`, `Zsh`, `Fish` and `PowerShell`.
66
---
77
import Screengrab from '@site/src/components/Screengrab'
8+
import Tabs from '@theme/Tabs';
9+
import TabItem from '@theme/TabItem';
810

911
:::note Purpose
1012
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
2931
:::
3032

3133

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+
3299
### Examples
33100
34101
```shell

website/docs/cli/commands/completion/_category_.json

-11
This file was deleted.

website/docs/cli/commands/completion/atmos-completion-bash.mdx

-32
This file was deleted.

website/docs/cli/commands/completion/atmos-completion-zsh.mdx

-39
This file was deleted.

0 commit comments

Comments
 (0)