wraith-cli 1.2.0__tar.gz → 1.4.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.
Files changed (39) hide show
  1. {wraith_cli-1.2.0 → wraith_cli-1.4.0}/.env.example +2 -0
  2. {wraith_cli-1.2.0 → wraith_cli-1.4.0}/.gitea/workflows/pages.yml +1 -0
  3. {wraith_cli-1.2.0 → wraith_cli-1.4.0}/.gitignore +1 -0
  4. wraith_cli-1.4.0/.pre-commit-config.yaml +82 -0
  5. {wraith_cli-1.2.0 → wraith_cli-1.4.0}/CHANGELOG.md +4 -0
  6. {wraith_cli-1.2.0 → wraith_cli-1.4.0}/PKG-INFO +5 -34
  7. {wraith_cli-1.2.0 → wraith_cli-1.4.0}/README.md +3 -32
  8. wraith_cli-1.4.0/docs/usage.md +208 -0
  9. {wraith_cli-1.2.0 → wraith_cli-1.4.0}/mkdocs.yml +2 -0
  10. {wraith_cli-1.2.0 → wraith_cli-1.4.0}/pyproject.toml +5 -17
  11. wraith_cli-1.4.0/src/wraith_cli/assets.py +10 -0
  12. {wraith_cli-1.2.0 → wraith_cli-1.4.0}/src/wraith_cli/main.py +157 -73
  13. wraith_cli-1.4.0/src/wraith_cli/shield.py +211 -0
  14. wraith_cli-1.4.0/tests/test_cli.py +301 -0
  15. {wraith_cli-1.2.0 → wraith_cli-1.4.0}/tests/test_qol.py +2 -1
  16. {wraith_cli-1.2.0 → wraith_cli-1.4.0}/tests/test_repo_make.py +33 -0
  17. wraith_cli-1.4.0/tests/test_shield.py +339 -0
  18. {wraith_cli-1.2.0 → wraith_cli-1.4.0}/uv.lock +27 -124
  19. wraith_cli-1.2.0/.pre-commit-config.yaml +0 -43
  20. wraith_cli-1.2.0/docs/usage.md +0 -80
  21. wraith_cli-1.2.0/tests/test_cli.py +0 -143
  22. {wraith_cli-1.2.0 → wraith_cli-1.4.0}/.cz.yaml +0 -0
  23. {wraith_cli-1.2.0 → wraith_cli-1.4.0}/.gitea/CODEOWNERS.md +0 -0
  24. {wraith_cli-1.2.0 → wraith_cli-1.4.0}/.gitea/PULL_REQUEST_TEMPLATE.md +0 -0
  25. {wraith_cli-1.2.0 → wraith_cli-1.4.0}/.gitea/workflows/release.yml +0 -0
  26. {wraith_cli-1.2.0 → wraith_cli-1.4.0}/.gitea/workflows/test.yml +0 -0
  27. {wraith_cli-1.2.0 → wraith_cli-1.4.0}/.secrets.baseline +0 -0
  28. {wraith_cli-1.2.0 → wraith_cli-1.4.0}/CONTRIBUTING.md +0 -0
  29. {wraith_cli-1.2.0 → wraith_cli-1.4.0}/LICENSE +0 -0
  30. {wraith_cli-1.2.0 → wraith_cli-1.4.0}/bin/build.sh +0 -0
  31. {wraith_cli-1.2.0 → wraith_cli-1.4.0}/bin/run_tests.sh +0 -0
  32. {wraith_cli-1.2.0 → wraith_cli-1.4.0}/bin/setup_venv.sh +0 -0
  33. {wraith_cli-1.2.0 → wraith_cli-1.4.0}/docs/architecture.md +0 -0
  34. {wraith_cli-1.2.0 → wraith_cli-1.4.0}/docs/index.md +0 -0
  35. {wraith_cli-1.2.0 → wraith_cli-1.4.0}/docs/reference.md +0 -0
  36. {wraith_cli-1.2.0 → wraith_cli-1.4.0}/docs/security.md +0 -0
  37. {wraith_cli-1.2.0 → wraith_cli-1.4.0}/src/wraith_cli/__init__.py +0 -0
  38. {wraith_cli-1.2.0 → wraith_cli-1.4.0}/src/wraith_cli/qol.py +0 -0
  39. {wraith_cli-1.2.0 → wraith_cli-1.4.0}/src/wraith_cli/repo_make.py +0 -0
