@@ -20,6 +20,7 @@ import (
20
20
"github.com/lima-vm/lima/pkg/limatmpl"
21
21
"github.com/lima-vm/lima/pkg/limayaml"
22
22
networks "github.com/lima-vm/lima/pkg/networks/reconcile"
23
+ "github.com/lima-vm/lima/pkg/registry"
23
24
"github.com/lima-vm/lima/pkg/store"
24
25
"github.com/lima-vm/lima/pkg/store/filenames"
25
26
"github.com/lima-vm/lima/pkg/templatestore"
@@ -31,6 +32,7 @@ func registerCreateFlags(cmd *cobra.Command, commentPrefix string) {
31
32
flags := cmd .Flags ()
32
33
flags .String ("name" , "" , commentPrefix + "Override the instance name" )
33
34
flags .Bool ("list-templates" , false , commentPrefix + "List available templates and exit" )
35
+ flags .Bool ("list-drivers" , false , commentPrefix + "List available drivers and exit" )
34
36
editflags .RegisterCreate (cmd , commentPrefix )
35
37
}
36
38
@@ -53,6 +55,9 @@ $ limactl create --set='.cpus = 2 | .memory = "2GiB"'
53
55
To see the template list:
54
56
$ limactl create --list-templates
55
57
58
+ To see the drivers list:
59
+ $ limactl create --list-drivers
60
+
56
61
To create an instance "default" from a local file:
57
62
$ limactl create --name=default /usr/local/share/lima/templates/fedora.yaml
58
63
@@ -391,6 +396,14 @@ func createStartActionCommon(cmd *cobra.Command, _ []string) (exit bool, err err
391
396
}
392
397
}
393
398
return true , nil
399
+ } else if listDrivers , err := cmd .Flags ().GetBool ("list-drivers" ); err != nil {
400
+ return true , err
401
+ } else if listDrivers {
402
+ w := cmd .OutOrStdout ()
403
+ for _ , d := range registry .DefaultRegistry .List () {
404
+ _ , _ = fmt .Fprintln (w , d )
405
+ }
406
+ return true , nil
394
407
}
395
408
return false , nil
396
409
}
0 commit comments