shellscripts 0.24.0__tar.gz → 0.25.0__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.
- {shellscripts-0.24.0 → shellscripts-0.25.0}/PKG-INFO +9 -23
- {shellscripts-0.24.0 → shellscripts-0.25.0}/README.md +8 -22
- {shellscripts-0.24.0 → shellscripts-0.25.0}/pyproject.toml +1 -1
- {shellscripts-0.24.0 → shellscripts-0.25.0}/src/shell_scripts/__init__.py +1 -1
- {shellscripts-0.24.0 → shellscripts-0.25.0}/src/shell_scripts/commands/__init__.py +1 -1
- shellscripts-0.25.0/src/shell_scripts/commands/agy.py +81 -0
- {shellscripts-0.24.0 → shellscripts-0.25.0}/src/shell_scripts/core.py +1 -1
- {shellscripts-0.24.0 → shellscripts-0.25.0}/src/shell_scripts/utils.py +1 -1
- {shellscripts-0.24.0 → shellscripts-0.25.0}/src/shell_scripts/version_check.py +6 -5
- {shellscripts-0.24.0 → shellscripts-0.25.0}/src/shellscripts.egg-info/PKG-INFO +9 -23
- {shellscripts-0.24.0 → shellscripts-0.25.0}/src/shellscripts.egg-info/SOURCES.txt +3 -3
- {shellscripts-0.24.0 → shellscripts-0.25.0}/tests/test_tst_014_pypi_version_source.py +49 -5
- shellscripts-0.25.0/tests/test_tst_017_agy_command.py +135 -0
- shellscripts-0.24.0/src/shell_scripts/commands/ai_install.py +0 -453
- shellscripts-0.24.0/tests/test_tst_003_ai_install.py +0 -775
- {shellscripts-0.24.0 → shellscripts-0.25.0}/LICENSE +0 -0
- {shellscripts-0.24.0 → shellscripts-0.25.0}/setup.cfg +0 -0
- {shellscripts-0.24.0 → shellscripts-0.25.0}/src/shell_scripts/__main__.py +0 -0
- {shellscripts-0.24.0 → shellscripts-0.25.0}/src/shell_scripts/commands/_dc_common.py +0 -0
- {shellscripts-0.24.0 → shellscripts-0.25.0}/src/shell_scripts/commands/bin_links.py +0 -0
- {shellscripts-0.24.0 → shellscripts-0.25.0}/src/shell_scripts/commands/claude.py +0 -0
- {shellscripts-0.24.0 → shellscripts-0.25.0}/src/shell_scripts/commands/clean.py +0 -0
- {shellscripts-0.24.0 → shellscripts-0.25.0}/src/shell_scripts/commands/codex.py +0 -0
- {shellscripts-0.24.0 → shellscripts-0.25.0}/src/shell_scripts/commands/copilot.py +0 -0
- {shellscripts-0.24.0 → shellscripts-0.25.0}/src/shell_scripts/commands/dicom2jpg.py +0 -0
- {shellscripts-0.24.0 → shellscripts-0.25.0}/src/shell_scripts/commands/dicomviewer.py +0 -0
- {shellscripts-0.24.0 → shellscripts-0.25.0}/src/shell_scripts/commands/diff_cmd.py +0 -0
- {shellscripts-0.24.0 → shellscripts-0.25.0}/src/shell_scripts/commands/doxygen_cmd.py +0 -0
- {shellscripts-0.24.0 → shellscripts-0.25.0}/src/shell_scripts/commands/edit_cmd.py +0 -0
- {shellscripts-0.24.0 → shellscripts-0.25.0}/src/shell_scripts/commands/gemini.py +0 -0
- {shellscripts-0.24.0 → shellscripts-0.25.0}/src/shell_scripts/commands/kiro.py +0 -0
- {shellscripts-0.24.0 → shellscripts-0.25.0}/src/shell_scripts/commands/opencode.py +0 -0
- {shellscripts-0.24.0 → shellscripts-0.25.0}/src/shell_scripts/commands/pdf_crop.py +0 -0
- {shellscripts-0.24.0 → shellscripts-0.25.0}/src/shell_scripts/commands/pdf_merge.py +0 -0
- {shellscripts-0.24.0 → shellscripts-0.25.0}/src/shell_scripts/commands/pdf_split_by_format.py +0 -0
- {shellscripts-0.24.0 → shellscripts-0.25.0}/src/shell_scripts/commands/pdf_split_by_toc.py +0 -0
- {shellscripts-0.24.0 → shellscripts-0.25.0}/src/shell_scripts/commands/pdf_tiler_090.py +0 -0
- {shellscripts-0.24.0 → shellscripts-0.25.0}/src/shell_scripts/commands/pdf_tiler_100.py +0 -0
- {shellscripts-0.24.0 → shellscripts-0.25.0}/src/shell_scripts/commands/pdf_toc_clean.py +0 -0
- {shellscripts-0.24.0 → shellscripts-0.25.0}/src/shell_scripts/commands/pi.py +0 -0
- {shellscripts-0.24.0 → shellscripts-0.25.0}/src/shell_scripts/commands/req_cmd.py +0 -0
- {shellscripts-0.24.0 → shellscripts-0.25.0}/src/shell_scripts/commands/tests_cmd.py +0 -0
- {shellscripts-0.24.0 → shellscripts-0.25.0}/src/shell_scripts/commands/ubuntu_dark_theme.py +0 -0
- {shellscripts-0.24.0 → shellscripts-0.25.0}/src/shell_scripts/commands/venv_cmd.py +0 -0
- {shellscripts-0.24.0 → shellscripts-0.25.0}/src/shell_scripts/commands/video2h264.py +0 -0
- {shellscripts-0.24.0 → shellscripts-0.25.0}/src/shell_scripts/commands/video2h265.py +0 -0
- {shellscripts-0.24.0 → shellscripts-0.25.0}/src/shell_scripts/commands/view_cmd.py +0 -0
- {shellscripts-0.24.0 → shellscripts-0.25.0}/src/shell_scripts/commands/vscode_cmd.py +0 -0
- {shellscripts-0.24.0 → shellscripts-0.25.0}/src/shell_scripts/commands/vsinsider_cmd.py +0 -0
- {shellscripts-0.24.0 → shellscripts-0.25.0}/src/shell_scripts/config.py +0 -0
- {shellscripts-0.24.0 → shellscripts-0.25.0}/src/shellscripts.egg-info/dependency_links.txt +0 -0
- {shellscripts-0.24.0 → shellscripts-0.25.0}/src/shellscripts.egg-info/entry_points.txt +0 -0
- {shellscripts-0.24.0 → shellscripts-0.25.0}/src/shellscripts.egg-info/top_level.txt +0 -0
- {shellscripts-0.24.0 → shellscripts-0.25.0}/tests/test_tst_001_002_core.py +0 -0
- {shellscripts-0.24.0 → shellscripts-0.25.0}/tests/test_tst_004_bin_links_clean.py +0 -0
- {shellscripts-0.24.0 → shellscripts-0.25.0}/tests/test_tst_005_cli_launchers.py +0 -0
- {shellscripts-0.24.0 → shellscripts-0.25.0}/tests/test_tst_006_dc_common.py +0 -0
- {shellscripts-0.24.0 → shellscripts-0.25.0}/tests/test_tst_007_pdf_commands.py +0 -0
- {shellscripts-0.24.0 → shellscripts-0.25.0}/tests/test_tst_008_env_commands.py +0 -0
- {shellscripts-0.24.0 → shellscripts-0.25.0}/tests/test_tst_010_req_cmd.py +0 -0
- {shellscripts-0.24.0 → shellscripts-0.25.0}/tests/test_tst_011_video_commands.py +0 -0
- {shellscripts-0.24.0 → shellscripts-0.25.0}/tests/test_tst_012_workflow_runtime.py +0 -0
- {shellscripts-0.24.0 → shellscripts-0.25.0}/tests/test_tst_013_release_pypi_gating.py +0 -0
- {shellscripts-0.24.0 → shellscripts-0.25.0}/tests/test_tst_015_pre_release_check.py +0 -0
- {shellscripts-0.24.0 → shellscripts-0.25.0}/tests/test_tst_016_release_precheck_gating.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: shellscripts
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.25.0
|
|
4
4
|
Summary: Execute useful shell scripts via an uvx-compatible CLI interface.
|
|
5
5
|
Author: Francesco Rolando
|
|
6
6
|
License-Expression: GPL-3.0-only
|
|
@@ -31,7 +31,7 @@ Dynamic: license-file
|
|
|
31
31
|
> * **No Support or Feature Requests:** Please **do not** open issues, bug reports, or feature requests. They will not be addressed or accepted at this stage of development.
|
|
32
32
|
> * **No Warranty:** This software is provided **"AS IS"**, without warranty of any kind, express or implied. You may use it strictly for **testing and evaluation purposes** at your own sole risk.
|
|
33
33
|
|
|
34
|
-
# s/shellScripts (0.
|
|
34
|
+
# s/shellScripts (0.25.0)
|
|
35
35
|
|
|
36
36
|
<p align="center">
|
|
37
37
|
<img src="https://img.shields.io/badge/python-3.11%2B-3776AB?style=flat-square&logo=python&logoColor=white" alt="Python 3.11+">
|
|
@@ -65,8 +65,7 @@ PDF/DICOM utilities, development helpers, and editor integrations, exposed throu
|
|
|
65
65
|
|
|
66
66
|
## Feature Highlights
|
|
67
67
|
- Single CLI entrypoint with command dispatch and grouped built-in help (`shellscripts` and alias `s`).
|
|
68
|
-
-
|
|
69
|
-
- Project-context launchers for AI CLIs (`claude`, `codex`, `copilot`, `gemini`, `kiro`, `opencode`, `pi`) and IDEs (`vscode`, `vsinsider`).
|
|
68
|
+
- Project-context launchers for AI CLIs (`agy`, `claude`, `codex`, `copilot`, `gemini`, `kiro`, `opencode`, `pi`) and IDEs (`vscode`, `vsinsider`).
|
|
70
69
|
- PDF workflow commands for crop, merge, split, TOC cleanup, and tiling.
|
|
71
70
|
- DICOM helpers (`dicom2jpg`, `dicomviewer`) and video transcoders (`video2h264`, `video2h265`).
|
|
72
71
|
- Project maintenance and automation commands (`req`, `clean`, `venv`, `tests`, `doxygen`, `ubuntu-dark-theme`).
|
|
@@ -77,9 +76,8 @@ PDF/DICOM utilities, development helpers, and editor integrations, exposed throu
|
|
|
77
76
|
|
|
78
77
|
- Python `>=3.11`.
|
|
79
78
|
- Astral `uv` is required for install and runtime flows (`uv tool install`, `uvx`, `uv run`).
|
|
80
|
-
- Git is required for commands that enforce repository-root execution (`claude`, `codex`, `copilot`, `gemini`, `kiro`, `opencode`, `pi`, `clean`, `venv`, `tests`, `doxygen`, `vscode`, `vsinsider`).
|
|
79
|
+
- Git is required for commands that enforce repository-root execution (`agy`, `claude`, `codex`, `copilot`, `gemini`, `kiro`, `opencode`, `pi`, `clean`, `venv`, `tests`, `doxygen`, `vscode`, `vsinsider`).
|
|
81
80
|
- Command-specific external tools are required only for related commands:
|
|
82
|
-
- `npm` (and `sudo` on non-Windows) for npm-based `ai-install` targets.
|
|
83
81
|
- `req` for the `req` command.
|
|
84
82
|
- `doxygen` (plus optional `make` and `pdflatex`) for `doxygen`.
|
|
85
83
|
- `gs`, `pdfinfo`, `qpdf`, `pdftk`, `plakativ` for PDF commands.
|
|
@@ -200,14 +198,14 @@ Top-level configuration keys:
|
|
|
200
198
|
|
|
201
199
|
| Command | Purpose |
|
|
202
200
|
|---|---|
|
|
203
|
-
| `
|
|
201
|
+
| `agy` | Launch Antigravity CLI in project context (YOLO mode, pass-through args). |
|
|
204
202
|
| `claude` | Launch Claude CLI in project context. |
|
|
205
203
|
| `codex` | Launch Codex CLI in project context with auth sync and `CODEX_HOME`. |
|
|
206
204
|
| `copilot` | Launch Copilot CLI in project context. |
|
|
207
205
|
| `gemini` | Launch Gemini CLI in project context. |
|
|
208
206
|
| `kiro` | Launch Kiro CLI in project context. |
|
|
209
207
|
| `opencode` | Launch OpenCode CLI in project context. |
|
|
210
|
-
| `pi` | Launch pi.dev CLI in project context (
|
|
208
|
+
| `pi` | Launch pi.dev CLI in project context (forwards all arguments unchanged). |
|
|
211
209
|
| `clean` | Find and delete cache directories under the project root (or a passed directory). |
|
|
212
210
|
| `req` | Run useReq bootstrap on current directory, first-level dirs, or recursively. |
|
|
213
211
|
| `venv` | Recreate `.venv` and install `requirements.txt` if present. |
|
|
@@ -233,25 +231,13 @@ Top-level configuration keys:
|
|
|
233
231
|
|
|
234
232
|
### Selected Usage Examples
|
|
235
233
|
|
|
236
|
-
|
|
234
|
+
Launch Antigravity CLI in YOLO mode (command help lists the available AI CLIs in alphabetical order):
|
|
237
235
|
|
|
238
236
|
```bash
|
|
239
|
-
s
|
|
237
|
+
s agy
|
|
240
238
|
```
|
|
241
239
|
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
```bash
|
|
245
|
-
s ai-install --codex --gemini --claude
|
|
246
|
-
```
|
|
247
|
-
|
|
248
|
-
Run pi.dev with default tools injected automatically:
|
|
249
|
-
|
|
250
|
-
```bash
|
|
251
|
-
s pi
|
|
252
|
-
```
|
|
253
|
-
|
|
254
|
-
Override pi tools explicitly:
|
|
240
|
+
Run pi.dev CLI forwarding all arguments unchanged (no implicit option injection):
|
|
255
241
|
|
|
256
242
|
```bash
|
|
257
243
|
s pi --tools read,bash,grep,find
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
> * **No Support or Feature Requests:** Please **do not** open issues, bug reports, or feature requests. They will not be addressed or accepted at this stage of development.
|
|
11
11
|
> * **No Warranty:** This software is provided **"AS IS"**, without warranty of any kind, express or implied. You may use it strictly for **testing and evaluation purposes** at your own sole risk.
|
|
12
12
|
|
|
13
|
-
# s/shellScripts (0.
|
|
13
|
+
# s/shellScripts (0.25.0)
|
|
14
14
|
|
|
15
15
|
<p align="center">
|
|
16
16
|
<img src="https://img.shields.io/badge/python-3.11%2B-3776AB?style=flat-square&logo=python&logoColor=white" alt="Python 3.11+">
|
|
@@ -44,8 +44,7 @@ PDF/DICOM utilities, development helpers, and editor integrations, exposed throu
|
|
|
44
44
|
|
|
45
45
|
## Feature Highlights
|
|
46
46
|
- Single CLI entrypoint with command dispatch and grouped built-in help (`shellscripts` and alias `s`).
|
|
47
|
-
-
|
|
48
|
-
- Project-context launchers for AI CLIs (`claude`, `codex`, `copilot`, `gemini`, `kiro`, `opencode`, `pi`) and IDEs (`vscode`, `vsinsider`).
|
|
47
|
+
- Project-context launchers for AI CLIs (`agy`, `claude`, `codex`, `copilot`, `gemini`, `kiro`, `opencode`, `pi`) and IDEs (`vscode`, `vsinsider`).
|
|
49
48
|
- PDF workflow commands for crop, merge, split, TOC cleanup, and tiling.
|
|
50
49
|
- DICOM helpers (`dicom2jpg`, `dicomviewer`) and video transcoders (`video2h264`, `video2h265`).
|
|
51
50
|
- Project maintenance and automation commands (`req`, `clean`, `venv`, `tests`, `doxygen`, `ubuntu-dark-theme`).
|
|
@@ -56,9 +55,8 @@ PDF/DICOM utilities, development helpers, and editor integrations, exposed throu
|
|
|
56
55
|
|
|
57
56
|
- Python `>=3.11`.
|
|
58
57
|
- Astral `uv` is required for install and runtime flows (`uv tool install`, `uvx`, `uv run`).
|
|
59
|
-
- Git is required for commands that enforce repository-root execution (`claude`, `codex`, `copilot`, `gemini`, `kiro`, `opencode`, `pi`, `clean`, `venv`, `tests`, `doxygen`, `vscode`, `vsinsider`).
|
|
58
|
+
- Git is required for commands that enforce repository-root execution (`agy`, `claude`, `codex`, `copilot`, `gemini`, `kiro`, `opencode`, `pi`, `clean`, `venv`, `tests`, `doxygen`, `vscode`, `vsinsider`).
|
|
60
59
|
- Command-specific external tools are required only for related commands:
|
|
61
|
-
- `npm` (and `sudo` on non-Windows) for npm-based `ai-install` targets.
|
|
62
60
|
- `req` for the `req` command.
|
|
63
61
|
- `doxygen` (plus optional `make` and `pdflatex`) for `doxygen`.
|
|
64
62
|
- `gs`, `pdfinfo`, `qpdf`, `pdftk`, `plakativ` for PDF commands.
|
|
@@ -179,14 +177,14 @@ Top-level configuration keys:
|
|
|
179
177
|
|
|
180
178
|
| Command | Purpose |
|
|
181
179
|
|---|---|
|
|
182
|
-
| `
|
|
180
|
+
| `agy` | Launch Antigravity CLI in project context (YOLO mode, pass-through args). |
|
|
183
181
|
| `claude` | Launch Claude CLI in project context. |
|
|
184
182
|
| `codex` | Launch Codex CLI in project context with auth sync and `CODEX_HOME`. |
|
|
185
183
|
| `copilot` | Launch Copilot CLI in project context. |
|
|
186
184
|
| `gemini` | Launch Gemini CLI in project context. |
|
|
187
185
|
| `kiro` | Launch Kiro CLI in project context. |
|
|
188
186
|
| `opencode` | Launch OpenCode CLI in project context. |
|
|
189
|
-
| `pi` | Launch pi.dev CLI in project context (
|
|
187
|
+
| `pi` | Launch pi.dev CLI in project context (forwards all arguments unchanged). |
|
|
190
188
|
| `clean` | Find and delete cache directories under the project root (or a passed directory). |
|
|
191
189
|
| `req` | Run useReq bootstrap on current directory, first-level dirs, or recursively. |
|
|
192
190
|
| `venv` | Recreate `.venv` and install `requirements.txt` if present. |
|
|
@@ -212,25 +210,13 @@ Top-level configuration keys:
|
|
|
212
210
|
|
|
213
211
|
### Selected Usage Examples
|
|
214
212
|
|
|
215
|
-
|
|
213
|
+
Launch Antigravity CLI in YOLO mode (command help lists the available AI CLIs in alphabetical order):
|
|
216
214
|
|
|
217
215
|
```bash
|
|
218
|
-
s
|
|
216
|
+
s agy
|
|
219
217
|
```
|
|
220
218
|
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
```bash
|
|
224
|
-
s ai-install --codex --gemini --claude
|
|
225
|
-
```
|
|
226
|
-
|
|
227
|
-
Run pi.dev with default tools injected automatically:
|
|
228
|
-
|
|
229
|
-
```bash
|
|
230
|
-
s pi
|
|
231
|
-
```
|
|
232
|
-
|
|
233
|
-
Override pi tools explicitly:
|
|
219
|
+
Run pi.dev CLI forwarding all arguments unchanged (no implicit option injection):
|
|
234
220
|
|
|
235
221
|
```bash
|
|
236
222
|
s pi --tools read,bash,grep,find
|
|
@@ -15,7 +15,7 @@ from types import ModuleType
|
|
|
15
15
|
# Removing an entry removes command discoverability and dispatch reachability.
|
|
16
16
|
# @satisfies PRJ-003, DES-001
|
|
17
17
|
_COMMAND_MODULES = {
|
|
18
|
-
"
|
|
18
|
+
"agy": "shell_scripts.commands.agy",
|
|
19
19
|
"clean": "shell_scripts.commands.clean",
|
|
20
20
|
"claude": "shell_scripts.commands.claude",
|
|
21
21
|
"codex": "shell_scripts.commands.codex",
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""@brief Antigravity CLI launcher in project context.
|
|
3
|
+
|
|
4
|
+
@details Ensures project-root prerequisite and executable availability before
|
|
5
|
+
blocking subprocess invocation of `agy` in YOLO mode
|
|
6
|
+
(`--dangerously-skip-permissions`); inline help lists the registered AI CLI
|
|
7
|
+
launch commands in alphabetical order.
|
|
8
|
+
@satisfies REQ-085, REQ-086, REQ-055, REQ-056, REQ-064
|
|
9
|
+
"""
|
|
10
|
+
|
|
11
|
+
import subprocess
|
|
12
|
+
|
|
13
|
+
from shell_scripts.utils import require_project_root, require_commands
|
|
14
|
+
|
|
15
|
+
## @var PROGRAM
|
|
16
|
+
# @brief Base CLI program name used in help output.
|
|
17
|
+
# @details Constant identifier for usage-line rendering in command help.
|
|
18
|
+
PROGRAM = "shellscripts"
|
|
19
|
+
## @var DESCRIPTION
|
|
20
|
+
# @brief One-line command description for dispatcher help surfaces.
|
|
21
|
+
# @details Exposed by command registry introspection (`get_all_commands`).
|
|
22
|
+
DESCRIPTION = "Launch Antigravity CLI in the project context."
|
|
23
|
+
## @var AI_CLI_COMMANDS
|
|
24
|
+
# @brief Alphabetically sorted AI CLI launch command tokens rendered in inline help.
|
|
25
|
+
# @details Derived through `sorted()` at import time so token-set edits preserve
|
|
26
|
+
# the REQ-086 alphabetical rendering contract; contains launcher commands only
|
|
27
|
+
# and excludes installer command tokens.
|
|
28
|
+
# @satisfies REQ-086
|
|
29
|
+
AI_CLI_COMMANDS = tuple(sorted((
|
|
30
|
+
"agy",
|
|
31
|
+
"claude",
|
|
32
|
+
"codex",
|
|
33
|
+
"copilot",
|
|
34
|
+
"gemini",
|
|
35
|
+
"kiro",
|
|
36
|
+
"opencode",
|
|
37
|
+
"pi",
|
|
38
|
+
)))
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
def print_help(version):
|
|
42
|
+
"""@brief Print command-specific help for `agy`.
|
|
43
|
+
|
|
44
|
+
@details Emits usage and pass-through argument behavior, then renders the
|
|
45
|
+
AI CLI launch command tokens from `AI_CLI_COMMANDS`, one per line, in
|
|
46
|
+
ascending alphabetical order; does not mutate process state.
|
|
47
|
+
Time complexity O(n) over registered AI CLI token count.
|
|
48
|
+
@param version {str} CLI version string propagated by dispatcher.
|
|
49
|
+
@return {None} Writes help text to stdout.
|
|
50
|
+
@satisfies DES-008, REQ-086
|
|
51
|
+
"""
|
|
52
|
+
|
|
53
|
+
print(f"Usage: {PROGRAM} agy [args...] ({version})")
|
|
54
|
+
print()
|
|
55
|
+
print("agy options:")
|
|
56
|
+
print(" All arguments are passed through to the Antigravity CLI.")
|
|
57
|
+
print(" --help - Show this help message.")
|
|
58
|
+
print()
|
|
59
|
+
print("Available AI CLIs (alphabetical order):")
|
|
60
|
+
for command_token in AI_CLI_COMMANDS:
|
|
61
|
+
print(f" {command_token}")
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
def run(args):
|
|
65
|
+
"""@brief Launch Antigravity CLI in YOLO mode after executable validation.
|
|
66
|
+
|
|
67
|
+
@details Resolves project root, builds the fixed command vector
|
|
68
|
+
`[agy, --dangerously-skip-permissions] + args`, resolves the executable
|
|
69
|
+
path via `require_commands`, then executes it through blocking
|
|
70
|
+
`subprocess.run` with inherited stdio. Time complexity O(n) over forwarded
|
|
71
|
+
argument count.
|
|
72
|
+
@param args {list[str]} Additional CLI args forwarded to Antigravity.
|
|
73
|
+
@return {int} Child process return code.
|
|
74
|
+
@satisfies REQ-085, REQ-055, REQ-056, REQ-064
|
|
75
|
+
"""
|
|
76
|
+
|
|
77
|
+
require_project_root()
|
|
78
|
+
cmd = ["agy", "--dangerously-skip-permissions"] + args
|
|
79
|
+
cmd[0] = require_commands(cmd[0])
|
|
80
|
+
result = subprocess.run(cmd)
|
|
81
|
+
return result.returncode
|
|
@@ -155,7 +155,7 @@ def is_windows():
|
|
|
155
155
|
|
|
156
156
|
@details Evaluates cached runtime token from `get_runtime_os`.
|
|
157
157
|
@return {bool} `True` when runtime OS is Windows; otherwise `False`.
|
|
158
|
-
@satisfies
|
|
158
|
+
@satisfies REQ-047
|
|
159
159
|
"""
|
|
160
160
|
|
|
161
161
|
return get_runtime_os() == "windows"
|
|
@@ -263,11 +263,12 @@ def print_remote_latest_versions(current_version: str) -> None:
|
|
|
263
263
|
|
|
264
264
|
@details Emits one `<source> latest: <version>` line per remote source in
|
|
265
265
|
fixed order (PyPI, GitHub). A failed source lookup prints one bright-red
|
|
266
|
-
|
|
267
|
-
|
|
266
|
+
`<source> latest: unknown (<reason>)` line where `<reason>` is the
|
|
267
|
+
`_format_request_error` descriptor of the actual failure, and the remaining
|
|
268
|
+
source is still processed. Complexity O(1) excluding network latency.
|
|
268
269
|
@param current_version {str} Installed package version used in User-Agent.
|
|
269
270
|
@return {None} Writes two report or error lines to stdout.
|
|
270
|
-
@satisfies REQ-003, REQ-075, DES-020
|
|
271
|
+
@satisfies REQ-003, REQ-075, REQ-084, DES-020
|
|
271
272
|
"""
|
|
272
273
|
|
|
273
274
|
for source_label, fetch_version in (
|
|
@@ -278,8 +279,8 @@ def print_remote_latest_versions(current_version: str) -> None:
|
|
|
278
279
|
latest_version = fetch_version(current_version).lstrip("v")
|
|
279
280
|
except Exception as error:
|
|
280
281
|
print(
|
|
281
|
-
f"{BRIGHT_RED}{source_label} latest
|
|
282
|
-
f"{_format_request_error(error)}
|
|
282
|
+
f"{BRIGHT_RED}{source_label} latest: unknown "
|
|
283
|
+
f"({_format_request_error(error)}){RESET}"
|
|
283
284
|
)
|
|
284
285
|
continue
|
|
285
286
|
print(f"{source_label} latest: {latest_version}")
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: shellscripts
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.25.0
|
|
4
4
|
Summary: Execute useful shell scripts via an uvx-compatible CLI interface.
|
|
5
5
|
Author: Francesco Rolando
|
|
6
6
|
License-Expression: GPL-3.0-only
|
|
@@ -31,7 +31,7 @@ Dynamic: license-file
|
|
|
31
31
|
> * **No Support or Feature Requests:** Please **do not** open issues, bug reports, or feature requests. They will not be addressed or accepted at this stage of development.
|
|
32
32
|
> * **No Warranty:** This software is provided **"AS IS"**, without warranty of any kind, express or implied. You may use it strictly for **testing and evaluation purposes** at your own sole risk.
|
|
33
33
|
|
|
34
|
-
# s/shellScripts (0.
|
|
34
|
+
# s/shellScripts (0.25.0)
|
|
35
35
|
|
|
36
36
|
<p align="center">
|
|
37
37
|
<img src="https://img.shields.io/badge/python-3.11%2B-3776AB?style=flat-square&logo=python&logoColor=white" alt="Python 3.11+">
|
|
@@ -65,8 +65,7 @@ PDF/DICOM utilities, development helpers, and editor integrations, exposed throu
|
|
|
65
65
|
|
|
66
66
|
## Feature Highlights
|
|
67
67
|
- Single CLI entrypoint with command dispatch and grouped built-in help (`shellscripts` and alias `s`).
|
|
68
|
-
-
|
|
69
|
-
- Project-context launchers for AI CLIs (`claude`, `codex`, `copilot`, `gemini`, `kiro`, `opencode`, `pi`) and IDEs (`vscode`, `vsinsider`).
|
|
68
|
+
- Project-context launchers for AI CLIs (`agy`, `claude`, `codex`, `copilot`, `gemini`, `kiro`, `opencode`, `pi`) and IDEs (`vscode`, `vsinsider`).
|
|
70
69
|
- PDF workflow commands for crop, merge, split, TOC cleanup, and tiling.
|
|
71
70
|
- DICOM helpers (`dicom2jpg`, `dicomviewer`) and video transcoders (`video2h264`, `video2h265`).
|
|
72
71
|
- Project maintenance and automation commands (`req`, `clean`, `venv`, `tests`, `doxygen`, `ubuntu-dark-theme`).
|
|
@@ -77,9 +76,8 @@ PDF/DICOM utilities, development helpers, and editor integrations, exposed throu
|
|
|
77
76
|
|
|
78
77
|
- Python `>=3.11`.
|
|
79
78
|
- Astral `uv` is required for install and runtime flows (`uv tool install`, `uvx`, `uv run`).
|
|
80
|
-
- Git is required for commands that enforce repository-root execution (`claude`, `codex`, `copilot`, `gemini`, `kiro`, `opencode`, `pi`, `clean`, `venv`, `tests`, `doxygen`, `vscode`, `vsinsider`).
|
|
79
|
+
- Git is required for commands that enforce repository-root execution (`agy`, `claude`, `codex`, `copilot`, `gemini`, `kiro`, `opencode`, `pi`, `clean`, `venv`, `tests`, `doxygen`, `vscode`, `vsinsider`).
|
|
81
80
|
- Command-specific external tools are required only for related commands:
|
|
82
|
-
- `npm` (and `sudo` on non-Windows) for npm-based `ai-install` targets.
|
|
83
81
|
- `req` for the `req` command.
|
|
84
82
|
- `doxygen` (plus optional `make` and `pdflatex`) for `doxygen`.
|
|
85
83
|
- `gs`, `pdfinfo`, `qpdf`, `pdftk`, `plakativ` for PDF commands.
|
|
@@ -200,14 +198,14 @@ Top-level configuration keys:
|
|
|
200
198
|
|
|
201
199
|
| Command | Purpose |
|
|
202
200
|
|---|---|
|
|
203
|
-
| `
|
|
201
|
+
| `agy` | Launch Antigravity CLI in project context (YOLO mode, pass-through args). |
|
|
204
202
|
| `claude` | Launch Claude CLI in project context. |
|
|
205
203
|
| `codex` | Launch Codex CLI in project context with auth sync and `CODEX_HOME`. |
|
|
206
204
|
| `copilot` | Launch Copilot CLI in project context. |
|
|
207
205
|
| `gemini` | Launch Gemini CLI in project context. |
|
|
208
206
|
| `kiro` | Launch Kiro CLI in project context. |
|
|
209
207
|
| `opencode` | Launch OpenCode CLI in project context. |
|
|
210
|
-
| `pi` | Launch pi.dev CLI in project context (
|
|
208
|
+
| `pi` | Launch pi.dev CLI in project context (forwards all arguments unchanged). |
|
|
211
209
|
| `clean` | Find and delete cache directories under the project root (or a passed directory). |
|
|
212
210
|
| `req` | Run useReq bootstrap on current directory, first-level dirs, or recursively. |
|
|
213
211
|
| `venv` | Recreate `.venv` and install `requirements.txt` if present. |
|
|
@@ -233,25 +231,13 @@ Top-level configuration keys:
|
|
|
233
231
|
|
|
234
232
|
### Selected Usage Examples
|
|
235
233
|
|
|
236
|
-
|
|
234
|
+
Launch Antigravity CLI in YOLO mode (command help lists the available AI CLIs in alphabetical order):
|
|
237
235
|
|
|
238
236
|
```bash
|
|
239
|
-
s
|
|
237
|
+
s agy
|
|
240
238
|
```
|
|
241
239
|
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
```bash
|
|
245
|
-
s ai-install --codex --gemini --claude
|
|
246
|
-
```
|
|
247
|
-
|
|
248
|
-
Run pi.dev with default tools injected automatically:
|
|
249
|
-
|
|
250
|
-
```bash
|
|
251
|
-
s pi
|
|
252
|
-
```
|
|
253
|
-
|
|
254
|
-
Override pi tools explicitly:
|
|
240
|
+
Run pi.dev CLI forwarding all arguments unchanged (no implicit option injection):
|
|
255
241
|
|
|
256
242
|
```bash
|
|
257
243
|
s pi --tools read,bash,grep,find
|
|
@@ -9,7 +9,7 @@ src/shell_scripts/utils.py
|
|
|
9
9
|
src/shell_scripts/version_check.py
|
|
10
10
|
src/shell_scripts/commands/__init__.py
|
|
11
11
|
src/shell_scripts/commands/_dc_common.py
|
|
12
|
-
src/shell_scripts/commands/
|
|
12
|
+
src/shell_scripts/commands/agy.py
|
|
13
13
|
src/shell_scripts/commands/bin_links.py
|
|
14
14
|
src/shell_scripts/commands/claude.py
|
|
15
15
|
src/shell_scripts/commands/clean.py
|
|
@@ -46,7 +46,6 @@ src/shellscripts.egg-info/dependency_links.txt
|
|
|
46
46
|
src/shellscripts.egg-info/entry_points.txt
|
|
47
47
|
src/shellscripts.egg-info/top_level.txt
|
|
48
48
|
tests/test_tst_001_002_core.py
|
|
49
|
-
tests/test_tst_003_ai_install.py
|
|
50
49
|
tests/test_tst_004_bin_links_clean.py
|
|
51
50
|
tests/test_tst_005_cli_launchers.py
|
|
52
51
|
tests/test_tst_006_dc_common.py
|
|
@@ -58,4 +57,5 @@ tests/test_tst_012_workflow_runtime.py
|
|
|
58
57
|
tests/test_tst_013_release_pypi_gating.py
|
|
59
58
|
tests/test_tst_014_pypi_version_source.py
|
|
60
59
|
tests/test_tst_015_pre_release_check.py
|
|
61
|
-
tests/test_tst_016_release_precheck_gating.py
|
|
60
|
+
tests/test_tst_016_release_precheck_gating.py
|
|
61
|
+
tests/test_tst_017_agy_command.py
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
import json
|
|
16
16
|
import types
|
|
17
17
|
import urllib.error
|
|
18
|
+
from email.message import Message
|
|
18
19
|
|
|
19
20
|
import shell_scripts.core as core
|
|
20
21
|
from shell_scripts.config import get_default_runtime_config
|
|
@@ -204,12 +205,12 @@ def test_print_remote_latest_versions_reports_failed_source_and_continues(
|
|
|
204
205
|
"""
|
|
205
206
|
@brief Validate per-source error reporting during version report.
|
|
206
207
|
@details Forces the PyPI lookup to raise a non-HTTP exception and asserts
|
|
207
|
-
|
|
208
|
-
emitted.
|
|
208
|
+
the bright-red `PyPI latest: unknown (<reason>)` failure line while the
|
|
209
|
+
GitHub line is still emitted.
|
|
209
210
|
@param monkeypatch {pytest.MonkeyPatch} Runtime patch helper.
|
|
210
211
|
@param capsys {pytest.CaptureFixture[str]} Stdout/stderr capture helper.
|
|
211
212
|
@return {None} Assertions only.
|
|
212
|
-
@satisfies TST-014, DES-020
|
|
213
|
+
@satisfies TST-014, REQ-084, DES-020
|
|
213
214
|
"""
|
|
214
215
|
|
|
215
216
|
def _raise_url_error(_version):
|
|
@@ -229,11 +230,54 @@ def test_print_remote_latest_versions_reports_failed_source_and_continues(
|
|
|
229
230
|
version_check.print_remote_latest_versions("0.1.0")
|
|
230
231
|
captured = capsys.readouterr()
|
|
231
232
|
|
|
232
|
-
|
|
233
|
-
assert
|
|
233
|
+
expected_output = "PyPI latest: unknown (URLError: <urlopen error pypi unreachable>)"
|
|
234
|
+
assert expected_output in captured.out
|
|
235
|
+
assert "PyPI latest check failed" not in captured.out
|
|
234
236
|
assert "GitHub latest: 0.1.0" in captured.out
|
|
235
237
|
|
|
236
238
|
|
|
239
|
+
def test_print_remote_latest_versions_reports_github_http_404(
|
|
240
|
+
monkeypatch,
|
|
241
|
+
capsys,
|
|
242
|
+
):
|
|
243
|
+
"""
|
|
244
|
+
@brief Validate GitHub HTTP failure rendering during version report.
|
|
245
|
+
@details Forces the GitHub lookup to raise an HTTP 404 error and asserts
|
|
246
|
+
the bright-red `GitHub latest: unknown (HTTP 404)` failure line while
|
|
247
|
+
the PyPI line is still emitted.
|
|
248
|
+
@param monkeypatch {pytest.MonkeyPatch} Runtime patch helper.
|
|
249
|
+
@param capsys {pytest.CaptureFixture[str]} Stdout/stderr capture helper.
|
|
250
|
+
@return {None} Assertions only.
|
|
251
|
+
@satisfies TST-014, REQ-084, DES-020
|
|
252
|
+
"""
|
|
253
|
+
|
|
254
|
+
def _raise_http_404(_version):
|
|
255
|
+
"""
|
|
256
|
+
@brief Simulate GitHub API HTTP 404 failure.
|
|
257
|
+
@param _version {str} Unused installed version.
|
|
258
|
+
@return {None} Always raises.
|
|
259
|
+
@throws {urllib.error.HTTPError} Deterministic HTTP failure.
|
|
260
|
+
"""
|
|
261
|
+
raise urllib.error.HTTPError(
|
|
262
|
+
version_check.GITHUB_API_URL, 404, "Not Found", Message(), None
|
|
263
|
+
)
|
|
264
|
+
|
|
265
|
+
monkeypatch.setattr(
|
|
266
|
+
version_check, "fetch_pypi_latest_version", lambda _version: "0.1.0"
|
|
267
|
+
)
|
|
268
|
+
monkeypatch.setattr(
|
|
269
|
+
version_check, "fetch_github_latest_release", _raise_http_404
|
|
270
|
+
)
|
|
271
|
+
|
|
272
|
+
version_check.print_remote_latest_versions("0.1.0")
|
|
273
|
+
captured = capsys.readouterr()
|
|
274
|
+
|
|
275
|
+
expected_output = "GitHub latest: unknown (HTTP 404)"
|
|
276
|
+
assert expected_output in captured.out
|
|
277
|
+
assert "GitHub latest check failed" not in captured.out
|
|
278
|
+
assert "PyPI latest: 0.1.0" in captured.out
|
|
279
|
+
|
|
280
|
+
|
|
237
281
|
def test_main_version_prints_installed_pypi_and_github_lines(
|
|
238
282
|
monkeypatch,
|
|
239
283
|
capsys,
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
"""
|
|
2
|
+
@brief Validate Antigravity CLI launcher command and inline help contract.
|
|
3
|
+
@details HDT Generator-mode suite. Static analysis artifact:
|
|
4
|
+
UUTs: `shell_scripts.commands.agy.run` (Level 1: project-root guard,
|
|
5
|
+
executable resolution, subprocess boundary),
|
|
6
|
+
`shell_scripts.commands.agy.print_help` (Level 0: pure stdout rendering),
|
|
7
|
+
`shell_scripts.commands.agy.AI_CLI_COMMANDS` (Level 0 constant),
|
|
8
|
+
registry/global-help exposure (Level 0 lookups).
|
|
9
|
+
External dependencies isolated: `subprocess.run`, `require_project_root`,
|
|
10
|
+
`require_commands`. The missing-executable error path terminates through the
|
|
11
|
+
shared `require_commands` helper already covered by the TST-005 policy, so no
|
|
12
|
+
launcher-local error case exists in this module.
|
|
13
|
+
@satisfies TST-017, REQ-085, REQ-086
|
|
14
|
+
@return {None} Pytest module scope.
|
|
15
|
+
"""
|
|
16
|
+
|
|
17
|
+
from pathlib import Path
|
|
18
|
+
import types
|
|
19
|
+
|
|
20
|
+
import shell_scripts.commands.agy as agy
|
|
21
|
+
import shell_scripts.core as core
|
|
22
|
+
from shell_scripts.commands import get_command
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
def test_agy_executes_expected_command(monkeypatch):
|
|
26
|
+
"""
|
|
27
|
+
@brief Validate agy YOLO-mode execution contract with forwarded arguments.
|
|
28
|
+
@details Stubs project-root guard and subprocess boundary to assert the
|
|
29
|
+
fixed command vector, argument forwarding, default stdio/wait kwargs,
|
|
30
|
+
and return-code propagation.
|
|
31
|
+
@param monkeypatch {pytest.MonkeyPatch} Runtime patch helper.
|
|
32
|
+
@return {None} Assertions only.
|
|
33
|
+
@satisfies TST-017, REQ-085, REQ-064
|
|
34
|
+
"""
|
|
35
|
+
|
|
36
|
+
observed = {}
|
|
37
|
+
|
|
38
|
+
def _fake_run(command, **kwargs):
|
|
39
|
+
observed["command"] = command
|
|
40
|
+
observed["kwargs"] = kwargs
|
|
41
|
+
return types.SimpleNamespace(returncode=11)
|
|
42
|
+
|
|
43
|
+
monkeypatch.setattr(agy, "require_project_root", lambda: Path("/tmp/p"))
|
|
44
|
+
monkeypatch.setattr(agy, "require_commands", lambda *cmds: cmds[0])
|
|
45
|
+
monkeypatch.setattr(agy.subprocess, "run", _fake_run)
|
|
46
|
+
|
|
47
|
+
result = agy.run(["--flag"])
|
|
48
|
+
|
|
49
|
+
assert result == 11
|
|
50
|
+
assert observed["command"] == [
|
|
51
|
+
"agy",
|
|
52
|
+
"--dangerously-skip-permissions",
|
|
53
|
+
"--flag",
|
|
54
|
+
]
|
|
55
|
+
assert observed["kwargs"] == {}
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
def test_agy_empty_args_execute_fixed_yolo_vector_only(monkeypatch):
|
|
59
|
+
"""
|
|
60
|
+
@brief Validate agy boundary behavior with empty forwarded arguments.
|
|
61
|
+
@details Asserts that the command vector contains exactly the executable
|
|
62
|
+
and the YOLO flag when no pass-through arguments are supplied.
|
|
63
|
+
@param monkeypatch {pytest.MonkeyPatch} Runtime patch helper.
|
|
64
|
+
@return {None} Assertions only.
|
|
65
|
+
@satisfies TST-017, REQ-085
|
|
66
|
+
"""
|
|
67
|
+
|
|
68
|
+
observed = {}
|
|
69
|
+
|
|
70
|
+
def _fake_run(command, **kwargs):
|
|
71
|
+
observed["command"] = command
|
|
72
|
+
return types.SimpleNamespace(returncode=0)
|
|
73
|
+
|
|
74
|
+
monkeypatch.setattr(agy, "require_project_root", lambda: Path("/tmp/p"))
|
|
75
|
+
monkeypatch.setattr(agy, "require_commands", lambda *cmds: cmds[0])
|
|
76
|
+
monkeypatch.setattr(agy.subprocess, "run", _fake_run)
|
|
77
|
+
|
|
78
|
+
result = agy.run([])
|
|
79
|
+
|
|
80
|
+
assert result == 0
|
|
81
|
+
assert observed["command"] == ["agy", "--dangerously-skip-permissions"]
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
def test_agy_print_help_lists_ai_cli_tokens_alphabetically(capsys):
|
|
85
|
+
"""
|
|
86
|
+
@brief Validate alphabetical AI CLI listing inside agy inline help.
|
|
87
|
+
@details Captures `print_help` output, isolates the AI CLI listing section,
|
|
88
|
+
and asserts the exact expected token set rendered once each in ascending
|
|
89
|
+
alphabetical order.
|
|
90
|
+
@param capsys {pytest.CaptureFixture} Stdout capture fixture.
|
|
91
|
+
@return {None} Assertions only.
|
|
92
|
+
@satisfies TST-017, REQ-086
|
|
93
|
+
"""
|
|
94
|
+
|
|
95
|
+
expected_tokens = (
|
|
96
|
+
"agy",
|
|
97
|
+
"claude",
|
|
98
|
+
"codex",
|
|
99
|
+
"copilot",
|
|
100
|
+
"gemini",
|
|
101
|
+
"kiro",
|
|
102
|
+
"opencode",
|
|
103
|
+
"pi",
|
|
104
|
+
)
|
|
105
|
+
|
|
106
|
+
agy.print_help("0.0.0-test")
|
|
107
|
+
|
|
108
|
+
output = capsys.readouterr().out
|
|
109
|
+
assert "Available AI CLIs (alphabetical order):" in output
|
|
110
|
+
listing = output.split("Available AI CLIs (alphabetical order):", 1)[1]
|
|
111
|
+
positions = [listing.index(f" {token}\n") for token in expected_tokens]
|
|
112
|
+
assert positions == sorted(positions)
|
|
113
|
+
assert len(set(positions)) == len(expected_tokens)
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
def test_agy_registry_and_global_help_expose_command():
|
|
117
|
+
"""
|
|
118
|
+
@brief Validate registry mapping and AI help section exposure for agy.
|
|
119
|
+
@details Asserts lazy registry resolution returns the agy module with a
|
|
120
|
+
non-empty description and that the global-help AI section contains the
|
|
121
|
+
agy token.
|
|
122
|
+
@return {None} Assertions only.
|
|
123
|
+
@satisfies TST-017, DES-001, DES-008, DES-014
|
|
124
|
+
"""
|
|
125
|
+
|
|
126
|
+
resolved = get_command("agy")
|
|
127
|
+
|
|
128
|
+
assert resolved is agy
|
|
129
|
+
assert agy.DESCRIPTION == "Launch Antigravity CLI in the project context."
|
|
130
|
+
ai_section = next(
|
|
131
|
+
section
|
|
132
|
+
for section_name, section in core.HELP_SECTION_COMMANDS
|
|
133
|
+
if section_name == "AI Commands"
|
|
134
|
+
)
|
|
135
|
+
assert "agy" in ai_section
|