Class DevCliInstaller

java.lang.Object
com.vaadin.flow.plugin.base.DevCliInstaller

public final class DevCliInstaller extends Object
Installs the vaadin-dev CLI and its agent skills into a project.

The payload ships as classpath resources of this module - the one that already holds logic shared by the Maven and Gradle plugins - so a future Gradle task reads the same bytes from the same jar. Nothing generated and no jars are copied: the CLI resolves the dev-loop daemon from the project's own dependencies at first use.

Everything is installed relative to one directory, and the two skill trees are installed as siblings, because the Claude adapter links to the shared instructions by relative path.

All of it is meant to be committed by the developer: it is project tooling, like mvnw, and the point is that every agent and every developer on the repository gets the same instructions.

For internal use only. May be renamed or removed in a future release.

  • Method Details

    • install

      public static DevCliInstaller.Result install(Path targetDirectory) throws IOException
      Installs the CLI and the skills under the given directory.

      The CLI goes into .vaadin/, the directory Vaadin already owns in a project: the dev-loop daemon writes its handshake there, so keeping the scripts beside it means one hidden directory rather than a second visible one at the project root.

      A file is written whenever it is absent or differs from the shipped copy, and left alone when it already holds exactly those bytes. There is deliberately no "you edited this, so I will keep it" case: these files are project tooling, like mvnw, and regenerating them is what the goal is for. Anyone who needs project-specific agent instructions should add their own skill beside these rather than edit them, and the goal is unbound, so it only ever runs when someone asks for it.

      That also makes it self-healing. A checkout is free to hand a committed text file back with the platform's line endings, and a vaadin-dev whose shebang ends \r\n does not run on Linux or macOS; because any difference is replaced, the next run repairs it.

      Parameters:
      targetDirectory - the directory to install into, normally the application module's base directory
      Returns:
      what was written and what was already up to date
      Throws:
      IOException - if a file cannot be read or written
    • report

      public static void report(DevCliInstaller.Result result, Path targetDirectory, PluginAdapterBase adapter)
      Reports what an installation did, in the order a reader wants it: what changed, then what was left alone and why.

      Through the plugin adapter rather than a logger of its own, so the output lands in the build log the developer is already reading - the same route BuildFrontendUtil uses.

      Parameters:
      result - the installation result
      targetDirectory - the directory installed into, for relative reporting
      adapter - the plugin adapter to report through