usecli 0.2.0__py3-none-any.whl → 0.2.2__py3-none-any.whl

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/__init__.py CHANGED
@@ -552,13 +552,12 @@ def _get_run_app_callback():
552
552
  if version:
553
553
  import shutil
554
554
 
555
- from usecli.shared.config.manager import get_config
555
+ from usecli.cli.core.ui.title import get_project_name
556
556
 
557
- config = get_config()
558
557
  service = _get_service()
559
558
  command_path = shutil.which(sys.argv[0]) or sys.argv[0]
560
559
  _console().print(
561
- f"[bold {globals()['theme'].SECONDARY}]{config.get('title')} {service.version}[/bold {globals()['theme'].SECONDARY}] [{globals()['theme'].INFO}]({command_path})[/{globals()['theme'].INFO}]"
560
+ f"[bold {globals()['theme'].SECONDARY}]{get_project_name()} {service.version}[/bold {globals()['theme'].SECONDARY}] [{globals()['theme'].INFO}]({command_path})[/{globals()['theme'].INFO}]"
562
561
  )
563
562
  raise typer.Exit()
564
563
 
@@ -2,6 +2,7 @@ from __future__ import annotations
2
2
 
3
3
  import os
4
4
  import sys
5
+ import tomllib
5
6
  from importlib.metadata import PackageNotFoundError
6
7
  from pathlib import Path
7
8
 
@@ -27,24 +28,6 @@ class _LazyConsole:
27
28
  console = _LazyConsole()
28
29
 
29
30
 
30
- def _load_toml(text: str):
31
- if sys.version_info >= (3, 11):
32
- import tomllib
33
- else:
34
- import tomli as tomllib
35
-
36
- return tomllib.loads(text)
37
-
38
-
39
- def _toml_decode_error():
40
- if sys.version_info >= (3, 11):
41
- pass
42
- else:
43
- pass
44
-
45
- return _toml_decode_error()
46
-
47
-
48
31
  def _get_version() -> str:
49
32
  from importlib.metadata import PackageNotFoundError
50
33
  from importlib.metadata import version as get_version
@@ -119,8 +102,8 @@ def _get_dependencies(config) -> list[tuple[str, str | None]]:
119
102
  return []
120
103
 
121
104
  try:
122
- data = _load_toml(pyproject_path.read_text())
123
- except (_toml_decode_error(), OSError):
105
+ data = tomllib.loads(pyproject_path.read_text())
106
+ except (tomllib.TOMLDecodeError, OSError):
124
107
  return []
125
108
 
126
109
  deps = data.get("project", {}).get("dependencies", [])
@@ -161,6 +144,12 @@ def _get_application_version(config) -> str:
161
144
 
162
145
 
163
146
  def _get_application_description(config) -> str:
147
+ from usecli.cli.core.ui.title import get_framework_description
148
+
149
+ framework_description = get_framework_description()
150
+ if framework_description:
151
+ return framework_description
152
+
164
153
  description = config.get("description")
165
154
  if (
166
155
  config.has_key("description")
@@ -185,8 +174,8 @@ def _get_project_description(config) -> str | None:
185
174
  return None
186
175
 
187
176
  try:
188
- data = _load_toml(pyproject_path.read_text())
189
- except (_toml_decode_error(), OSError):
177
+ data = tomllib.loads(pyproject_path.read_text())
178
+ except (tomllib.TOMLDecodeError, OSError):
190
179
  return None
191
180
 
192
181
  description = data.get("project", {}).get("description")
@@ -233,8 +222,8 @@ def _get_script_commands() -> list[str]:
233
222
  return []
234
223
 
235
224
  try:
236
- data = _load_toml(pyproject_path.read_text())
237
- except (_toml_decode_error(), OSError):
225
+ data = tomllib.loads(pyproject_path.read_text())
226
+ except (tomllib.TOMLDecodeError, OSError):
238
227
  return []
239
228
 
240
229
  scripts = data.get("project", {}).get("scripts", {})
@@ -4,7 +4,7 @@ from __future__ import annotations
4
4
 
5
5
  import re
6
6
  import sys
7
- from datetime import datetime, timedelta, timezone
7
+ from datetime import UTC, datetime, timedelta
8
8
  from pathlib import Path
9
9
 
10
10
 
@@ -118,7 +118,7 @@ def format_relative_time(timestamp: datetime) -> str:
118
118
  Returns:
119
119
  Relative time string (e.g., "2 hours ago", "3 days ago").
120
120
  """
121
- now = datetime.now(tz=timezone.utc)
121
+ now = datetime.now(tz=UTC)
122
122
  diff = now - timestamp
123
123
 
124
124
  if diff < timedelta(minutes=1):
@@ -7,6 +7,7 @@ import re
7
7
  import shutil
8
8
  import subprocess
9
9
  import sys
10
+ import tomllib
10
11
  from pathlib import Path
11
12
  from typing import Annotated
12
13
 
@@ -16,11 +17,6 @@ from rich.console import Console
16
17
  from rich.panel import Panel
17
18
  from rich.prompt import Confirm, Prompt
18
19
 
19
- if sys.version_info >= (3, 11):
20
- import tomllib
21
- else:
22
- import tomli as tomllib # pragma: no cover - only on Python < 3.11
23
-
24
20
  from usecli.cli.config.colors import COLOR
25
21
  from usecli.cli.core.base_command import BaseCommand
26
22
  from usecli.cli.core.exceptions import UsecliBadParameter
@@ -23,10 +23,8 @@ logger = logging.getLogger(__name__)
23
23
 
24
24
 
25
25
  def _import_tomllib():
26
- if sys.version_info >= (3, 11):
27
- import tomllib
28
- else:
29
- import tomli as tomllib
26
+ import tomllib
27
+
30
28
  return tomllib
31
29
 
32
30
 
@@ -6,7 +6,7 @@ from abc import ABC, abstractmethod
6
6
  from typing import TYPE_CHECKING, Any, ClassVar
7
7
 
8
8
  if TYPE_CHECKING:
9
- from typing_extensions import Self
9
+ from typing import Self
10
10
 
11
11
  import typer
12
12
  from click.exceptions import Exit
@@ -49,7 +49,9 @@ class UsecliValidationError(UsecliError):
49
49
  style = self.SEVERITY_STYLES.get(severity, self.SEVERITY_STYLES["error"])
50
50
  self.icon = style["icon"]
51
51
  self.color = style["color"]
52
- self.exit_code = 1 if severity in ("error", "critical") else 0
52
+ # click types exit_code as a ClassVar but reads it from the instance;
53
+ # warnings are not failures, so the code differs per severity.
54
+ self.exit_code = 1 if severity in ("error", "critical") else 0 # type: ignore[ty:invalid-attribute-access]
53
55
 
54
56
  def show(self, file: IO[str] | None = None) -> None:
55
57
  """Display validation error with severity styling.
@@ -3,7 +3,7 @@
3
3
  from __future__ import annotations
4
4
 
5
5
  import json
6
- from collections.abc import Iterator, Mapping
6
+ from collections.abc import Generator, Mapping
7
7
  from contextlib import contextmanager
8
8
  from contextvars import ContextVar
9
9
 
@@ -44,7 +44,7 @@ def execution_context(
44
44
  *,
45
45
  json_mode: bool | None = None,
46
46
  quiet: bool | None = None,
47
- ) -> Iterator[None]:
47
+ ) -> Generator[None, None, None]:
48
48
  """Temporarily set invocation flags and restore their previous values."""
