From 2aa1ea0816351eb2250686c0fff9e4d155c3d28e Mon Sep 17 00:00:00 2001 From: 7000pctAUTO Date: Sat, 31 Jan 2026 05:31:13 +0000 Subject: [PATCH] Initial upload: shell-speak CLI tool with natural language to shell command conversion --- shell_speak/models.py | 47 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 shell_speak/models.py diff --git a/shell_speak/models.py b/shell_speak/models.py new file mode 100644 index 0000000..d53734f --- /dev/null +++ b/shell_speak/models.py @@ -0,0 +1,47 @@ +"""Data models for shell-speak.""" + +from dataclasses import dataclass, field +from datetime import datetime +from typing import Optional + + +@dataclass +class CommandPattern: + """A pattern for matching natural language to shell commands.""" + name: str + tool: str + description: str + patterns: list[str] + template: str + explanation: str = "" + examples: list[str] = field(default_factory=list) + + +@dataclass +class CommandMatch: + """A match between natural language and a shell command.""" + pattern: CommandPattern + confidence: float + matched_query: str + command: str + explanation: str + + +@dataclass +class HistoryEntry: + """An entry in the command history.""" + query: str + command: str + tool: str + timestamp: datetime + explanation: str = "" + + +@dataclass +class Correction: + """A user correction for a query.""" + original_query: str + corrected_command: str + tool: str + timestamp: datetime + explanation: str = ""