From ee47ae0ba8f699fade448c6129aabc8635a2d29d Mon Sep 17 00:00:00 2001 From: 7000pctAUTO Date: Sat, 31 Jan 2026 05:31:10 +0000 Subject: [PATCH] Initial upload: shell-speak CLI tool with natural language to shell command conversion --- shell_speak/config.py | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 shell_speak/config.py diff --git a/shell_speak/config.py b/shell_speak/config.py new file mode 100644 index 0000000..77e2950 --- /dev/null +++ b/shell_speak/config.py @@ -0,0 +1,30 @@ +"""Configuration module for shell-speak.""" + +import os +from pathlib import Path +from typing import Optional + + +def get_data_dir() -> Path: + """Get the data directory for shell-speak.""" + return Path(os.environ.get("SHELL_SPEAK_DATA_DIR", "~/.local/share/shell-speak")).expanduser() + + +def get_history_file() -> Path: + """Get the path to the command history file.""" + return Path(os.environ.get("SHELL_SPEAK_HISTORY_FILE", "~/.local/share/shell-speak/history.json")).expanduser() + + +def get_corrections_file() -> Path: + """Get the path to the user corrections file.""" + return Path(os.environ.get("SHELL_SPEAK_CORRECTIONS_FILE", "~/.local/share/shell-speak/corrections.json")).expanduser() + + +def ensure_data_dir() -> Path: + """Ensure the data directory exists.""" + data_dir = get_data_dir() + data_dir.mkdir(parents=True, exist_ok=True) + return data_dir + + +DEFAULT_TOOLS = ["docker", "kubectl", "git", "unix"]