Add `--allow-env` and `--block-env` options for `limactl shell`
- Dominant language
- Go
- Stars
- 21.9k
- Forks
- 957
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 53
Description
# Copied from #4036
Optional (can be added after 2.0), but I think worthwhile and easy to implement:
* Add `--allow-env PATTERN` and `--block-env PATTERN` options to `limactl shell`.
They would (just for this command) append the pattern to the respective lists and automatically enable `--preserve-env`.
These commands:
```shell
limactl shell --allow-env "GITHUB_TOKEN" default gh ...
limactl shell --block-env "PRIVATE*" default ...
```
would be equivalent to
```shell
LIMA_SHELLENV_ALLOW="$LIMA_SHELLENV_ALLOW,GITHUB_TOKEN" limactl shell --preserve-env default gh ...
LIMA_SHELLENV_BLOCK="$LIMA_SHELLENV_BLOCK,PRIVATE*" limactl shell --preserve-env default ...
```
Except in case `LIMA_SHELLENV_BLOCK` was empty, it would be adding the pattern to the default list, not the empty list:
```shell
LIMA_SHELLENV_BLOCK="+PRIVATE*" limactl shell --preserve-env default ...
```
Contributor guide
Assessment
This issue has not been assessed yet.