Class CapabilitiesShow

java.lang.Object
ai.wanaku.cli.main.commands.BaseCommand
ai.wanaku.cli.main.commands.capabilities.CapabilitiesShow
All Implemented Interfaces:
Callable<Integer>

public class CapabilitiesShow extends BaseCommand
Command implementation for displaying detailed information about specific service capabilities.

This command retrieves and displays comprehensive details about capabilities for a specified service. When multiple capabilities exist for the same service, it provides an interactive selection interface allowing users to choose which specific capability instance to examine.

The command supports filtering capabilities by service name and handles various scenarios:

  • No capabilities found - displays warning message
  • Single capability - directly shows detailed information
  • Multiple capabilities - presents interactive selection menu

Example usage:


 wanaku capabilities show http
 wanaku capabilities show --host http://remote:8080 sqs
 
Since:
1.0
Version:
1.0
Author:
Wanaku CLI Team
  • Constructor Details

    • CapabilitiesShow

      public CapabilitiesShow()
  • Method Details

    • doCall

      public Integer doCall(org.jline.terminal.Terminal terminal, WanakuPrinter printer) throws IOException, Exception
      Executes the capabilities show command.

      This method orchestrates the entire capability retrieval and display process:

      1. Initializes the targets service with the specified host
      2. Fetches all available capabilities from the API
      3. Filters capabilities by the specified service name
      4. Handles display based on the number of matching capabilities found
      Specified by:
      doCall in class BaseCommand
      Parameters:
      terminal - the terminal instance for user interaction
      printer - the printer instance for formatted output
      Returns:
      BaseCommand.EXIT_OK on successful execution, BaseCommand.EXIT_ERROR on failure
      Throws:
      IOException - if an I/O error occurs during API communication or terminal interaction
      Exception - if any other error occurs during command execution