Class ToolLookup

java.lang.Object
io.github.jbastgen.stemma.app.ai.ToolLookup

public final class ToolLookup extends Object
Finds a program for the local AI tool. An application that was started from the desktop (the Finder, the Dock, a launcher) has a short PATH that does not hold what the user's shell adds in .zshrc or .profile: ~/.local/bin, Homebrew, npm and so on. So when a program is not on the PATH of this process, the PATH of the user's login shell and a few usual folders are searched as well, and a tool that is started gets that wider PATH, because many tools (a node script behind claude, for example) need to find more programs themselves.
  • Method Summary

    Modifier and Type
    Method
    Description
    static Optional<Path>
    find(String name)
    The program for a name: the first executable of that name on the PATH of this process, else on the PATH of the user's login shell or in the usual folders.
    static Optional<Path>
    onPath(String name)
    The first executable called name (with the usual Windows extensions) on the PATH of this process only.
    static String
    The folders to search and to give to a tool: this process's PATH first, then the login shell's, then the usual folders.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • onPath

      public static Optional<Path> onPath(String name)
      The first executable called name (with the usual Windows extensions) on the PATH of this process only.
    • find

      public static Optional<Path> find(String name)
      The program for a name: the first executable of that name on the PATH of this process, else on the PATH of the user's login shell or in the usual folders.
    • searchPath

      public static String searchPath()
      The folders to search and to give to a tool: this process's PATH first, then the login shell's, then the usual folders.