49
49
  json_token = _JSON_MODE.set(json_mode) if json_mode is not None else None
50
50
  quiet_token = _QUIET.set(quiet) if quiet is not None else None
@@ -2,16 +2,13 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
+ import os
5
6
  import sys
7
+ import tomllib
6
8
  from importlib.metadata import PackageNotFoundError, metadata
7
9
  from pathlib import Path
8
10
  from typing import Any
9
11
 
10
- if sys.version_info >= (3, 11):
11
- import tomllib
12
- else:
13
- import tomli as tomllib # pragma: no cover - only on Python < 3.11
14
-
15
12
  from rich.console import Console
16
13
 
17
14
  from usecli.cli.config.colors import COLOR
@@ -19,6 +16,66 @@ from usecli.shared.config.manager import get_config
19
16
 
20
17
  console = Console()
21
18
 
19
+ _FRAMEWORK_DIST_NAME = "usecli"
20
+
21
+ # argv0 values set by the interpreter rather than by a console script.
22
+ _NON_SCRIPT_ARGV0 = frozenset({"-c", "-m", "__main__.py"})
23
+
24
+
25
+ def _invoked_script_name() -> str | None:
26
+ """Return the console-script name this process was started as."""
27
+ if not sys.argv:
28
+ return None
29
+ name = os.path.basename(sys.argv[0])
30
+ if not name or name in _NON_SCRIPT_ARGV0:
31
+ return None
32
+ return name
33
+
34
+
35
+ def _running_framework_distribution() -> Any | None:
36
+ """Return the usecli distribution when running as one of its console scripts.
37
+
38
+ The invoked console script decides the process identity: ``usecli`` (or
39
+ ``usecli-bundle``) means the framework binary is running, so banners must
40
+ describe the framework rather than the project it scaffolds.
41
+ """
42
+ script_name = _invoked_script_name()
43
+ if script_name is None:
44
+ return None
45
+
46
+ from usecli.shared.config.manager import _find_distribution_for_console_script
47
+
48
+ dist = _find_distribution_for_console_script(script_name)
49
+ if dist is None:
50
+ return None
51
+ dist_metadata = getattr(dist, "metadata", None)
52
+ if dist_metadata is None:
53
+ return None
54
+ dist_name = dist_metadata.get("Name") or ""
55
+ return dist if str(dist_name).strip().lower() == _FRAMEWORK_DIST_NAME else None
56
+
57
+
58
+ def _distribution_version(dist: Any) -> str | None:
59
+ try:
60
+ version = dist.version
61
+ except (AttributeError, OSError, TypeError):
62
+ return None
63
+ return str(version) if version else None
64
+
65
+
66
+ def get_framework_description() -> str | None:
67
+ """Description of the usecli distribution when running the framework binary.
68
+
69
+ Returns ``None`` for downstream CLIs, whose config description owns the
70
+ banner.
71
+ """
72
+ dist = _running_framework_distribution()
73
+ if dist is None:
74
+ return None
75
+ summary = dist.metadata.get("Summary")
76
+ summary = summary.strip() if isinstance(summary, str) else ""
77
+ return summary or None
78
+
22
79
 
23
80
  def _get_script_command_name(start_dir: Path | None = None) -> str | None:
