Initial upload: shell-speak CLI tool with natural language to shell command conversion
Some checks failed
CI / test (push) Has been cancelled
CI / build (push) Has been cancelled

This commit is contained in:
2026-01-31 05:31:10 +00:00
parent 6dbc46bb16
commit ee47ae0ba8

30
shell_speak/config.py Normal file
View File

@@ -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"]