@@ -9,3 +9,5 @@ GITEA_COMPOSE_PATH=/home/user/example/gitea
9
9
  GITEA_API_URL="http://your-gitea-instance:3000"
10
10
  GITEA_TOKEN="your_personal_access_token"
11
11
  GITEA_TEMPLATE_URL="https://gitea.domain.com/user/repo-template.git"
12
+
13
+ SCRUTINY_URL=http://127.0.0.1:8090
@@ -1,5 +1,6 @@
1
1
  name: Deploy Gitea Pages
2
2
  on:
3
+ workflow_dispatch:
3
4
  push:
4
5
  branches:
5
6
  - main
@@ -165,3 +165,4 @@ cython_debug/
165
165
  # and can be added to the global gitignore or merged into this file. For a more nuclear
166
166
  # option (not recommended) you can uncomment the following to ignore the entire idea folder.
167
167
  #.idea/
168
+ .aider*
@@ -0,0 +1,82 @@
1
+ minimum_pre_commit_version: 4.0.0
2
+ default_stages: [pre-commit, pre-push]
3
+
4
+ repos:
5
+ - repo: https://github.com/pre-commit/pre-commit-hooks
6
+ rev: v6.0.0
7
+ hooks:
8
+ - id: trailing-whitespace
9
+ args: [--markdown-linebreak-ext=md]
10
+ exclude: ^src/wraith_cli/assets\.py$
11
+ - id: end-of-file-fixer
12
+ - id: check-yaml
13
+ - id: check-toml
14
+ - id: check-added-large-files
15
+ - id: check-case-conflict
16
+
17
+ - repo: https://github.com/astral-sh/ruff-pre-commit
18
+ rev: v0.15.9
19
+ hooks:
20
+ - id: ruff
21
+ args: ["--fix", "--exit-non-zero-on-fix"]
22
+ - id: ruff-format
23
+
24
+ - repo: https://github.com/codespell-project/codespell
25
+ rev: v2.4.2
26
+ hooks:
27
+ - id: codespell
28
+ types_or: [python, markdown, rst]
29
+
30
+ - repo: https://github.com/asottile/pyupgrade
31
+ rev: v3.21.2
32
+ hooks:
33
+ - id: pyupgrade
34
+ args: [--py312-plus]
35
+
36
+ - repo: https://github.com/shellcheck-py/shellcheck-py
37
+ rev: v0.11.0.1
38
+ hooks:
39
+ - id: shellcheck
40
+ args: ["--severity=warning"]
41
+
42
+ - repo: https://github.com/Yelp/detect-secrets
43
+ rev: v1.5.0
44
+ hooks:
45
+ - id: detect-secrets
46
+ args: ["--baseline", ".secrets.baseline"]
47
+ exclude: package-lock.json
48
+
49
+ - repo: local
50
+ hooks:
51
+ - id: generate-docs
52
+ name: Auto-generate CLI Documentation
53
+ entry: uv run typer src/wraith_cli/main.py utils docs --output docs/usage.md
54
+ language: system
55
+ pass_filenames: false
56
+ always_run: true
57
+
58
+ - id: no-raw-print
59
+ name: Ban raw print() in favor of typer.echo/rich
60
+ language: pygrep
61
+ entry: '(?<![\.a-zA-Z0-9_])print\('
62
+ types: [python]
63
+
64
+ - id: ty-check
65
+ name: ty check
66
+ entry: uv run ty check
67
+ language: system
68
+ types: [python]
69
+ pass_filenames: false
70
+
71
+ - id: pytest-coverage
72
+ name: pytest-coverage
73
+ entry: ./bin/run_tests.sh
74
+ language: system
75
+ pass_filenames: false
76
+ always_run: true
77
+
78
+ - id: commitizen
79
+ name: commitizen check
80
+ entry: uv run cz check --commit-msg-file
81
+ language: system
82
+ stages: [commit-msg]
@@ -1,3 +1,7 @@
1
+ ## v1.4.0 (2026-04-05)
2
+
3
+ ## v1.3.0 (2026-04-04)
4
+
1
5
  ## v1.2.0 (2026-04-02)
