get_command_help
Retrieve detailed help information about command capabilities and usage within the secure cmd-line-mcp server environment.
Instructions
Get detailed help about command capabilities and usage.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- temp/src/cmd_line_mcp/server.py:404-480 (handler)The implementation of the `get_command_help` tool, which retrieves command capabilities, restrictions, and usage examples.
async def get_command_help() -> Dict[str, Any]: """ Get detailed help about command capabilities and usage. This tool provides comprehensive information about: - Supported commands in each category (read, write, system) - Blocked commands for security reasons - Command chaining capabilities (pipes, semicolons, ampersands) - Usage restrictions and examples Returns: A dictionary with detailed information about command capabilities and usage """ # Get the latest command lists and separator support command_lists = self.config.get_effective_command_lists() separator_support = self.config.has_separator_support() # Log the separator support for debugging logger.info(f"Separator support status: {separator_support}") logger.info( f"allow_command_separators setting: {self.config.get('security', 'allow_command_separators')}" ) # Extra check for pipe character in dangerous patterns pipe_in_patterns = any( "|" in p or r"\|" in p for p in command_lists["dangerous_patterns"] ) logger.info( f"Pipe character found in dangerous patterns: {pipe_in_patterns}" ) # Update capabilities updated_capabilities = { "supported_commands": { "read": command_lists["read"], "write": command_lists["write"], "system": command_lists["system"], }, "blocked_commands": command_lists["blocked"], "command_chaining": { "pipe": ( "Supported" if separator_support["pipe"] else "Not supported" ), "semicolon": ( "Supported" if separator_support["semicolon"] else "Not supported" ), "ampersand": ( "Supported" if separator_support["ampersand"] else "Not supported" ), }, "command_restrictions": "Special characters like $(), ${}, backticks, and I/O redirection are blocked", } # Provide helpful information for Claude to understand command usage return { "capabilities": updated_capabilities, "examples": self.usage_examples, "recommended_approach": { "finding_large_files": "Use 'du -h <directory>/* | sort -hr | head -n 10' to find the 10 largest files", "file_searching": "Use 'find <directory> -type f -name \"pattern\"' for file searches", "text_searching": "Use 'grep \"pattern\" <file>' to search in files", "file_viewing": "Use 'cat', 'head', or 'tail' for viewing files", "sorting": "Use 'sort' with options like -n (numeric), -r (reverse), -h (human readable sizes)", "text_processing": "Use 'awk' for advanced text processing. For example: 'ls -la | awk \"{print $1, $9}\"' to show permissions and filenames", "column_filtering": "Use 'awk' to filter by column values: 'cat data.txt | awk \"{if($3 > 100) print}\"' to show lines where column 3 exceeds 100", }, "permissions": { "read_commands": "Can be executed without confirmation", "write_commands": "Require approval for first use in a session", "system_commands": "Require approval for first use in a session", }, }