From e15575cde65521ed5441f54aa2e3dfeb3d987dbc Mon Sep 17 00:00:00 2001 From: Sam Tholiya Date: Sat, 8 Feb 2025 21:37:30 +0100 Subject: [PATCH] updated doc --- .../{completion/usage.mdx => completion.mdx} | 67 +++++++++++++++++++ .../cli/commands/completion/_category_.json | 11 --- .../completion/atmos-completion-bash.mdx | 32 --------- .../completion/atmos-completion-zsh.mdx | 39 ----------- 4 files changed, 67 insertions(+), 82 deletions(-) rename website/docs/cli/commands/{completion/usage.mdx => completion.mdx} (52%) delete mode 100644 website/docs/cli/commands/completion/_category_.json delete mode 100644 website/docs/cli/commands/completion/atmos-completion-bash.mdx delete mode 100644 website/docs/cli/commands/completion/atmos-completion-zsh.mdx diff --git a/website/docs/cli/commands/completion/usage.mdx b/website/docs/cli/commands/completion.mdx similarity index 52% rename from website/docs/cli/commands/completion/usage.mdx rename to website/docs/cli/commands/completion.mdx index 910ce6f0c..fd8ed2064 100644 --- a/website/docs/cli/commands/completion/usage.mdx +++ b/website/docs/cli/commands/completion.mdx @@ -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`. @@ -29,6 +31,71 @@ Run `atmos completion --help` to see all the available options ::: + + + +## Bash Completion Setup + +To enable tab completion for Atmos in `bash`, follow the steps given bellow + +```bash +# 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` +```bash +source ~/.atmos_completion.sh +``` + +After saving the file, apply the changes by running: +```bash +source ~/.bashrc +``` + +Now, pressing `` after atmos will display available subcommands. + + + + +## 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 `` after atmos will display available subcommands. + +If completions do not work, try regenerating the completion cache: + +```zsh +rm -f ~/.zcompdump; compinit +``` + + + ### Examples ```shell diff --git a/website/docs/cli/commands/completion/_category_.json b/website/docs/cli/commands/completion/_category_.json deleted file mode 100644 index dd0c762ef..000000000 --- a/website/docs/cli/commands/completion/_category_.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "label": "completion", - "position": 2, - "className": "command", - "collapsible": true, - "collapsed": true, - "link": { - "type": "doc", - "id": "usage" - } -} diff --git a/website/docs/cli/commands/completion/atmos-completion-bash.mdx b/website/docs/cli/commands/completion/atmos-completion-bash.mdx deleted file mode 100644 index a20dcb367..000000000 --- a/website/docs/cli/commands/completion/atmos-completion-bash.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -title: atmos completion bash -sidebar_label: bash -sidebar_class_name: command -description: Use this command to generate completion scripts for `Bash` ---- - - -## 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 `` after atmos will display available subcommands. - diff --git a/website/docs/cli/commands/completion/atmos-completion-zsh.mdx b/website/docs/cli/commands/completion/atmos-completion-zsh.mdx deleted file mode 100644 index ed27633ba..000000000 --- a/website/docs/cli/commands/completion/atmos-completion-zsh.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -title: atmos completion bash -sidebar_label: zsh -sidebar_class_name: command -description: Use this command to generate completion scripts for `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 `` after atmos will display available subcommands. - -If completions do not work, try regenerating the completion cache: - -```zsh -rm -f ~/.zcompdump; compinit -``` \ No newline at end of file