2
6
 
3
7
  ## v1.1.0 (2026-03-31)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: wraith-cli
3
- Version: 1.2.0
3
+ Version: 1.4.0
4
4
  Summary: Sovereign Command Centre for a Ghost Stack
5
5
  Project-URL: Homepage, https://git.thomaspeoples.com/thomaspeoples/wraith-cli
6
6
  Project-URL: Documentation, https://www.thomaspeoples.com/gitea-repos/wraith-cli/
@@ -42,19 +42,19 @@ Requires-Dist: detect-secrets; extra == 'dev'
42
42
  Requires-Dist: genbadge[coverage]>=1.1.1; extra == 'dev'
43
43
  Requires-Dist: mkdocs-material<=10.0; extra == 'dev'
44
44
  Requires-Dist: mkdocs<=2.0; extra == 'dev'
45
- Requires-Dist: mypy; extra == 'dev'
46
45
  Requires-Dist: pre-commit; extra == 'dev'
47
46
  Requires-Dist: pymdown-extensions>=10.7.0; extra == 'dev'
48
47
  Requires-Dist: pytest; extra == 'dev'
49
48
  Requires-Dist: pytest-cov; extra == 'dev'
50
49
  Requires-Dist: ruff; extra == 'dev'
50
+ Requires-Dist: ty; extra == 'dev'
51
51
  Requires-Dist: types-requests; extra == 'dev'
52
52
  Description-Content-Type: text/markdown
53
53
 