24
81
  if start_dir is None:
@@ -49,6 +106,14 @@ def _get_script_command_name(start_dir: Path | None = None) -> str | None:
49
106
 
50
107
 
51
108
  def get_script_command_name(default: str | None = None) -> str | None:
109
+ """Get the command name used in usage lines and error messages.
110
+
111
+ The usecli binary reports itself, not the project's CLI name: a user who
112
+ typed ``usecli`` must see ``usecli`` in usage output.
113
+ """
114
+ if _running_framework_distribution() is not None:
115
+ return "usecli"
116
+
52
117
  config = get_config()
53
118
  config_command_name = config.get("command_name")
54
119
  if config.has_key("command_name") and config_command_name:
@@ -65,7 +130,14 @@ def get_script_command_name(default: str | None = None) -> str | None:
65
130
 
66
131
 
67
132
  def get_project_name() -> str:
68
- """Get the project name from config or package metadata."""
133
+ """Get the display name of the running CLI.
134
+
135
+ The usecli binary reports the framework name; downstream CLIs report the
136
+ title configured for their project.
137
+ """
138
+ if _running_framework_distribution() is not None:
139
+ return "useCli"
140
+
69
141
  # First, try to get the title from the config
70
142
  config = get_config()
71
143
  title = config.get("title")
@@ -116,21 +188,23 @@ def render_figlet_title(figlet: Any, text: str, font: str) -> str:
116
188
  def get_project_version() -> str | None:
117
189
  """Best-effort version of the running CLI.
118
190
 
119
- Resolves the distribution that owns the invoked console script first, then
120
- falls back to ``[project].version`` in the project's pyproject.toml.
191
+ The usecli binary reports the installed framework version. A downstream
192
+ CLI resolves the distribution that owns the invoked console script first,
193
+ then falls back to ``[project].version`` in the project's pyproject.toml.
121
194
  """
195
+ framework_dist = _running_framework_distribution()
196
+ if framework_dist is not None:
197
+ return _distribution_version(framework_dist)
198
+
122
199
  command_name = get_script_command_name()
123
200
  if command_name:
124
201
  from usecli.shared.config.manager import _find_distribution_for_console_script
125
202
 
126
203
  dist = _find_distribution_for_console_script(command_name)
127
204
  if dist is not None:
128
- try:
129
- version = dist.version
130
- except (AttributeError, OSError, TypeError):
131
- version = None
205
+ version = _distribution_version(dist)
132
206
  if version:
133
- return str(version)
207
+ return version
134
208
 
135
209
  try:
136
210
  return get_config().get_project_version()
@@ -202,11 +276,15 @@ def print_title(title: str | None = None) -> None:
202
276
  if config.has_key("banner.show_description")
203
277
  else not (figlet is not None and bool(title_font))
204
278
  )
