You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+63Lines changed: 63 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -126,6 +126,69 @@ This boots a Fedora Cloud rescue system with the target VM's disk attached as `/
126
126
127
127
On first run, a rescue image is downloaded and set up (~500MB download). The `rescue` use is logged in automatically, however both the `rescue` and `root` user have their passwords set to `rescue`.
128
128
129
+
## Shell completion
130
+
131
+
`vm` supports tab-completion for subcommands, options, and VM names. Generate a completion script for your shell and source it (or install it in your shell’s completion directory).
132
+
133
+
### Generate the script
134
+
135
+
```bash
136
+
# Auto-detect shell
137
+
vm --generate-completion-script
138
+
139
+
# Or specify the shell explicitly
140
+
vm --generate-completion-script bash
141
+
vm --generate-completion-script zsh
142
+
vm --generate-completion-script fish
143
+
```
144
+
145
+
### Bash
146
+
147
+
Append the generated script to your `~/.bashrc` or load it once:
148
+
149
+
```bash
150
+
vm --generate-completion-script bash >>~/.bashrc
151
+
# then start a new shell, or:
152
+
source~/.bashrc
153
+
```
154
+
155
+
Or install to a completions directory (e.g. on macOS with Homebrew bash):
156
+
157
+
```bash
158
+
vm --generate-completion-script bash >$(brew --prefix)/etc/bash_completion.d/vm
159
+
```
160
+
161
+
### Zsh
162
+
163
+
Load the script from your `.zshrc`:
164
+
165
+
```bash
166
+
# Add to ~/.zshrc
167
+
source<(vm --generate-completion-script zsh)
168
+
```
169
+
170
+
Or install for all users (e.g. into a site-functions directory):
171
+
172
+
```bash
173
+
vm --generate-completion-script zsh > /usr/local/share/zsh/site-functions/_vm
174
+
```
175
+
176
+
With oh-my-zsh, put the script in your completions folder:
177
+
178
+
```bash
179
+
vm --generate-completion-script zsh >~/.oh-my-zsh/completions/_vm
180
+
```
181
+
182
+
### Fish
183
+
184
+
Save the script to Fish’s completions directory:
185
+
186
+
```bash
187
+
vm --generate-completion-script fish >~/.config/fish/completions/vm.fish
188
+
```
189
+
190
+
Start a new shell or run `fish_update_completions` so Fish picks it up.
191
+
129
192
## VM Storage
130
193
131
194
VMs are stored in `~/.vm/` with each VM in its own directory:
0 commit comments