From f83915e0d257720759a9179bf24d65fc1254dbb8 Mon Sep 17 00:00:00 2001 From: 7000pctAUTO Date: Thu, 5 Feb 2026 20:56:11 +0000 Subject: [PATCH] Initial upload: Local LLM Prompt Manager CLI tool --- src/commands/__init__.py | 43 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 src/commands/__init__.py diff --git a/src/commands/__init__.py b/src/commands/__init__.py new file mode 100644 index 0000000..8c97b2a --- /dev/null +++ b/src/commands/__init__.py @@ -0,0 +1,43 @@ +"""CLI command utilities and base classes.""" + + +class CommandError(Exception): + """Base exception for command errors.""" + + def __init__(self, message: str, suggestion: str = None): + super().__init__(message) + self.suggestion = suggestion + + +class PromptNotFoundError(CommandError): + """Raised when a prompt is not found.""" + + def __init__(self, prompt_name: str): + super().__init__( + f"Prompt '{prompt_name}' not found", + "Use 'llm-prompt list' to see available prompts or check the prompt name spelling" + ) + self.prompt_name = prompt_name + + +class TagNotFoundError(CommandError): + """Raised when a tag is not found.""" + + def __init__(self, tag_name: str): + super().__init__( + f"Tag '{tag_name}' not found", + "Use 'llm-prompt tag list' to see available tags" + ) + self.tag_name = tag_name + + +class ConnectionError(CommandError): + """Raised when LLM connection fails.""" + + def __init__(self, provider: str, url: str): + super().__init__( + f"Failed to connect to {provider} at {url}", + "Ensure the LLM service is running and check the API URL in config" + ) + self.provider = provider + self.url = url