Skip to content

Commit

Permalink
updated doc
Browse files Browse the repository at this point in the history
  • Loading branch information
samtholiya committed Feb 8, 2025
1 parent f0bd5ef commit 32e4f2d
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 82 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ sidebar_class_name: command
description: Use this command to generate completion scripts for `Bash`, `Zsh`, `Fish` and `PowerShell`.
---
import Screengrab from '@site/src/components/Screengrab'
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

:::note Purpose
Use this command to generate completion scripts for `Bash`, `Zsh`, `Fish` and `PowerShell`.
Expand All @@ -29,6 +31,71 @@ Run `atmos completion --help` to see all the available options
:::



<Tabs>
<TabItem value="bash" label="Bash" default>
## Bash Completion Setup

To enable tab completion for Atmos in `bash`, follow the steps given bellow

```
# execute and capture the autocompletion script
atmos completion bash &> ~/.atmos_completion.sh
# add the permissions
chmod +x ~/.atmos_completion.sh
```

Add the following line to your `.bashrc`
```
source ~/.atmos_completion.sh
```

After saving the file, apply the changes by running:
```
source ~/.bashrc
```

Now, pressing `<Tab>` after atmos will display available subcommands.

</TabItem>
<TabItem value="zsh" name="Zsh">

## Zsh Completion Setup

To enable tab completion for Atmos in `Zsh`, add the following to your `~/.zshrc`:

```zsh
# Initialize Zsh completion system
autoload -Uz compinit && compinit

# Enable Atmos CLI completion
source <(atmos completion zsh)

# Improve completion behavior
zstyle ':completion:*' menu select # Enable menu selection
zstyle ':completion:*' force-list always # Force vertical menu listing

# Ensure the Tab key triggers autocompletion
bindkey '\t' expand-or-complete
```
After saving the file, apply the changes by running:
```zsh
source ~/.zshrc
```
Now, pressing `<Tab>` after atmos will display available subcommands.
If completions do not work, try regenerating the completion cache:
```zsh
rm -f ~/.zcompdump; compinit
```
</TabItem>
</Tabs>
### Examples
```shell
Expand Down
11 changes: 0 additions & 11 deletions website/docs/cli/commands/completion/_category_.json

This file was deleted.

32 changes: 0 additions & 32 deletions website/docs/cli/commands/completion/atmos-completion-bash.mdx

This file was deleted.

39 changes: 0 additions & 39 deletions website/docs/cli/commands/completion/atmos-completion-zsh.mdx

This file was deleted.

0 comments on commit 32e4f2d

Please sign in to comment.