Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions crates/aenv/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ enum Cmd {
/// Download a file from a sandbox
Download(commands::download::Args),
/// Generate shell completion scripts
#[command(hide = true)]
Completion(commands::completion::Args),
/// Attach an interactive shell to a running sandbox
#[command(visible_alias = "cn")]
Expand Down
65 changes: 0 additions & 65 deletions docs/src/getting-started/aenv-cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -274,68 +274,3 @@ aenv snapshot list --sandbox-id <sandbox-id>
The table output includes an `IMAGE REF` column (`-` when no image was published); JSON output includes the optional `imageRef` field.

To delete a snapshot, use `aenv template delete <snapshot-id>` or `aenv template delete <name>` — snapshots share the same underlying store as templates and are deleted through the same command.

---

## Shell completion

`aenv completion <shell>` prints a shell-completion script for the `aenv` CLI to stdout.

### Generate and install a script

#### Bash

```bash
mkdir -p ~/.local/share/bash-completion/completions
aenv completion bash > ~/.local/share/bash-completion/completions/aenv
```

The Bash completion file is loaded on demand by
[`bash-completion`](https://github.com/scop/bash-completion).
This requires `bash-completion` to be installed and initialized in the current
shell.

#### Zsh

```zsh
mkdir -p ~/.local/share/zsh/site-functions
aenv completion zsh > ~/.local/share/zsh/site-functions/_aenv
```

Zsh loads completion functions from directories listed in `fpath`.
`~/.local/share/zsh/site-functions` is not included in `fpath` by default on
all systems. Add the following lines to `~/.zshrc` before any existing
`compinit` invocation:

```zsh
fpath=(~/.local/share/zsh/site-functions $fpath)
autoload -Uz compinit
compinit
```

#### Fish

```shell
mkdir -p ~/.config/fish/completions
aenv completion fish > ~/.config/fish/completions/aenv.fish
```

### Activate without installing

To test completion for the current shell session without saving a generated
file:

```bash
source <(aenv completion bash) # Bash
eval "$(aenv completion zsh)" # Zsh
aenv completion fish | source # Fish
```

Once loaded, completion covers the CLI surface:

```bash
aenv <TAB> # top-level commands
aenv snapshot <TAB> # nested subcommands (create, list, ...)
aenv list --output <TAB> # enum values: table, json
aenv build ./<TAB> # local path arguments
```
Loading