usecli 0.1.34__tar.gz → 0.1.35__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {usecli-0.1.34 → usecli-0.1.35}/PKG-INFO +1 -1
- {usecli-0.1.34 → usecli-0.1.35}/pyproject.toml +1 -1
- {usecli-0.1.34 → usecli-0.1.35}/src/usecli/cli/commands/init_command.py +38 -10
- {usecli-0.1.34 → usecli-0.1.35}/src/usecli/cli/config/colors.py +5 -1
- {usecli-0.1.34 → usecli-0.1.35}/src/usecli/shared/config/manager.py +7 -1
- {usecli-0.1.34 → usecli-0.1.35}/LICENSE +0 -0
- {usecli-0.1.34 → usecli-0.1.35}/README.md +0 -0
- {usecli-0.1.34 → usecli-0.1.35}/src/usecli/__init__.py +0 -0
- {usecli-0.1.34 → usecli-0.1.35}/src/usecli/cli/__init__.py +0 -0
- {usecli-0.1.34 → usecli-0.1.35}/src/usecli/cli/commands/README.md +0 -0
- {usecli-0.1.34 → usecli-0.1.35}/src/usecli/cli/commands/__init__.py +0 -0
- {usecli-0.1.34 → usecli-0.1.35}/src/usecli/cli/commands/custom/README.md +0 -0
- {usecli-0.1.34 → usecli-0.1.35}/src/usecli/cli/commands/custom/__init__.py +0 -0
- {usecli-0.1.34 → usecli-0.1.35}/src/usecli/cli/commands/defaults/__init__.py +0 -0
- {usecli-0.1.34 → usecli-0.1.35}/src/usecli/cli/commands/defaults/base/__init__.py +0 -0
- {usecli-0.1.34 → usecli-0.1.35}/src/usecli/cli/commands/defaults/base/about_command.py +0 -0
- {usecli-0.1.34 → usecli-0.1.35}/src/usecli/cli/commands/defaults/base/help_command.py +0 -0
- {usecli-0.1.34 → usecli-0.1.35}/src/usecli/cli/commands/defaults/base/inspire_command.py +0 -0
- {usecli-0.1.34 → usecli-0.1.35}/src/usecli/cli/commands/defaults/base/internal/__init__.py +0 -0
- {usecli-0.1.34 → usecli-0.1.35}/src/usecli/cli/commands/defaults/base/internal/fzf_command.py +0 -0
- {usecli-0.1.34 → usecli-0.1.35}/src/usecli/cli/commands/defaults/core/__init__.py +0 -0
- {usecli-0.1.34 → usecli-0.1.35}/src/usecli/cli/commands/defaults/core/utils.py +0 -0
- {usecli-0.1.34 → usecli-0.1.35}/src/usecli/cli/commands/defaults/make/__init__.py +0 -0
- {usecli-0.1.34 → usecli-0.1.35}/src/usecli/cli/commands/defaults/make/make_command.py +0 -0
- {usecli-0.1.34 → usecli-0.1.35}/src/usecli/cli/commands/defaults/make/make_theme_command.py +0 -0
- {usecli-0.1.34 → usecli-0.1.35}/src/usecli/cli/config/__init__.py +0 -0
- {usecli-0.1.34 → usecli-0.1.35}/src/usecli/cli/core/__init__.py +0 -0
- {usecli-0.1.34 → usecli-0.1.35}/src/usecli/cli/core/base_command.py +0 -0
- {usecli-0.1.34 → usecli-0.1.35}/src/usecli/cli/core/error/__init__.py +0 -0
- {usecli-0.1.34 → usecli-0.1.35}/src/usecli/cli/core/error/handler.py +0 -0
- {usecli-0.1.34 → usecli-0.1.35}/src/usecli/cli/core/error/utils.py +0 -0
- {usecli-0.1.34 → usecli-0.1.35}/src/usecli/cli/core/exceptions/__init__.py +0 -0
- {usecli-0.1.34 → usecli-0.1.35}/src/usecli/cli/core/exceptions/base.py +0 -0
- {usecli-0.1.34 → usecli-0.1.35}/src/usecli/cli/core/exceptions/config.py +0 -0
- {usecli-0.1.34 → usecli-0.1.35}/src/usecli/cli/core/exceptions/usage.py +0 -0
- {usecli-0.1.34 → usecli-0.1.35}/src/usecli/cli/core/exceptions/validation.py +0 -0
- {usecli-0.1.34 → usecli-0.1.35}/src/usecli/cli/core/skill_generator.py +0 -0
- {usecli-0.1.34 → usecli-0.1.35}/src/usecli/cli/core/ui/__init__.py +0 -0
- {usecli-0.1.34 → usecli-0.1.35}/src/usecli/cli/core/ui/list.py +0 -0
- {usecli-0.1.34 → usecli-0.1.35}/src/usecli/cli/core/ui/title.py +0 -0
- {usecli-0.1.34 → usecli-0.1.35}/src/usecli/cli/core/validators/__init__.py +0 -0
- {usecli-0.1.34 → usecli-0.1.35}/src/usecli/cli/core/validators/network.py +0 -0
- {usecli-0.1.34 → usecli-0.1.35}/src/usecli/cli/core/validators/numeric.py +0 -0
- {usecli-0.1.34 → usecli-0.1.35}/src/usecli/cli/core/validators/path.py +0 -0
- {usecli-0.1.34 → usecli-0.1.35}/src/usecli/cli/core/validators/string.py +0 -0
- {usecli-0.1.34 → usecli-0.1.35}/src/usecli/cli/services/__init__.py +0 -0
- {usecli-0.1.34 → usecli-0.1.35}/src/usecli/cli/services/command_service.py +0 -0
- {usecli-0.1.34 → usecli-0.1.35}/src/usecli/cli/templates/command.py.j2 +0 -0
- {usecli-0.1.34 → usecli-0.1.35}/src/usecli/cli/templates/theme.toml.j2 +0 -0
- {usecli-0.1.34 → usecli-0.1.35}/src/usecli/cli/templates/usecli.config.toml.j2 +0 -0
- {usecli-0.1.34 → usecli-0.1.35}/src/usecli/cli/themes/ayu_dark.toml +0 -0
- {usecli-0.1.34 → usecli-0.1.35}/src/usecli/cli/themes/catppuccin_frappe.toml +0 -0
- {usecli-0.1.34 → usecli-0.1.35}/src/usecli/cli/themes/catppuccin_latte.toml +0 -0
- {usecli-0.1.34 → usecli-0.1.35}/src/usecli/cli/themes/catppuccin_macchiato.toml +0 -0
- {usecli-0.1.34 → usecli-0.1.35}/src/usecli/cli/themes/catppuccin_mocha.toml +0 -0
- {usecli-0.1.34 → usecli-0.1.35}/src/usecli/cli/themes/default.toml +0 -0
- {usecli-0.1.34 → usecli-0.1.35}/src/usecli/cli/themes/dracula.toml +0 -0
- {usecli-0.1.34 → usecli-0.1.35}/src/usecli/cli/themes/gruvbox_dark.toml +0 -0
- {usecli-0.1.34 → usecli-0.1.35}/src/usecli/cli/themes/nord.toml +0 -0
- {usecli-0.1.34 → usecli-0.1.35}/src/usecli/cli/themes/tokyo_night.toml +0 -0
- {usecli-0.1.34 → usecli-0.1.35}/src/usecli/cli/usecli.config.toml +0 -0
- {usecli-0.1.34 → usecli-0.1.35}/src/usecli/cli/utils/__init__.py +0 -0
- {usecli-0.1.34 → usecli-0.1.35}/src/usecli/cli/utils/interactive/__init__.py +0 -0
- {usecli-0.1.34 → usecli-0.1.35}/src/usecli/cli/utils/interactive/terminal_menu.py +0 -0
- {usecli-0.1.34 → usecli-0.1.35}/src/usecli/menu.py +0 -0
- {usecli-0.1.34 → usecli-0.1.35}/src/usecli/params.py +0 -0
- {usecli-0.1.34 → usecli-0.1.35}/src/usecli/shared/__init__.py +0 -0
- {usecli-0.1.34 → usecli-0.1.35}/src/usecli/shared/config/__init__.py +0 -0
- {usecli-0.1.34 → usecli-0.1.35}/src/usecli/shared/config/globals.py +0 -0
- {usecli-0.1.34 → usecli-0.1.35}/src/usecli/ui.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "usecli"
|
|
3
|
-
version = "0.1.
|
|
3
|
+
version = "0.1.35"
|
|
4
4
|
description = "A powerful Python CLI framework for building beautiful, developer-friendly command-line tools."
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
authors = [{ name = "Edward Boswell", email = "thememium@gmail.com" }]
|
|
@@ -88,18 +88,10 @@ class InitCommand(BaseCommand):
|
|
|
88
88
|
|
|
89
89
|
def _write_usecli_config(
|
|
90
90
|
self,
|
|
91
|
-
|
|
91
|
+
config_path: Path,
|
|
92
92
|
config_content: str,
|
|
93
93
|
force: bool,
|
|
94
|
-
commands_path: Path,
|
|
95
94
|
) -> str:
|
|
96
|
-
config_root = project_root
|
|
97
|
-
if commands_path.parent != project_root:
|
|
98
|
-
config_root = commands_path.parent
|
|
99
|
-
config_path = config_root / USECLI_CONFIG_TOML
|
|
100
|
-
discovered_config = ConfigManager(start_dir=config_root).usecli_config_path
|
|
101
|
-
if discovered_config.exists():
|
|
102
|
-
config_path = discovered_config
|
|
103
95
|
existed = config_path.exists()
|
|
104
96
|
if existed and not force:
|
|
105
97
|
should_overwrite = Confirm.ask(
|
|
@@ -113,6 +105,14 @@ class InitCommand(BaseCommand):
|
|
|
113
105
|
config_path.write_text(config_content.rstrip() + "\n")
|
|
114
106
|
return "updated" if existed else "created"
|
|
115
107
|
|
|
108
|
+
def _resolve_config_path(self, value: str, project_root: Path) -> Path:
|
|
109
|
+
path = Path(value).expanduser()
|
|
110
|
+
if not path.is_absolute():
|
|
111
|
+
path = project_root / path
|
|
112
|
+
if path.exists() and path.is_dir():
|
|
113
|
+
return (path / USECLI_CONFIG_TOML).resolve()
|
|
114
|
+
return path.resolve()
|
|
115
|
+
|
|
116
116
|
def _ensure_project_scripts(
|
|
117
117
|
self, pyproject_path: Path, command_name: str, force: bool
|
|
118
118
|
) -> str:
|
|
@@ -716,8 +716,36 @@ include = ["{root_package}*"]
|
|
|
716
716
|
|
|
717
717
|
self._sync_environment(project_root, command_name)
|
|
718
718
|
|
|
719
|
+
config_root = project_root
|
|
720
|
+
if commands_path.parent != project_root:
|
|
721
|
+
config_root = commands_path.parent
|
|
722
|
+
existing_config = ConfigManager(start_dir=config_root).usecli_config_path
|
|
723
|
+
default_config_path = (
|
|
724
|
+
existing_config
|
|
725
|
+
if existing_config.exists()
|
|
726
|
+
else config_root / USECLI_CONFIG_TOML
|
|
727
|
+
)
|
|
728
|
+
config_location = Prompt.ask(
|
|
729
|
+
f"[bold {COLOR.SECONDARY}]Config file location[/bold {COLOR.SECONDARY}]"
|
|
730
|
+
" (path or directory)",
|
|
731
|
+
default=str(default_config_path),
|
|
732
|
+
)
|
|
733
|
+
config_path = self._resolve_config_path(config_location, project_root)
|
|
734
|
+
if (
|
|
735
|
+
existing_config.exists()
|
|
736
|
+
and config_path.resolve() != existing_config.resolve()
|
|
737
|
+
and not force
|
|
738
|
+
):
|
|
739
|
+
replace_existing = Confirm.ask(
|
|
740
|
+
f"[{COLOR.WARNING}]Existing {USECLI_CONFIG_TOML} found at {existing_config}.[/{COLOR.WARNING}]\n"
|
|
741
|
+
"Replace it instead of writing to the new location?",
|
|
742
|
+
default=False,
|
|
743
|
+
)
|
|
744
|
+
if replace_existing:
|
|
745
|
+
config_path = existing_config
|
|
746
|
+
|
|
719
747
|
usecli_config_status = self._write_usecli_config(
|
|
720
|
-
|
|
748
|
+
config_path, config_content, force
|
|
721
749
|
)
|
|
722
750
|
if usecli_config_status == "created":
|
|
723
751
|
console.print(
|
|
@@ -52,7 +52,11 @@ def _find_usecli_config_path(root_dir: Path, start_dir: Path) -> Path | None:
|
|
|
52
52
|
if not root_dir.exists() or not root_dir.is_dir():
|
|
53
53
|
return None
|
|
54
54
|
|
|
55
|
-
candidates = [
|
|
55
|
+
candidates = [
|
|
56
|
+
path
|
|
57
|
+
for path in root_dir.rglob(USECLI_CONFIG_TOML)
|
|
58
|
+
if not any(part in {".venv", "venv"} for part in path.parts)
|
|
59
|
+
]
|
|
56
60
|
if not candidates:
|
|
57
61
|
return None
|
|
58
62
|
|
|
@@ -58,6 +58,8 @@ def _dedupe_items(items: list[str]) -> list[str]:
|
|
|
58
58
|
class ConfigManager:
|
|
59
59
|
"""Manages useCli configuration from project-level files."""
|
|
60
60
|
|
|
61
|
+
_SKIP_DIRS = {".venv", "venv"}
|
|
62
|
+
|
|
61
63
|
DEFAULT_CONFIG: dict[str, Any] = {
|
|
62
64
|
"title": "usecli",
|
|
63
65
|
"title_file": None,
|
|
@@ -188,7 +190,11 @@ class ConfigManager:
|
|
|
188
190
|
if not root_dir.exists() or not root_dir.is_dir():
|
|
189
191
|
return None
|
|
190
192
|
|
|
191
|
-
candidates = [
|
|
193
|
+
candidates = [
|
|
194
|
+
path
|
|
195
|
+
for path in root_dir.rglob(USECLI_CONFIG_TOML)
|
|
196
|
+
if not any(part in ConfigManager._SKIP_DIRS for part in path.parts)
|
|
197
|
+
]
|
|
192
198
|
if not candidates:
|
|
193
199
|
return None
|
|
194
200
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{usecli-0.1.34 → usecli-0.1.35}/src/usecli/cli/commands/defaults/base/internal/fzf_command.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|