Skip to content

Add --allow-env and --block-env options for limactl shell #4263

@jandubois

Description

@jandubois

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:

limactl shell --allow-env "GITHUB_TOKEN" default gh ...
limactl shell --block-env "PRIVATE*" default ...

would be equivalent to

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:

LIMA_SHELLENV_BLOCK="+PRIVATE*" limactl shell --preserve-env default ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/clilimactl CLI user experience

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions