Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Discovering and inspecting recipes from the command line #36

Open
ttk opened this issue Jun 19, 2023 · 1 comment
Open

Discovering and inspecting recipes from the command line #36

ttk opened this issue Jun 19, 2023 · 1 comment

Comments

@ttk
Copy link

ttk commented Jun 19, 2023

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.

  • lando recipe ls - can be run outside of any project dir. Note: this is sort of available via lando init --help | grep ' --recipe'.
  • lando recipe inspect symfony - can be run outside of any project dir
  • lando recipe inspect - inspect the current recipe used

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.

@ttk ttk added the feature label Jun 19, 2023
@pirog pirog transferred this issue from lando/lando Jun 20, 2023
@pirog
Copy link
Member

pirog commented Jun 20, 2023

@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...

  • Not hide underlying recipe config for services, tooling, etc. They will be surfaced in a .lando.RECIPENAME.yaml file that will live in your repo. This way you can see the underlying config and edit it as you see fit.
  • Have a developer plugin you can toggle that will provide extra commands that are useful for developers
  • Have a definitive "developer docs/guides" site so you can learn how to create your own recipes, services, plugins etc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants