shellscripts 0.25.2__py3-none-any.whl → 0.26.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.
@@ -1,54 +1,49 @@
1
1
  #!/usr/bin/env python3
2
- """@brief OpenCode CLI launcher in project context.
2
+ """@brief OpenCode CLI launcher in auto-approval mode via the shared launcher.
3
3
 
4
- @details Ensures project-root prerequisite and executable availability before
5
- blocking subprocess invocation of `opencode`.
6
- @satisfies REQ-018, REQ-055, REQ-056, REQ-064
4
+ @details Thin YOLO command module binding the `opencode` registry record and
5
+ delegating project-root enforcement, executable validation, inline help
6
+ rendering, and blocking subprocess invocation to `_yolo_common`.
7
+ @satisfies REQ-018, DES-030, DES-031, DES-008
7
8
  """
8
9
 
9
- import subprocess
10
+ from shell_scripts.commands._yolo_common import (
11
+ get_yolo_spec,
12
+ print_yolo_help,
13
+ run_yolo_cli,
14
+ )
10
15
 
11
- from shell_scripts.utils import require_project_root, require_commands
12
-
13
- ## @var PROGRAM
14
- # @brief Base CLI program name used in help output.
15
- # @details Constant identifier for usage-line rendering in command help.
16
- PROGRAM = "shellscripts"
17
16
  ## @var DESCRIPTION
18
17
  # @brief One-line command description for dispatcher help surfaces.
19
18
  # @details Exposed by command registry introspection (`get_all_commands`).
20
19
  DESCRIPTION = "Launch OpenCode CLI in the project context."
20
+ ## @var SPEC
21
+ # @brief Declarative YOLO CLI record bound to the `opencode` command token.
22
+ # @satisfies DES-030, REQ-018
23
+ SPEC = get_yolo_spec("opencode")
21
24
 
22
25
 
23
- def print_help(version):
26
+ def print_help(version: str) -> None:
24
27
  """@brief Print command-specific help for `opencode`.
25
28
 
26
- @details Emits usage and pass-through argument behavior for deterministic
27
- terminal rendering; does not mutate process state.
29
+ @details Delegates to the shared YOLO help renderer, which emits the
30
+ executed option documentation and the alphabetical YOLO CLI registry.
31
+ Time complexity O(n) over registered YOLO CLI record count.
28
32
  @param version {str} CLI version string propagated by dispatcher.
29
33
  @return {None} Writes help text to stdout.
30
- @satisfies DES-008
34
+ @satisfies DES-008, REQ-086, REQ-092
31
35
  """
32
-
33
- print(f"Usage: {PROGRAM} opencode [args...] ({version})")
34
- print()
35
- print("opencode options:")
36
- print(" All arguments are passed through to the OpenCode CLI.")
37
- print(" --help - Show this help message.")
36
+ print_yolo_help(SPEC.command, version, DESCRIPTION)
38
37
 
39
38
 
40
- def run(args):
41
- """@brief Launch OpenCode CLI after external executable validation.
39
+ def run(args: list[str]) -> int:
40
+ """@brief Launch OpenCode CLI in auto-approval mode after validation.
42
41
 
43
- @details Resolves project root, checks executable availability for
44
- `opencode`, then executes pass-through args through blocking subprocess run.
42
+ @details Delegates to the shared YOLO runner executing
43
+ `opencode --auto` plus pass-through args through blocking subprocess run
44
+ with inherited stdio. Time complexity O(n) over forwarded argument count.
45
45
  @param args {list[str]} Additional CLI args forwarded to OpenCode.
46
46
  @return {int} Child process return code.
47
47
  @satisfies REQ-018, REQ-055, REQ-056, REQ-064
48
48
  """
49
-
50
- require_project_root()
51
- cmd = ["opencode"] + args
52
- cmd[0] = require_commands(cmd[0])
53
- result = subprocess.run(cmd)
54
- return result.returncode
49
+ return run_yolo_cli(SPEC.command, args)
@@ -259,7 +259,7 @@ def _print_install_skipped(target_dir: Path) -> None:
259
259
  """@brief Emit skip evidence when target directory is not Git root.
260
260
 
261
261
  @details Prints one parser-stable line containing `skip` and token
262
- `skippata` to document installation omission for non-root directories in
262
+ `skipped` to document installation omission for non-root directories in
263
263
  current-directory and `--dirs` modes. Time complexity is O(1).
264
264
  @param target_dir {Path} Directory skipped from cleanup and installation.
265
265
  @return {None} Writes one stdout line.
@@ -268,7 +268,7 @@ def _print_install_skipped(target_dir: Path) -> None:
268
268
 
269
269
  print(
270
270
  "install | skip | "
271
- f"{target_dir} | installation skippata: target is not a git root"
271
+ f"{target_dir} | installation skipped: target is not a git root"
272
272
  )
273
273
 
274
274