Package org.machanism.machai.cli
Class BindexCommand
java.lang.Object
org.machanism.machai.cli.BindexCommand
Shell command for creating and registering Bindex files using GenAI.
Provides CLI access to bindex generation and registration logic.
Usage Example:
BindexCommand cmd = new BindexCommand();
cmd.bindex(new File("/myapp/"), true, false);
- Since:
- 0.0.2
- Author:
- Viktor Tovstyi
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) org.jline.reader.LineReaderJLine line reader for shell interaction. -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
reader
@Autowired @Lazy org.jline.reader.LineReader readerJLine line reader for shell interaction.
-
-
Constructor Details
-
BindexCommand
public BindexCommand()
-
-
Method Details
-
bindex
@ShellMethod("Generates bindex files.") public void bindex(@ShellOption(help="The path to the project directory.",value="dir",defaultValue="__NULL__") File dir, @ShellOption(help="The update mode: all saved data will be updated.",value="update",defaultValue="true") boolean update, @ShellOption(help="Specifies the GenAI service provider and model (e.g., `OpenAI:gpt-5.1`). If `--genai` is empty, the default model \'OpenAI:gpt-5-mini\' will be used.",value="genai",defaultValue="None") String chatModel) throws IOException Generates bindex files for the given directory using GenAI provider.- Parameters:
dir- The directory to scan for bindex creationupdate- Update mode: all saved data will be updatedchatModel- GenAI service provider/model (default is Ghostwriter.CHAT_MODEL)- Throws:
IOException- if scan or creation fails
-
register
@ShellMethod("Registers bindex file.") public void register(@ShellOption(help="The path to the project directory.",value="dir",defaultValue="__NULL__") File dir, @ShellOption(value="registerUrl",defaultValue="__NULL__",help="URL of the register database for storing project metadata.",optOut=true) String registerUrl, @ShellOption(help="The update mode: all saved data will be updated.",value="update",defaultValue="true") boolean update) throws IOException Registers bindex file for the given directory using GenAI provider.- Parameters:
dir- The directory to register bindex fromupdate- Update mode: all saved data will be updated- Throws:
IOException- if registration fails
-