MCPcopy Create free account
hub / github.com/Textualize/trogon / to_cli_args

Method to_cli_args

trogon/run_command.py:80–91  ·  view source on GitHub ↗

Generates a list of strings representing the CLI invocation based on the user input data. Returns: A list of strings that can be passed to subprocess.run to execute the command.

(self, include_root_command: bool = False)

Source from the content-addressed store, hash-verified

78 command_schema: CommandSchema | None = None
79
80 def to_cli_args(self, include_root_command: bool = False) -> list[str]:
81 """
82 Generates a list of strings representing the CLI invocation based on the user input data.
83
84 Returns:
85 A list of strings that can be passed to subprocess.run to execute the command.
86 """
87 cli_args = self._to_cli_args()
88 if not include_root_command:
89 cli_args = cli_args[1:]
90
91 return cli_args
92
93 def _to_cli_args(self) -> list[str]:
94 args: list[str] = [self.name]

Callers 4

to_cli_stringMethod · 0.95
update_command_to_runMethod · 0.80

Calls 1

_to_cli_argsMethod · 0.95

Tested by 2