docs(cli): add molecli shell completion guide (#79)

Pair PR: molecule-cli#5
- Adds new guides/molecli-shell-completion.md with bash/zsh/fish/PowerShell
  install instructions for molecli tab completion (Cobra-generated)
- Adds entry to guides/index.md under new "CLI Tooling" section
- Links to molecule-cli#5 for implementation details

Co-authored-by: Molecule AI Documentation Specialist <documentation-specialist@agents.moleculesai.app>
This commit is contained in:
molecule-ai[bot] 2026-04-22 23:57:38 +00:00 committed by GitHub
parent 4223530f35
commit a3e0dd07d7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 97 additions and 0 deletions

View File

@ -9,6 +9,10 @@ Step-by-step guides for common Molecule AI integrations and configurations.
- [Quickstart](/docs/quickstart) — Deploy your first AI agent in under 5 minutes.
## CLI Tooling
- [molecli Shell Completion](/docs/guides/molecli-shell-completion) — Enable tab completion for the `molecule` CLI (`molecli`) TUI dashboard in bash, zsh, fish, and PowerShell.
## Remote Agents
- [External Agent Registration](/docs/guides/external-agent-registration) — Register agents running outside the platform Docker network (on laptops, cloud VMs, edge devices) as first-class workspaces with per-workspace bearer tokens.

View File

@ -0,0 +1,93 @@
---
title: molecli Shell Completion
description: Enable tab completion for the molecli (molecule-cli) TUI dashboard in bash, zsh, fish, and PowerShell.
---
# molecli Shell Completion
The `molecule` CLI (`molecli`) supports shell completion for bash, zsh, fish, and PowerShell. Completion scripts are auto-generated by [Cobra](https://github.com/spf13/cobra) and cover all subcommands and flags.
## Install
### bash
Add to `~/.bashrc` or `~/.bash_completion.d/`:
```bash
source <(molecule completion bash)
```
Or source from your profile:
```bash
# In ~/.bash_profile or ~/.bashrc
[[ -f ~/.bash_completion ]] && source ~/.bash_completion
source <(molecule completion bash)
```
### zsh
Add to `~/.zshrc`:
```bash
autoload -U compinit && compinit
autoload -Uz bashcompinit && bashcompinit
source <(molecule completion zsh)
compdef _molecule molecule
```
Completion will activate automatically after restarting your shell or running `source ~/.zshrc`.
### fish
```fish
molecule completion fish | source
```
To persist across sessions, add the line above to `~/.config/fish/config.fish`.
### PowerShell
Add to your PowerShell profile (`$PROFILE`):
```powershell
molecule completion powershell | Out-String | Invoke-Expression
```
To find and edit your profile:
```powershell
Split-Path $PROFILE
code $PROFILE # or your preferred editor
```
## Supported Shells
| Shell | Flag | Install target |
|-------|------|----------------|
| bash | `bash` | `~/.bashrc` |
| zsh | `zsh` | `~/.zshrc` |
| fish | `fish` | `~/.config/fish/config.fish` |
| PowerShell | `powershell` | `$PROFILE` |
## Verifying
After sourcing, test by typing a partial command:
```bash
molecule <TAB><TAB>
```
You should see available subcommands: `completion`, `workspace`, `config`, etc.
## Reference
```
molecule completion [bash|zsh|fish|powershell]
```
- `bash` — Bash completions (~/.bashrc)
- `zsh` — Zsh completions with compdef (~/.zshrc)
- `fish` — Fish shell completions (~/.config/fish/completions)
- `powershell` — PowerShell completions ($PROFILE)
See [`molecule-cli` PR #5](https://github.com/Molecule-AI/molecule-cli/pull/5) for implementation details.