lima-vm / lima-vm/lima

Local defaults for --tty and other command line options

Open
#2,994 9 comments 1 reaction 0 assignees View on GitHub
area/cli enhancement
Dominant language
Go
Stars
21.9k
Forks
957
Avg merge
2d 6h
Merged PRs (30d)
53

Description

### Description

My workflow is:

1. Create a lima yaml, usually for testing something, by copying another yaml and editing it. I want to keep the yaml around for creating more vms later, maybe put in in version control.

2. Create the vm from the yaml

I never want to edit the yaml during creation, but I forget to add --tty=0 a lot. Editing the yaml means your changes are saved only in ~/.lima/name/lima.yaml, and I like to treat anything under ~/.lima as ephemeral.

It would be useful if --tty=false was the default, but this may not be best for everyone. Having a local default will make it easy to adapt lima to different users. This option name is also not great, it should be about editing the yaml, not about using in a terminal.

Current behavior is to default to tty=true when using in a terminal:

```go
rootCmd.PersistentFlags().Bool("tty", isatty.IsTerminal(os.Stdout.Fd()), "Enable TUI interactions such as opening an editor. Defaults to true when stdout is a terminal. Set to false for automation.")
```

We can change it to:
- read a configuration file (e.g. ~/.lima/_config/local.yaml)
- consider the local default for tty and the terminal capabilities

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.