tmuxtmuxinator

pass arguments to tmuxinator project file


I have a project file like

windows:
  - server:
      layout: even-vertical
      panes:
        - ssh -t {pass value in here} tail -f -n 100 /var/log/app.log
        - 

I would like to pass the SSH host in as I start the session. Something like

mux project for.bar

Can this be done


Solution

  • Checkout this section Tmuxinator's readme.

    You can also pass arguments to your projects, and access them with ERB. Simple arguments are available in an array named @args.

    Eg:

    $ tmuxinator start project foo

    ~/.tmuxinator/project.yml

    name: project root: ~/<%= @args[0] %>

    ... You can also pass key-value pairs using the format key=value. These will be available in a hash named @settings.

    Eg:

    $ tmuxinator start project workspace=~/workspace/todo

    ~/.tmuxinator/project.yml

    name: project root: ~/<%= @settings["workspace"] %>

    ...