lando / core-next

Next generation Lando v4 runtime
https://docs.lando.dev/core/v4
GNU General Public License v3.0
3 stars 4 forks source link

Discovering and inspecting recipes from the command line #36

Open ttk opened 1 year ago

ttk commented 1 year ago

I am new to lando, and I was trying to learn more about recipes/plugins so I can use them effectively. Currently, there seems to be only two ways to learn about what a recipe provides: 1) the official documentation, and 2) the plugin source code.

For example, in my case, I was trying to learn more about the Symfony recipe. The documentation page is here: https://docs.lando.dev/symfony/config.html

And the source code is here: https://github.com/lando/symfony/blob/d6dd9a440dc600495f2343fcfb3b62d500a139bf/recipes/symfony/builder.js

When an app is initialized with a specific recipe it outputs the link to the docs page: DOCS https://docs.lando.dev/config/symfony.html which is useful. However, as far as I can tell, I can't figure out how to get this link for an existing project that uses lando, and thus requires a google search to find it.

I was able to discover detailed information on the tooling commands in a project (including those provided by the recipe) via the command: lando config --format json | jq .landoFileConfig.tooling. This is useful to learn what each specific tooling command are doing under the hood. So some success here.

I wasn't able to find a cli command to list all the default config vars provided by a recipe without looking at the docs or src code.

So, to provide a better DX, I propose to add a feature that makes the recipes and what they provide more easily discoverable by lando cli cmds:

1) listing all the recipes supported by lando 2) inspecting a recipe to view the config, services, and tooling provide by a specific recipe (or if in a project directoy, the current recipe)

eg.

The inspect command should show the configs, services, and tooling (including the description, cmds, default values, link to docs, link to src code etc) for each. Ideally the output of the inspect command should be in yaml format to mirror what's used in the .lando.yml file and the documentation.

pirog commented 1 year ago

@ttk IIRC you can lando init --full and it will give you the complete lando.yml for a given recipe. Beyond that i dont think we are going to make any changes to Lando 3 at this time.

That said, Lando 4 will...