205
- description = (
206
- config.get("description")
207
- if show_description and config.has_key("description")
208
- else None
209
- )
279
+ framework_description = get_framework_description()
280
+ if show_description and framework_description:
281
+ description = framework_description
282
+ else:
283
+ description = (
284
+ config.get("description")
285
+ if show_description and config.has_key("description")
286
+ else None
287
+ )
210
288
  show_version = (
211
289
  bool(config.get("banner.show_version"))
212
290
  if config.has_key("banner.show_version")
@@ -0,0 +1,143 @@
1
+ """Interactive input for rich prompts that stays put.
2
+
3
+ rich's ``Console.input`` prints the prompt itself and then calls builtin
4
+ ``input()`` without one. The system line editor therefore thinks the line
5
+ starts at column 0: cursor keys beep or redraw over the prompt and history
6
+ lands in the wrong place.
7
+
8
+ Handing the prompt to ``input()`` fixes that only on GNU readline. macOS uses
9
+ libedit, which moves ANSI escapes out of the prompt (dropping the colors) and
10
+ still counts their bytes as visible width. prompt_toolkit measures the
11
+ rich-rendered prompt itself, so patching ``Console.input`` -- the seam used by
12
+ every rich prompt method (``Prompt``, ``Confirm``, ``IntPrompt``, direct
13
+ ``console.input``) -- gives correct colors, wrapping, cursor keys and history
14
+ everywhere.
15
+ """
16
+
17
+ from __future__ import annotations
18
+
19
+ import sys
20
+ from typing import Any, TextIO
21
+
22
+ # One session per process so answers can be recalled with the up arrow across
23
+ # consecutive prompts. prompt_toolkit is imported lazily: a non-interactive
24
+ # invocation must not pay its import cost.
25
+ _session: Any = None
26
+ _installed = False
27
+
28
+
29
+ def _prompt_session() -> Any:
30
+ """Return the process-wide prompt_toolkit session."""
31
+ global _session
32
+ if _session is None:
33
+ from prompt_toolkit import PromptSession
34
+ from prompt_toolkit.history import InMemoryHistory
35
+
36
+ # No completion menu is shown, so reserving screen rows for one only
37
+ # forces a cursor-position query some terminals answer slowly or not at
38
+ # all.
39
+ _session = PromptSession(
40
+ history=InMemoryHistory(),
41
+ reserve_space_for_menu=0,
42
+ )
43
+ return _session
44
+
45
+
46
+ def _is_tty(stream: Any) -> bool:
47
+ isatty = getattr(stream, "isatty", None)
48
+ return bool(isatty is not None and isatty())
49
+
50
+
51
+ def _can_prompt_inline(console: Any) -> bool:
52
+ """Return whether prompt_toolkit can own the terminal for this prompt.
53
+
54
+ Its renderer reads stdin and writes stdout, so the console must be printing
55
+ to the same stdout: a console aimed elsewhere, redirected output, or a
56
+ piped stdin falls back to rich's own prompt handling.
57
+ """
58
+ stdin = sys.stdin
59
+ stdout = sys.stdout
60
+ if stdin is None or stdout is None:
61
+ return False
62
+ if getattr(console, "file", None) is not stdout:
63
+ return False
64
+ return _is_tty(stdin) and _is_tty(stdout)
65
+
66
+
67
+ def _render_prompt(
68
+ console: Any,
69
+ prompt: Any,
70
+ *,
71
+ markup: bool,
72
+ emoji: bool,
73
+ ) -> str:
74
+ """Render rich's prompt (markup, styles, emoji) to a single ANSI string.
75
+
76
+ ``soft_wrap`` leaves line breaking to prompt_toolkit, which knows the
77
+ terminal width and accounts for the ANSI sequences.
78
+ """
79
+ with console.capture() as capture:
80
+ console.print(prompt, markup=markup, emoji=emoji, end="", soft_wrap=True)
81
+ return capture.get()
82
+
83
+
84
+ def _ask_inline(
85
+ console: Any,
86
+ prompt: Any,
87
+ *,
88
+ markup: bool,
89
+ emoji: bool,
90
+ ) -> str:
91
+ from prompt_toolkit.formatted_text import ANSI
92
+
93
+ rendered = _render_prompt(console, prompt, markup=markup, emoji=emoji)
94
+ return _prompt_session().prompt(ANSI(rendered))
95
+
96
+
97
+ def install_prompt_input() -> None:
98
+ """Patch rich's ``Console.input`` once for correct interactive editing."""
99
+ global _installed
100
+ if _installed:
101
+ return
102
+
103
+ from rich.console import Console
104
+
105
+ original_input = Console.input
106
+
107
+ def prompt_input(
108
+ self: Console,
109
+ prompt: Any = "",
110
+ *,
111
+ markup: bool = True,
112
+ emoji: bool = True,
113
+ password: bool = False,
114
+ stream: TextIO | None = None,
115
+ ) -> str:
116
+ if password or stream is not None or not _can_prompt_inline(self):
117
+ return original_input(
118
+ self,
119
+ prompt,
120
+ markup=markup,
121
+ emoji=emoji,
122
+ password=password,
123
+ stream=stream,
124
+ )
125
+ try:
126
+ return _ask_inline(self, prompt, markup=markup, emoji=emoji)
127
+ except ImportError: # pragma: no cover - prompt_toolkit always installed
128
+ # A bundle that did not collect prompt_toolkit still gets a usable
129
+ # prompt, just without line editing.
130
+ return original_input(
131
+ self,
132
+ prompt,
133
+ markup=markup,
134
+ emoji=emoji,
135
+ password=password,
136
+ stream=stream,
137
+ )
138
+
139
+ _installed = True
140
+ setattr(Console, "input", prompt_input) # noqa: B010
141
+
142
+
143
+ __all__ = ["install_prompt_input"]
usecli/progress.py CHANGED
@@ -6,7 +6,7 @@ from types import TracebackType
6
6
  from typing import TYPE_CHECKING
7
7
 
8
8
  if TYPE_CHECKING:
9
- from typing_extensions import Self
9
+ from typing import Self
10
10
 
11
11
  from rich.console import Console
12
12
  from rich.progress import (
@@ -32,14 +32,9 @@ def _get_path():
32
32
 
33
33
  # Lazy tomllib import - only loaded when actually needed
34
34
  def _get_tomllib():
35
- if sys.version_info >= (3, 11):
36
- import tomllib
35
+ import tomllib
37
36
 
38
- return tomllib
39
- else:
40
- import tomli as tomllib
41
-
42
- return tomllib
37
+ return tomllib
43
38
 
44
39
 
45
40
  # Depth cap for rglob - prevents scanning massive trees like ~/ghq.
@@ -509,6 +504,9 @@ class ConfigManager:
509
504
  def _find_usecli_config(cls, start_dir: Path) -> Path | None:
510
505
  current = start_dir.resolve()
511
506
  command_name = cls._get_command_name()
507
+ command_is_framework = (
508
+ command_name == _get_package_name() if command_name else True
509
+ )
512
510
 
513
511
  # Check cache first to avoid repeated expensive searches.
514
512
  cache_key = str(start_dir.resolve())
@@ -528,6 +526,24 @@ class ConfigManager:
528
526
  break
529
527
  current = parent
530
528
 
529
+ # The framework binary is generic scaffolding: running `usecli` inside a
530
+ # downstream project must target that project, never the framework's own
531
+ # installed package. Search the enclosing project before any
532
+ # distribution fallback, and do not filter by `command_name` — the
533
+ # project config names the project's CLI (e.g. "cogrep"), not the
534
+ # framework binary writing into it.
535
+ if command_is_framework and not cls._is_within_usecli_package(start_dir):
536
+ project_root = find_project_root(start_dir)
537
+ if project_root is not None:
538
+ local_match = cls._find_usecli_config_in_tree(
539
+ project_root,
540
+ start_dir,
541
+ skip_venv=True,
542
+ match_command=False,
543
+ )
544
+ _config_search_cache[cache_key] = local_match
545
+ return local_match
546
+
531
547
  # Try fast lookups before expensive rglob (perf: global tools).
532
548
  console_match = cls._find_usecli_config_for_console_script()
533
549
  if console_match:
@@ -553,9 +569,8 @@ class ConfigManager:
553
569
  _config_search_cache[cache_key] = None
554
570
  return None
555
571
 
556
- is_framework = command_name == "usecli" if command_name else True
557
572
  recursive_match = cls._find_usecli_config_in_tree(
558
- search_root, start_dir, skip_venv=is_framework
573
+ search_root, start_dir, skip_venv=command_is_framework
559
574
  )
560
575
  _config_search_cache[cache_key] = recursive_match
561
576
  if recursive_match:
@@ -566,13 +581,17 @@ class ConfigManager:
566
581
 
567
582
  @staticmethod
568
583
  def _find_usecli_config_in_tree(
569
- root_dir: Path, start_dir: Path, *, skip_venv: bool
584
+ root_dir: Path,
585
+ start_dir: Path,
586
+ *,
587
+ skip_venv: bool,
588
+ match_command: bool = True,
570
589
  ) -> Path | None:
571
590
  if not root_dir.exists() or not root_dir.is_dir():
572
591
  return None
573
592
 
574
593
  candidates = _rglob_limited(root_dir, USECLI_CONFIG_TOML, skip_venv=skip_venv)
575
- command_name = ConfigManager._get_command_name()
594
+ command_name = ConfigManager._get_command_name() if match_command else None
576
595
  if command_name:
577
596
  candidates = [
578
597
  path
@@ -62,11 +62,7 @@ def _get_path():
62
62
 
63
63
 
64
64
  def _get_tomllib():
65
- if sys.version_info >= (3, 11):
66
- import tomllib
67
-
68
- return tomllib
69
- import tomli as tomllib
65
+ import tomllib
70
66
 
71
67
  return tomllib
72
68
 
usecli/ui.py CHANGED
@@ -12,9 +12,14 @@ from rich.text import Text
12
12
 
13
13
  from usecli.cli.config.colors import COLOR
14
14
  from usecli.cli.core.runtime import NonInteractiveError, is_json_mode
15
+ from usecli.cli.utils.interactive.prompt_input import install_prompt_input
15
16
 
16
17
  console = Console()
17
18
 
19
+ # Any rich prompt method (Prompt, Confirm, IntPrompt, console.input) gets
20
+ # interactive line editing as soon as the framework's UI module is imported.
21
+ install_prompt_input()
22
+
18
23
 
19
24
  class Prompt:
20
25
  """Wrapper around Rich Prompt for user input."""
usecli/usecli.config.toml CHANGED
@@ -9,13 +9,36 @@ description = "A powerful Python CLI framework for building beautiful, developer
9
9
  [usecli.paths]
10
10
  commands = "cli/commands/custom"
11
11
  templates = "cli/templates"
12
+ # One directory or a list of directories; the first is where `make:theme`
13
+ # writes new themes.
12
14
  themes = ["cli/themes"]
13
15
 
14
16
  [usecli.theme]
17
+ # Theme TOML file to load, by name or path.
15
18
  name = "default"
16
19
 
17
20
  [usecli.banner]
21
+ # Optional: a text file whose contents replace the rendered title.
22
+ # Relative paths resolve against the project root.
18
23
  file = "cli/core/ui/title.txt"
19
- font = "ansi_shadow"
24
+ # Optional: a figlet font for the title (requires the `figlet` extra).
25
+ # font = "ansi_shadow"
20
26
  top_space = true
21
- bottom_space = false
27
+ bottom_space = true
28
+ # Whether the version and description follow the title.
29
+ show_version = false
30
+ show_description = false
31
+
32
+ [usecli.commands]
33
+ # Built-in commands to leave unregistered, for example ["inspire"].
34
+ hidden = []
35
+
36
+ [usecli.upgrade]
37
+ enabled = true
38
+ # Where upgrades come from: "auto" (detect from install metadata), "pypi", or "git".
39
+ source = "auto"
40
+ # Git only: repository URL. Falls back to the URL in the install metadata.
41
+ # url = "https://github.com/owner/repo.git"
42
+ # Optional: distribution name and Git ref (branch, tag, or commit) overrides.
43
+ # package = "my-cli"
44
+ # ref = "main"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: usecli
3
- Version: 0.2.0
3
+ Version: 0.2.2
4
4
  Summary: A powerful Python CLI framework for building beautiful, developer-friendly command-line tools.
5
5
  Author: Edward Boswell
6
6
  Author-email: Edward Boswell <thememium@gmail.com>
@@ -10,15 +10,15 @@ Classifier: Programming Language :: Python :: 3
10
10
  Classifier: Operating System :: OS Independent
11
11
  Classifier: Intended Audience :: Developers
12
12
  Requires-Dist: case-converter>=1.2.0
13
- Requires-Dist: click>=8.4.2
13
+ Requires-Dist: click>=8.5.1
14
14
  Requires-Dist: jinja2>=3.1.6
15
+ Requires-Dist: prompt-toolkit>=3.0.53
15
16
  Requires-Dist: rich>=15.0.0
16
17
  Requires-Dist: simple-term-menu>=1.6.6
17
- Requires-Dist: tomli>=2.4.1
18
- Requires-Dist: typer>=0.27.0
18
+ Requires-Dist: typer>=0.29.2
19
19
  Requires-Dist: pyfiglet>=1.0.4 ; extra == 'figlet'
20
- Requires-Dist: pyinstaller>=6.21.0 ; extra == 'pyinstaller'
21
- Requires-Python: >=3.10
20
+ Requires-Dist: pyinstaller>=6.22.3 ; extra == 'pyinstaller'
21
+ Requires-Python: >=3.11
22
22
  Project-URL: Homepage, https://github.com/thememium/usecli
23
23
  Project-URL: Documentation, https://github.com/thememium/usecli
24
24
  Project-URL: Repository, https://github.com/thememium/usecli.git
@@ -1,4 +1,4 @@
1
- usecli/__init__.py,sha256=2ptsyOW-C4CmYmZK0gl4deFcgIpYBYSsne40Dhujpvs,22477
1
+ usecli/__init__.py,sha256=713TNWRMgbfq-KHnZQRp3coh8uQ6IPt_kMIJPwEBaho,22444
2
2
  usecli/bundler/__init__.py,sha256=tJx8nm772vzi9fncllmyAwaUfUgEkpIdNGrxXVQQK5Y,9933
3
3
  usecli/bundler/__main__.py,sha256=KX6OW0kARPeTU78jyZ7ibllU3I2lEOn0oxByuNXz-XI,164
4
4
  usecli/cli/__init__.py,sha256=vf1sG4-UYnwywGVht3bDapFtgRxP35r9QjY02Gua0ls,156
@@ -8,24 +8,24 @@ usecli/cli/commands/custom/README.md,sha256=nXy40-pNnGjOj4tkW71ooFrwR7mawjJmsgWw
8
8
  usecli/cli/commands/custom/__init__.py,sha256=L1Yab97IK3hqpdau7tl0sUfaTckB1gsNMoJq0GIzp0A,82
9
9
  usecli/cli/commands/defaults/__init__.py,sha256=rLesbAh6q5zzUQJX972fE-7KhDz7lUohYNiTxwDt4Ls,75
10
10
  usecli/cli/commands/defaults/base/__init__.py,sha256=7PZ8cC9YgXjXI_oy0wM_tvM5kFa57o1bGx6CaUll3X0,79
11
- usecli/cli/commands/defaults/base/about_command.py,sha256=A_vmgilQYP8PV3342wM1bjnB1ShITuz7DJkZr6lug0U,11115
11
+ usecli/cli/commands/defaults/base/about_command.py,sha256=MpOClmVh8nt4GaNkMZVbxVAD-J88gelanMFZpfDBZ-I,11045
12
12
  usecli/cli/commands/defaults/base/help_command.py,sha256=fb_OjfZl6dIYyg4sf7gVGocWZBoXZuybmrIOI921JN8,616
13
13
  usecli/cli/commands/defaults/base/inspire_command.py,sha256=QnbzZz09jEVO85v3QbPXnljTtdYXIt3piwbPqk8svxs,4865
14
14
  usecli/cli/commands/defaults/base/internal/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
15
15
  usecli/cli/commands/defaults/base/internal/interactive_command.py,sha256=opJPYoFx2CWwaflHveLiKBK2fdCppNPaSveViU-cBjw,20686
16
16
  usecli/cli/commands/defaults/base/upgrade_command.py,sha256=CbwgYhe5eusQJIHDIucZFwwjY2tresnVIAz4HrQNkKs,11209
17
17
  usecli/cli/commands/defaults/core/__init__.py,sha256=fPJE7iZcGtzVs0pteFLOTA8XXHJfjOPDTgBaIFYJ4PQ,74
18
- usecli/cli/commands/defaults/core/utils.py,sha256=04ueBo-AyA2EmXJfXzcCoiz-U6zi6bW2N0rS39y5peo,5327
18
+ usecli/cli/commands/defaults/core/utils.py,sha256=_Zh68Xv-NSJQn_7vkNphgkpYfQOLu0nRr1wLrmI2xEw,5313
19
19
  usecli/cli/commands/defaults/make/__init__.py,sha256=2g5DIooxAkq-eE9APAP6fZLC83zxttGfk7UZ73vTEss,78
20
20
  usecli/cli/commands/defaults/make/make_bundle_command.py,sha256=ybx1Mc2OQGZw4IDlECIuY2JG-ok_nzkVAYLG5FDkSxQ,4467
21
21
  usecli/cli/commands/defaults/make/make_command.py,sha256=EOebwditv_zaDz6viyKuHuS51qUBKU_NrWwacMao5g4,2946
22
22
  usecli/cli/commands/defaults/make/make_theme_command.py,sha256=ZASdkik3hnhtx5fI-FHRse6aSijPWnzbsRrh53cXUWk,2639
23
- usecli/cli/commands/init_command.py,sha256=oR0Z3b2l-JE-gQFyKROhpyoFGLY5WzipHcBtPDcLfAk,46625
23
+ usecli/cli/commands/init_command.py,sha256=2qP0hRfieDFzN1cq0YeasIZ2xIDsfVY1MSkLuCcM1BM,46510
24
24
  usecli/cli/config/__init__.py,sha256=ZXGIirxl3WStRR3g9mK0PNpnTQ8tkPmYB5PKdBA5ujY,80
25
- usecli/cli/config/colors.py,sha256=I6wV8UMi1JiRkUr6wm1yuPAu_BHkRzogG71sfNsQtrw,28039
25
+ usecli/cli/config/colors.py,sha256=VY8rDgt_M7v3eFt_rGY8l2xxIh--7bFSqEuUE8kbrtk,27958
26
26
  usecli/cli/core/__init__.py,sha256=ZtgOO_gQoeXK7ZgELcFaWGADWiF8FSJ4TGLXAi3cNyE,2034
27
27
  usecli/cli/core/_typer_compat.py,sha256=Ehgm3IT7ZX2OoCiKKRFcu1bx8C6r0PjFAs49A2-H414,2204
28
- usecli/cli/core/base_command.py,sha256=0v2CZdu8iTn3PEVTDVH11TpArBYzYyDydqUYG9ncE7k,21486
28
+ usecli/cli/core/base_command.py,sha256=RPm9CMIrSUz5HmQZgXjUVs0M5FguCSjs_FEbu4ldk00,21475
29
29
  usecli/cli/core/error/__init__.py,sha256=Q7rS_LX2hpUfgY7WMUxG25eLm16dUFCMFQWst-PGXzw,283
30
30
  usecli/cli/core/error/handler.py,sha256=Zjupb_YKerRQ_m4D_c_WTOo7EnUFzoqySronV_03fxY,3721
31
31
  usecli/cli/core/error/utils.py,sha256=D40iV3LYRpYG-GroHRQJb7z1WQ2zvTbU0-XH1xY03qc,1528
@@ -33,11 +33,11 @@ usecli/cli/core/exceptions/__init__.py,sha256=ktW6iCvmmKc__kNeOXooyovT6S6wU-w92M
33
33
  usecli/cli/core/exceptions/base.py,sha256=tlwPAZVYJZ-5vfSYYx9M0bjiDaeHlf_HCOSg_6Brgsc,1738
34
34
  usecli/cli/core/exceptions/config.py,sha256=RuJYCb3EOQzAed-63xrMyxhDv0z6Z7Ojz-ma0NZ9TQY,1872
35
35
  usecli/cli/core/exceptions/usage.py,sha256=hBbo67nAUARksI7KQSJ8P6dtx8qH1bu-rRGaBldcWsc,3499
36
- usecli/cli/core/exceptions/validation.py,sha256=2pUtNzNhMo-QXBzyVVnIfWViaRHqy-GBJaKM7FLKu2Q,2297
37
- usecli/cli/core/runtime.py,sha256=0D2y6X0ZXQNIKX1uFNdreK3NtRXvM5gypWQ0lX_GU-E,2720
36
+ usecli/cli/core/exceptions/validation.py,sha256=94kVisVfM60BbQXXPgbbij-Wk-JG2oSEEPL9E5Cdvds,2491
37
+ usecli/cli/core/runtime.py,sha256=oYw3utJfP6l0Ge-lh7LemzlpFfwhcTqd8f0UMjDw-uY,2734
38
38
  usecli/cli/core/ui/__init__.py,sha256=DlDpV0TkDHFgzy8QSKq1BtBXMZ0rPb83Doa9YJtJk8o,1182
39
39
  usecli/cli/core/ui/list.py,sha256=Xbd-yrBL2pbbFVTKyuhcE0P79SNkrPd36rjY8gTvQj0,17716
40
- usecli/cli/core/ui/title.py,sha256=r1S4JXvxlCUFg0yQf_ujF897USaCCNmkS-QNkdcp0q0,8450
40
+ usecli/cli/core/ui/title.py,sha256=HsyAXAqgfJByBowlXvChoAAzHX0ulAkWkjXDDossUso,11106
41
41
  usecli/cli/core/ui/title.txt,sha256=FczT0qLn__wPje2HgWlG2QK-n9IFkrXbYB9r3BG-cME,592
42
42
  usecli/cli/core/validators/__init__.py,sha256=vh_vuBI4jjbyW_HK5YISSOqIF7hL3D1FH7yVwIZiLHQ,724
43
43
  usecli/cli/core/validators/network.py,sha256=ArjtXz8iu4VY_V3_KkPAuvKptieIQYLF_IgZx1nTpCo,1941
@@ -61,26 +61,27 @@ usecli/cli/themes/nord.toml,sha256=7rZbFwBDP9AaWKu_Bx_urhijvPjEI79ajJsMQxZZkbs,5
61
61
  usecli/cli/themes/tokyo_night.toml,sha256=tOyyX2At20G5HdedOetZRmovnoVoToV1-7K8kqYn1kI,582
62
62
  usecli/cli/utils/__init__.py,sha256=kGHT0Sr7hFXOjEQYPwt8DOqzMVIgARJI-ajty2PPmpc,112
63
63
  usecli/cli/utils/interactive/__init__.py,sha256=6AdkQWCsdx3g_GA2wTZjNljojTCbCpLR9SrICihsjHI,104
64
+ usecli/cli/utils/interactive/prompt_input.py,sha256=h0CymsdhAUvdnh0gCpdU_9KxxycqRCIdoWAQZUU-3yM,4511
64
65
  usecli/cli/utils/interactive/terminal_menu.py,sha256=tDY_W-y8Kk4NThNJ59vyjmlQtRZKwgFcilw7LVS6rxk,18023
65
66
  usecli/entry.py,sha256=jNslN8cFrmsA8Rj1lqoHXyQqJqPviNtrVLSzDlLW09U,7511
66
67
  usecli/menu.py,sha256=dgLx8Xfeq9jp6yQOLls219oYdoAMfhK8InkcGLO2P5I,2165
67
68
  usecli/params.py,sha256=2uP8Nx5sYzLF6Dp2ZaH3LJToZYZ2qy0jj-8ABWD_hvw,3550
68
- usecli/progress.py,sha256=uvrrJ7DyYRdHVw3xb6Pxwfr_pZLbZcO55peWpO-PiqU,5231
69
+ usecli/progress.py,sha256=n1FHMsIvCs7mjwdprJ43tQgKX0EY2dFUUIagGpj3mNw,5220
69
70
  usecli/shared/__init__.py,sha256=kiGyhMIQj2VVym4j-3PoIKlBUz6mr1JXyDEROktZdNc,89
70
71
  usecli/shared/config/__init__.py,sha256=rSbK7YclDyly-sMs9Jw87yPdr6mgmcR8A7tuzt6VQNk,176
71
72
  usecli/shared/config/globals.py,sha256=cK92jQg2RLORCEck4NE5BcPq0XLInoneSufRY31ppUQ,537
72
- usecli/shared/config/manager.py,sha256=wzTc7M2afzRXXW7_I2hT9AF6oSBezaEf7fU_8x7bSmE,43604
73
+ usecli/shared/config/manager.py,sha256=dHG0Xzwb1m_FRHtsvziurXAbAFOdScjTeVU8H2gyN58,44559
73
74
  usecli/shared/upgrades/__init__.py,sha256=SJ0Rh9Vda6C5Aux0gqEmfJaaCL-3vZYwIFCjMHJew0A,750
74
75
  usecli/shared/upgrades/checker.py,sha256=igKHnUAls_8nIS925CAfWz1THqL-TN02DpPNwzMiFrA,9557
75
76
  usecli/shared/upgrades/discovery.py,sha256=pCQR6j5DhkHifyrV3t_i8ApoN1QMPxc_4wjeO8JVK18,12493
76
77
  usecli/shared/upgrades/installer.py,sha256=lwcCROR3OwiLtMb0VMrv06VjDuRUkPWJi4xMUG0Eg3Q,8732
77
- usecli/shared/upgrades/pyproject.py,sha256=2M-ztKox_fYrbSuNh8FQPEWoUUmVEJKzrJzCOkHFq7g,21131
78
+ usecli/shared/upgrades/pyproject.py,sha256=hX3zMK70dGCuR_YZiLdk6TemXEGt56lSPcnTf6fdEsM,21039
78
79
  usecli/shared/upgrades/service.py,sha256=mbdOlltlhy5aIoXQg-Z8bRZOBKx-V_ZE2LeFCawE8es,1531
79
80
  usecli/shared/upgrades/settings.py,sha256=Fs3QPHC6WCZiR8vHR-p-iBhzt9Gb1pde_oqLpX-EanE,4054
80
- usecli/ui.py,sha256=mD4FUYqdcGYn-ed1H6TaNyD8_JBCk7h4ZqfpzO7ZfPI,2643
81
- usecli/usecli.config.toml,sha256=7waWcglpS-6TCteK7eN0F0SZ8RHiPIZwT7e1D2-OzR8,474
82
- usecli-0.2.0.dist-info/licenses/LICENSE,sha256=__gKAkMUpLmsNxVlHtoB_EZRb3qtfLICULaZFQdeBOs,1071
83
- usecli-0.2.0.dist-info/WHEEL,sha256=G_-rrEibZr7OEM7zdH1dSO6s-VdjfnS5PA4CLAdI9Vw,80
84
- usecli-0.2.0.dist-info/entry_points.txt,sha256=g-WrjhqUPo8h-70iEg5MXsbI6Fh5lHo0MCPcyDAeKFQ,75
85
- usecli-0.2.0.dist-info/METADATA,sha256=KD6I1RHQavaIskCgXV--8m_bw27gc25tR6eUtP1VJZ4,13324
86
- usecli-0.2.0.dist-info/RECORD,,
81
+ usecli/ui.py,sha256=692vBCg8NB1fnl50qftdfifL2HFw5QsM0ZzY5Y8GH-A,2893
82
+ usecli/usecli.config.toml,sha256=GtbIu__TbPyl4D0P8g71BZDcTPuhIraphGlpRaYtbkg,1371
83
+ usecli-0.2.2.dist-info/licenses/LICENSE,sha256=__gKAkMUpLmsNxVlHtoB_EZRb3qtfLICULaZFQdeBOs,1071
84
+ usecli-0.2.2.dist-info/WHEEL,sha256=G_-rrEibZr7OEM7zdH1dSO6s-VdjfnS5PA4CLAdI9Vw,80
85
+ usecli-0.2.2.dist-info/entry_points.txt,sha256=g-WrjhqUPo8h-70iEg5MXsbI6Fh5lHo0MCPcyDAeKFQ,75
86
+ usecli-0.2.2.dist-info/METADATA,sha256=TfwzMS1CONtxZM2T2LOmhAcLzvpt-OwYE5KQgx7r4lo,13334
87
+ usecli-0.2.2.dist-info/RECORD,,
File without changes