54
54
  [![Documentation](https://img.shields.io/badge/docs-live-brightgreen)](https://www.thomaspeoples.com/gitea-repos/wraith-cli/)
55
- ![PyPI - Version](https://img.shields.io/pypi/v/wraith_cli)
56
- ![PyPI - License](https://img.shields.io/pypi/l/wraith_cli)
57
- ![PyPI - Python Version](https://img.shields.io/pypi/pyversions/wraith_cli)
55
+ ![PyPI - Version](https://img.shields.io/pypi/v/wraith-cli)
56
+ ![PyPI - License](https://img.shields.io/pypi/l/wraith-cli)
57
+ ![PyPI - Python Version](https://img.shields.io/pypi/pyversions/wraith-cli)
58
58
 
59
59
 
60
60
  # 👻 Wraith-CLI
@@ -64,35 +64,6 @@ Description-Content-Type: text/markdown
64
64
  high-level container orchestration and bare-metal reality, providing the "Ghost Factory"
65
65
  for instant project scaffolding.
66
66
 
67
- ---
68
-
69
- ## 🏗️ The Ghost Factory (New)
70
-
71
- The `spawn` command allows you to go from **Idea to Code** in under 5 seconds by
72
- bleaching a template and provisioning a private Gitea repository automatically.
73
-
74
- ```bash
75
- wraith spawn my-new-api
76
- ```
77
-
78
- 1. **🧬 Clones** your `GHOST_TEMPLATE_URL`.
79
- 2. **🧹 Bleaches** all previous git history.
80
- 3. **🌐 Provisions** a new private repo via the Gitea API.
81
- 4. **🚀 Pushes** the clean stack to your Sovereign remote.
82
-
83
- ---
84
-
85
- ## 🛠️ Operational Manual
86
-
87
- | Command | Feature | Status |
88
- |--------------------------|------------------------|---------------------------------------------|
89
- | `wraith spawn <name>` | **The Ghost Factory** | 🏗️ Scaffolds new repos via Gitea API. |
90
- | `wraith update` | **Global Update** | 🟢 PyPI-linked & `uv` powered. |
91
- | `wraith ps` | **Rich Observability** | 🟢 Sovereign Dark styling for Docker. |
92
- | `wraith tail <svc>` | **Flexible Logging** | 🟢 Supports `--path` & Env Vars. |
93
- | `wraith status` | **Heartbeat** | 🟢 Monitor OpenViking (Port 1933). |
94
- | `wraith runner-reset` | **Runner Defence** | 🟢 CI/CD maintenance & registration wipe. |
95
- | `wraith --version` | **Self-Identity** | 🟢 Eager callback for versioning. |
96
67
 
97
68
  ---
98
69
 
@@ -1,7 +1,7 @@
1
1
  [![Documentation](https://img.shields.io/badge/docs-live-brightgreen)](https://www.thomaspeoples.com/gitea-repos/wraith-cli/)
2
- ![PyPI - Version](https://img.shields.io/pypi/v/wraith_cli)
3
- ![PyPI - License](https://img.shields.io/pypi/l/wraith_cli)
4
- ![PyPI - Python Version](https://img.shields.io/pypi/pyversions/wraith_cli)
2
+ ![PyPI - Version](https://img.shields.io/pypi/v/wraith-cli)
3
+ ![PyPI - License](https://img.shields.io/pypi/l/wraith-cli)
4
+ ![PyPI - Python Version](https://img.shields.io/pypi/pyversions/wraith-cli)
5
5
 
6
6
 
7
7
  # 👻 Wraith-CLI
@@ -11,35 +11,6 @@
11
11
  high-level container orchestration and bare-metal reality, providing the "Ghost Factory"
12
12
  for instant project scaffolding.
13
13
 
14
- ---
15
-
16
- ## 🏗️ The Ghost Factory (New)
17
-
18
- The `spawn` command allows you to go from **Idea to Code** in under 5 seconds by
19
- bleaching a template and provisioning a private Gitea repository automatically.
20
-
21
- ```bash
22
- wraith spawn my-new-api
23
- ```
24
-
25
- 1. **🧬 Clones** your `GHOST_TEMPLATE_URL`.
26
- 2. **🧹 Bleaches** all previous git history.
27
- 3. **🌐 Provisions** a new private repo via the Gitea API.
28
- 4. **🚀 Pushes** the clean stack to your Sovereign remote.
29
-
30
- ---
31
-
32
- ## 🛠️ Operational Manual
33
-
34
- | Command | Feature | Status |
35
- |--------------------------|------------------------|---------------------------------------------|
36
- | `wraith spawn <name>` | **The Ghost Factory** | 🏗️ Scaffolds new repos via Gitea API. |
37
- | `wraith update` | **Global Update** | 🟢 PyPI-linked & `uv` powered. |
38
- | `wraith ps` | **Rich Observability** | 🟢 Sovereign Dark styling for Docker. |
39
- | `wraith tail <svc>` | **Flexible Logging** | 🟢 Supports `--path` & Env Vars. |
40
- | `wraith status` | **Heartbeat** | 🟢 Monitor OpenViking (Port 1933). |
41
- | `wraith runner-reset` | **Runner Defence** | 🟢 CI/CD maintenance & registration wipe. |
42
- | `wraith --version` | **Self-Identity** | 🟢 Eager callback for versioning. |
43
14
 
44
15
  ---
45
16
 
@@ -0,0 +1,208 @@
1
+ # CLI
2
+
3
+ Wraith Sovereign CLI: Ghost Stack Orchestrator
4
+
5
+ **Usage**:
6
+
7
+ ```console
8
+ $ [OPTIONS] COMMAND [ARGS]...
9
+ ```
10
+
11
+ **Options**:
12
+
13
+ * `--version`: Show version and exit.
14
+ * `--install-completion`: Install completion for the current shell.
15
+ * `--show-completion`: Show completion for the current shell, to copy it or customize the installation.
16
+ * `--help`: Show this message and exit.
17
+
18
+ **Commands**:
19
+
20
+ * `status`: Check the heartbeat of the OpenViking Stack.
21
+ * `update`: Sync Wraith with the latest PyPI release.
22
+ * `ps`: List running containers with Sovereign...
23
+ * `tail`: Stream live logs from a specific service.
24
+ * `runner-reset`: Repair hung or offline Gitea Action Runners.
25
+ * `spawn`: 🏭 Scaffold a new repository instantly.
26
+ * `logs`: Unified hardware health and logging portal.
27
+ * `mesh`: Map the Tailscale Ghost Mesh network.
28
+ * `audit`: Execute a Sovereign security and...
29
+
30
+ ## `status`
31
+
32
+ Check the heartbeat of the OpenViking Stack.
33
+
34
+ Polls the configured VIKING_BASE_URL health
35
+ nendpoint to verify if the orchestrator API is responsive.
36
+
37
+ **Usage**:
38
+
39
+ ```console
40
+ $ status [OPTIONS]
41
+ ```
42
+
43
+ **Options**:
44
+
45
+ * `--help`: Show this message and exit.
46
+
47
+ ## `update`
48
+
49
+ Sync Wraith with the latest PyPI release.
50
+
51
+ Compares local versioning against the remote registry and
52
+ automatically triggers an upgrade via &#x27;uv tool&#x27; if a newer
53
+ version is detected.
54
+
55
+ **Usage**:
56
+
57
+ ```console
58
+ $ update [OPTIONS]
59
+ ```
60
+
61
+ **Options**:
62
+
63
+ * `--help`: Show this message and exit.
64
+
65
+ ## `ps`
66
+
67
+ List running containers with Sovereign styling.
68
+
69
+ Wraps &#x27;docker ps&#x27; to provide a high-contrast,
70
+ readable table summarising service names,
71
+ container status, and source images.
72
+
73
+ **Usage**:
74
+
75
+ ```console
76
+ $ ps [OPTIONS]
77
+ ```
78
+
79
+ **Options**:
80
+
81
+ * `-a, --all`: Show all containers
82
+ * `--help`: Show this message and exit.
83
+
84
+ ## `tail`
85
+
86
+ Stream live logs from a specific service.
87
+
88
+ Connects to a running container to output real-time logs.
89
+ Resolves Compose paths via CLI flags,
90
+ environment variables, or local directory discovery.
91
+
92
+ Priority:
93
+ 1. Passed flag --path
94
+ 2. Env Var WRAITH_COMPOSE_PATH
95
+ 3. Current Directory
96
+
97
+ **Usage**:
98
+
99
+ ```console
100
+ $ tail [OPTIONS] SERVICE
101
+ ```
102
+
103
+ **Arguments**:
104
+
105
+ * `SERVICE`: Service name (e.g., ollama, gitea) [required]
106
+
107
+ **Options**:
108
+
109
+ * `-p, --path PATH`: Path to directory with docker-compose.yml. [env var: WRAITH_COMPOSE_PATH]
110
+ * `--help`: Show this message and exit.
111
+
112
+ ## `runner-reset`
113
+
114
+ Repair hung or offline Gitea Action Runners.
115
+
116
+ Performs a nuclear reset: stops the container,
117
+ purges the local registration data, and restarts
118
+ the service to force a fresh handshake with Gitea.
119
+
120
+ Requires GITEA_COMPOSE_PATH as an envelope variable
121
+
122
+ **Usage**:
123
+
124
+ ```console
125
+ $ runner-reset [OPTIONS]
126
+ ```
127
+
128
+ **Options**:
129
+
130
+ * `--help`: Show this message and exit.
131
+
132
+ ## `spawn`
133
+
134
+ 🏭 Scaffold a new repository instantly.
135
+
136
+ Atomic scaffolding for new Ghost Stack repositories.
137
+ Clones a template, bleaches git history,
138
+ provisions a remote repository via API, and
139
+ pushes the initial commit in one sequence.
140
+
141
+ **Usage**:
142
+
143
+ ```console
144
+ $ spawn [OPTIONS] REPO_NAME
145
+ ```
146
+
147
+ **Arguments**:
148
+
149
+ * `REPO_NAME`: Name of the new Ghost Stack repository [required]
150
+
151
+ **Options**:
152
+
153
+ * `--help`: Show this message and exit.
154
+
155
+ ## `logs`
156
+
157
+ Unified hardware health and logging portal.
158
+
159
+ Default behavior provides log-tailing instructions.
160
+ Using the --health flag triggers a deep-dive query
161
+ into the Scrutiny API for SMART drive data and disk temps.
162
+
163
+ **Usage**:
164
+
165
+ ```console
166
+ $ logs [OPTIONS]
167
+ ```
168
+
169
+ **Options**:
170
+
171
+ * `--health`: Pull SMART data summary from Scrutiny API
172
+ * `--help`: Show this message and exit.
173
+
174
+ ## `mesh`
175
+
176
+ Map the Tailscale Ghost Mesh network.
177
+
178
+ Interrogates the Tailscale daemon (local or containerised)
179
+ to return a list of active peers, their internal IPs, and
180
+ current online/offline status.
181
+
182
+ **Usage**:
183
+
184
+ ```console
185
+ $ mesh [OPTIONS]
186
+ ```
187
+
188
+ **Options**:
189
+
190
+ * `--help`: Show this message and exit.
191
+
192
+ ## `audit`
193
+
194
+ Execute a Sovereign security and compliance scan.
195
+
196
+ Audits the running stack for common vulnerabilities, including
197
+ containers running with root privileges and exposed ports
198
+ that deviate from the Registry Spec.
199
+
200
+ **Usage**:
201
+
202
+ ```console
203
+ $ audit [OPTIONS]
204
+ ```
205
+
206
+ **Options**:
207
+
208
+ * `--help`: Show this message and exit.
@@ -20,6 +20,8 @@ nav:
20
20
  - Home: index.md
21
21
  - Usage: usage.md
22
22
  - Technical Reference: reference.md
23
+ - Architecture Reference: architecture.md
24
+ - Security Statement: security.md
23
25
 
24
26
  plugins:
25
27
  - search
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "wraith-cli"
7
- version = "1.2.0"
7
+ version = "1.4.0"
8
8
  description = "Sovereign Command Centre for a Ghost Stack"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.12"
@@ -41,11 +41,11 @@ wraith = "wraith_cli.main:app"
41
41
  [project.optional-dependencies]
42
42
  dev = [
43
43
  "ruff",
44
+ "ty",
44
45
  "pytest",
45
46
  "pytest-cov",
46
47
  "pre-commit",
47
48
  "commitizen",
48
- "mypy",
49
49
  "types-requests",
50
50
  "detect-secrets",
51
51
  "mkdocs<=2.0",
@@ -56,34 +56,22 @@ dev = [
56
56
 
57
57
  [tool.pytest.ini_options]
58
58
  xfail_strict = true
59
- addopts = ["--cov=src", "--cov-report=term-missing", "--tb=short"]
59
+ addopts = ["--cov=wraith_cli", "--cov-report=term-missing", "--tb=short"]
60
60
  pythonpath = ["src"]
61
61
 
62
62
  [tool.ruff]
63
63
  line-length = 79
64
64
  target-version = "py312"
65
+ preview = true
65
66
 
66
67
  [tool.ruff.lint]
67
- select = ["E", "F", "I"]
68
+ select = ["E", "F", "I", "N", "UP", "B"]
68
69
  ignore = []
69
70
 
70
71
  [tool.ruff.format]
71
72
  quote-style = "double"
72
73
  indent-style = "space"
73
74
 
74
- [tool.mypy]
75
- # The "Strict" setting enforces type hints everywhere
76
- strict = true
77
- python_version = "3.12"
78
-
79
- # Don't moan about missing stubs for libraries that don't have them
80
- ignore_missing_imports = true
81
-
82
- # Make sure we don't accidentally leave 'any' types in the code
83
- disallow_untyped_defs = true
84
- disallow_incomplete_defs = true
85
- warn_unused_ignores = true
86
-
87
75
  [tool.hatch.build.targets.wheel]
88
76
  packages = ["src/wraith_cli"]
89
77
 
@@ -0,0 +1,10 @@
1
+ # fmt: off
2
+ # DO NOT EDIT: Trailing whitespace here is structural,
3
+ # not "useless" linting noise.
4
+ WRAITH_LOGO = r"""
5
+ ▖ ▖▄▖▄▖▄▖▄▖▖▖ ▄▖▖ ▄▖
6
+ ▌▞▖▌▙▘▌▌▐ ▐ ▙▌▄▖▌ ▌ ▐
7
+ ▛ ▝▌▌▌▛▌▟▖▐ ▌▌ ▙▖▙▖▟▖
8
+
9
+ """
10
+ # fmt: on