Skip to content

Feature Request: Allow parameters to be passed with trellis vm shell #377

@robrecord

Description

@robrecord

Terms

Summary

As I understand it, trellis vm shell is a wrapper for limactl shell <project_name>. Until recently, the lima docs incorrectly reported the order of parameters. Now it's limactl shell [<options>] <project_name> [<command>]. Could it be possiblt to allow trellis-cli to pass options such as --workdir, or even set them automatically?

So trellis vm shell would be a wrapper for limactl shell --workdir /srv/www/<project_name>/current <project_name> and would include any user-specified extra params before the <project_name>, and anything else after a --.

Hope that makes sense?

Motivation

Why are we doing this?

  1. allow directly CDing into correct dirctory
  2. allow user passing of params
  3. allow separation between params and command
  4. currently it is impossible to pass any parameters (such as workdir) to limactl

What use cases does it support?

Better use of SSH into VM

What is the expected outcome?

More control and convenience

Potential conflicts / foreseeable issues

Additional Context

lima-vm/lima#1444

with trellis:

❯ trellis vm shell --workdir /srv/www/example.com/current
Running command => limactl shell example.com --workdir /srv/www/example.com/current
bash: line 1: cd: /Users/me/Code/Projects/Sites/example.com/trellis: No such file or directory
bash: line 1: cd: /Users/me: No such file or directory
/bin/bash: --: invalid option

with limactl:

❯ limactl shell --workdir /srv/www/example.com/current example.com
me@lima-example:/srv/www/example.com/current$

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions