Class AddTaskHeaderCommand

java.lang.Object
eu.svjatoslav.alyverkko_cli.commands.AddTaskHeaderCommand
All Implemented Interfaces:
Command

public class AddTaskHeaderCommand extends Object implements Command
This command recursively adds a TOCOMPUTE header to all non-hidden files in the current directory that do not already have one. It prompts the user for skill, model, priority values, and optional custom processing instructions, validates their existence in the configuration, and then processes the files accordingly.

Usage:

   alyverkko-cli addheader
 
The command will interactively prompt for: - Skill name (must exist in skills directory) - Model alias (must exist in configuration models) - Priority value (integer, defaults to 0) - Custom processing instructions (optional, multi-line input; press Enter twice to finish)

After validation, it will process all non-hidden files in the current directory and subdirectories, adding the TOCOMPUTE header followed by custom instructions (if provided) and the original content.

  • Constructor Details

    • AddTaskHeaderCommand

      public AddTaskHeaderCommand()
  • Method Details

    • getCommandName

      public String getCommandName()
      Specified by:
      getCommandName in interface Command
      Returns:
      the subcommand's name.
    • executeCommand

      public void executeCommand(String[] cliArguments) throws IOException, InterruptedException
      Executes the addheader command. Loads configuration, prompts user for skill, model, priority, and optional custom instructions, validates them, and processes all files in the current directory recursively.
      Specified by:
      executeCommand in interface Command
      Parameters:
      cliArguments - command-line arguments (unused in this command)
      Throws:
      IOException - if file operations fail
      InterruptedException - if interrupted during processing