Skip to content

Commit 03ffa07

Browse files
authored
Merge pull request #709 from AkihiroSuda/nits-20220309
nits
2 parents 3da311b + fc72949 commit 03ffa07

File tree

3 files changed

+49
-17
lines changed

3 files changed

+49
-17
lines changed

README.md

Lines changed: 44 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -140,46 +140,73 @@ INFO[0029] READY. Run `lima` to open the shell.
140140
Linux
141141
```
142142

143-
Detailed usage:
143+
### Command reference
144144

145-
- Run `limactl start <INSTANCE> [--tty=false]` to start the Linux instance.
146-
The default instance name is "default".
147-
Wait until "READY" to be printed on the host terminal.
148-
`--tty=false` disables the interactive prompt to open an editor.
145+
#### `limactl start`
146+
`limactl start [--name=NAME] [--tty=false] <template://TEMPLATE>`: start the Linux instance
149147

150-
```
151-
To create an instance "default" (if not created yet) from the default Ubuntu template, and start it:
148+
```console
152149
$ limactl start
150+
? Creating an instance "default" [Use arrows to move, type to filter]
151+
> Proceed with the current configuration
152+
Open an editor to review or modify the current configuration
153+
Choose another example (docker, podman, archlinux, fedora, ...)
154+
Exit
155+
...
156+
INFO[0029] READY. Run `lima` to open the shell.
157+
```
158+
159+
Choose `Proceed with the current configuration`, and wait until "READY" to be printed on the host terminal.
160+
For automation, `--tty=false` flag can be used for disabling the interactive user interface.
153161

162+
##### Advanced usage
154163
To create an instance "default" from a template "docker":
164+
```console
155165
$ limactl start --name=default template://docker
166+
```
167+
168+
> NOTE: `limactl start template://TEMPLATE` requires Lima v0.9.0 or later.
169+
> Older releases require `limactl start /usr/local/share/doc/lima/examples/TEMPLATE.yaml` instead.
156170
157171
To see the template list:
172+
```console
158173
$ limactl start --list-templates
174+
```
159175

160176
To create an instance "default" from a local file:
177+
```console
161178
$ limactl start --name=default /usr/local/share/lima/examples/fedora.yaml
179+
```
162180

163181
To create an instance "default" from a remote URL (use carefully, with a trustable source):
182+
```console
164183
$ limactl start --name=default https://raw.githubusercontent.com/lima-vm/lima/master/examples/alpine.yaml
165184
```
166-
NOTE: `limactl start template://TEMPLATE` requires Lima v0.9.0 or later.
167-
Older releases require `limactl start /usr/local/share/doc/lima/examples/TEMPLATE.yaml` instead.
168185

169-
- Run `limactl shell <INSTANCE> <COMMAND>` to launch `<COMMAND>` on Linux.
170-
For the "default" instance, this command can be shortened as `lima <COMMAND>`.
171-
The `lima` command also accepts the instance name as the environment variable `$LIMA_INSTANCE`.
186+
#### `limactl shell`
187+
`limactl shell <INSTANCE> <COMMAND>`: launch `<COMMAND>` on Linux.
188+
189+
For the "default" instance, this command can be shortened as `lima <COMMAND>`.
190+
The `lima` command also accepts the instance name as the environment variable `$LIMA_INSTANCE`.
191+
192+
#### `limactl copy`
193+
`limactl copy <SOURCE> ... <TARGET>`: copy files between instances, or between instances and the host
172194

173-
- Run `limactl copy <SOURCE> ... <TARGET>` to copy files between instances, or between instances and the host. Use `<INSTANCE>:<FILENAME>` to specify a source or target inside an instance.
195+
Use `<INSTANCE>:<FILENAME>` to specify a source or target inside an instance.
174196

175-
- Run `limactl list [--json]` to show the instances.
197+
#### `limactl list`
198+
`limactl list [--json]`: show the instances
176199

177-
- Run `limactl stop [--force] <INSTANCE>` to stop the instance.
200+
#### `limactl stop`
201+
`limactl stop [--force] <INSTANCE>`: stop the instance
178202

179-
- Run `limactl delete [--force] <INSTANCE>` to delete the instance.
203+
#### `limactl delete`
204+
`limactl delete [--force] <INSTANCE>`: delete the instance
180205

181-
- Run `limactl edit <INSTANCE>` to edit the instance.
206+
#### `limactl edit`
207+
`limactl edit <INSTANCE>`: edit the instance
182208

209+
#### `limactl completion`
183210
- To enable bash completion, add `source <(limactl completion bash)` to `~/.bash_profile`.
184211

185212
- To enable zsh completion, see `limactl completion zsh --help`

examples/oraclelinux.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# This example requires Lima v0.9.0 or later.
12
# Oracle image licence: https://www.oracle.com/downloads/licenses/oracle-linux-license.html
23
# Image source: https://yum.oracle.com/oracle-linux-templates.html
34
arch: "x86_64"

pkg/store/store.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package store
22

33
import (
4+
"errors"
45
"os"
56
"path/filepath"
67
"strings"
@@ -18,6 +19,9 @@ func Instances() ([]string, error) {
1819
}
1920
limaDirList, err := os.ReadDir(limaDir)
2021
if err != nil {
22+
if errors.Is(err, os.ErrNotExist) {
23+
return nil, nil
24+
}
2125
return nil, err
2226
}
2327
var names []string

0 commit comments

Comments
 (0)