Class RuntimeFileWriter

java.lang.Object
com.google.genkit.RuntimeFileWriter

public class RuntimeFileWriter extends Object
RuntimeFileWriter writes runtime discovery files for the Genkit Dev UI. The Dev UI discovers running Genkit instances by looking for JSON files in the .genkit/runtimes directory.
  • Constructor Details

    • RuntimeFileWriter

      public RuntimeFileWriter()
  • Method Details

    • write

      public static void write(int port, String runtimeId)
      Writes a runtime file for Dev UI discovery. Uses findProjectRoot() to locate the project root by searching up for pom.xml.
      Parameters:
      port - the reflection server port
      runtimeId - the runtime ID from the reflection server
    • writeRuntimeFile

      public static void writeRuntimeFile(int port, String projectRoot, String runtimeId)
      Writes a runtime file for Dev UI discovery.
      Parameters:
      port - the reflection server port
      projectRoot - the project root directory
      runtimeId - the runtime ID
    • cleanup

      public static void cleanup()
      Cleans up the runtime file using the current directory as project root.
    • removeRuntimeFile

      public static void removeRuntimeFile(String projectRoot)
      Removes the runtime file.
      Parameters:
      projectRoot - the project root directory