Class ToolsRemove
java.lang.Object
ai.wanaku.cli.main.commands.BaseCommand
ai.wanaku.cli.main.commands.tools.ToolsRemove
CLI command for removing tool references from the Wanaku router.
This command supports two removal modes:
- Single removal by name: Remove a specific tool using
--namewanaku tools remove --name my-tool
- Batch removal by label expression: Remove multiple tools matching a label filter
wanaku tools remove --label-expression 'category=weather'
wanaku tools remove -l 'environment!=production' -y
Label Expression Syntax:
The --label-expression option supports complex filtering using logical operators.
For detailed syntax and examples, see the label expression manual page:
wanaku man label-expression
Safety Features:
- Mutual exclusivity between
--nameand--label-expression - Preview table showing tools before batch removal
- Confirmation prompt (can be bypassed with
--assume-yes) - Clear feedback on removal results
Warning: Removal operations cannot be undone. Removed tools are unregistered from the tool manager and deleted from the repository.
- See Also:
-
Field Summary
FieldsFields inherited from class ai.wanaku.cli.main.commands.BaseCommand
authTokenOverride, EXIT_ERROR, EXIT_OK, noAuth -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoCall(org.jline.terminal.Terminal terminal, WanakuPrinter printer) Executes the tool removal command.Methods inherited from class ai.wanaku.cli.main.commands.BaseCommand
call, initAuthenticatedService, initService, initService
-
Field Details
-
host
-
-
Constructor Details
-
ToolsRemove
public ToolsRemove()
-
-
Method Details
-
doCall
Executes the tool removal command.This method validates the command-line arguments and delegates to either
removeByName(WanakuPrinter)orremoveByLabelExpression(Terminal, WanakuPrinter)depending on which option was provided.The method enforces mutual exclusivity between
--nameand--label-expressionoptions, ensuring exactly one removal method is specified.- Specified by:
doCallin classBaseCommand- Parameters:
terminal- the terminal for user interactionprinter- the printer for displaying messages to the user- Returns:
BaseCommand.EXIT_OKif removal succeeded,BaseCommand.EXIT_ERRORif it failed or validation errors occurred- Throws:
Exception- if an unexpected error occurs during command execution
-