shieldops-cli 1.0.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 (36) hide show
  1. shieldops_cli-1.0.0/LICENSE +21 -0
  2. shieldops_cli-1.0.0/PKG-INFO +351 -0
  3. shieldops_cli-1.0.0/README.md +319 -0
  4. shieldops_cli-1.0.0/pyproject.toml +40 -0
  5. shieldops_cli-1.0.0/setup.cfg +4 -0
  6. shieldops_cli-1.0.0/shieldops_cli/__init__.py +3 -0
  7. shieldops_cli-1.0.0/shieldops_cli/api_client.py +102 -0
  8. shieldops_cli-1.0.0/shieldops_cli/auth.py +64 -0
  9. shieldops_cli-1.0.0/shieldops_cli/commands/__init__.py +1 -0
  10. shieldops_cli-1.0.0/shieldops_cli/commands/analyze.py +107 -0
  11. shieldops_cli-1.0.0/shieldops_cli/commands/autofix.py +64 -0
  12. shieldops_cli-1.0.0/shieldops_cli/commands/compose_gen.py +54 -0
  13. shieldops_cli-1.0.0/shieldops_cli/commands/compose_scan.py +55 -0
  14. shieldops_cli-1.0.0/shieldops_cli/commands/config_cmd.py +46 -0
  15. shieldops_cli-1.0.0/shieldops_cli/commands/k8s_scan.py +68 -0
  16. shieldops_cli-1.0.0/shieldops_cli/commands/sbom.py +46 -0
  17. shieldops_cli-1.0.0/shieldops_cli/commands/scan_image.py +118 -0
  18. shieldops_cli-1.0.0/shieldops_cli/commands/tui.py +27 -0
  19. shieldops_cli-1.0.0/shieldops_cli/config.py +54 -0
  20. shieldops_cli-1.0.0/shieldops_cli/formatters/__init__.py +17 -0
  21. shieldops_cli-1.0.0/shieldops_cli/formatters/json_fmt.py +6 -0
  22. shieldops_cli-1.0.0/shieldops_cli/formatters/sarif.py +62 -0
  23. shieldops_cli-1.0.0/shieldops_cli/formatters/summary.py +46 -0
  24. shieldops_cli-1.0.0/shieldops_cli/formatters/table.py +260 -0
  25. shieldops_cli-1.0.0/shieldops_cli/main.py +45 -0
  26. shieldops_cli-1.0.0/shieldops_cli.egg-info/PKG-INFO +351 -0
  27. shieldops_cli-1.0.0/shieldops_cli.egg-info/SOURCES.txt +34 -0
  28. shieldops_cli-1.0.0/shieldops_cli.egg-info/dependency_links.txt +1 -0
  29. shieldops_cli-1.0.0/shieldops_cli.egg-info/entry_points.txt +2 -0
  30. shieldops_cli-1.0.0/shieldops_cli.egg-info/requires.txt +11 -0
  31. shieldops_cli-1.0.0/shieldops_cli.egg-info/top_level.txt +1 -0
  32. shieldops_cli-1.0.0/tests/test_analyze.py +108 -0
  33. shieldops_cli-1.0.0/tests/test_auth.py +70 -0
  34. shieldops_cli-1.0.0/tests/test_formatters.py +101 -0
  35. shieldops_cli-1.0.0/tests/test_phase2_validation.py +173 -0
  36. shieldops_cli-1.0.0/tests/test_score_zero_bug.py +76 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 ShieldOps AI
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,351 @@
1
+ Metadata-Version: 2.4
2
+ Name: shieldops-cli
3
+ Version: 1.0.0
4
+ Summary: ShieldOps AI — Security scanner CLI for Docker, Kubernetes, Compose, SBOM, and more.
5
+ Author-email: ShieldOps AI <support@shieldops.ai>
6
+ License: MIT
7
+ Project-URL: Homepage, https://shieldops-ai.onrender.com
8
+ Project-URL: Documentation, https://github.com/mohammedabdallahcv-creator/shieldops-cli
9
+ Project-URL: Repository, https://github.com/mohammedabdallahcv-creator/shieldops-cli
10
+ Project-URL: Changelog, https://github.com/mohammedabdallahcv-creator/shieldops-cli/releases
11
+ Keywords: docker,kubernetes,security,devsecops,sbom,cli
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Environment :: Console
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: Topic :: Security
16
+ Classifier: Topic :: Software Development :: Quality Assurance
17
+ Classifier: License :: OSI Approved :: MIT License
18
+ Classifier: Programming Language :: Python :: 3
19
+ Requires-Python: >=3.9
20
+ Description-Content-Type: text/markdown
21
+ License-File: LICENSE
22
+ Requires-Dist: click>=8.1
23
+ Requires-Dist: requests>=2.28
24
+ Requires-Dist: rich>=13.0
25
+ Provides-Extra: dev
26
+ Requires-Dist: pytest; extra == "dev"
27
+ Requires-Dist: pytest-cov; extra == "dev"
28
+ Requires-Dist: responses; extra == "dev"
29
+ Provides-Extra: tui
30
+ Requires-Dist: prompt_toolkit>=3.0.43; extra == "tui"
31
+ Dynamic: license-file
32
+
33
+ # ShieldOps CLI
34
+
35
+ > AI-powered security scanner for Dockerfiles, Kubernetes, Docker Compose, and more. Scan, fix, and secure your infrastructure from the terminal.
36
+
37
+ [![PyPI version](https://img.shields.io/pypi/v/shieldops-cli.svg)](https://pypi.org/project/shieldops-cli/)
38
+ [![Python](https://img.shields.io/pypi/pyversions/shieldops-cli.svg)](https://pypi.org/project/shieldops-cli/)
39
+ [![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)
40
+ [![GitHub Stars](https://img.shields.io/github/stars/mohammedabdallahcv-creator/shieldops-cli?style=social)](https://github.com/mohammedabdallahcv-creator/shieldops-cli)
41
+ [![Powered by ShieldOps AI](https://img.shields.io/badge/powered%20by-ShieldOps%20AI-8B5CF6)](https://shieldops-ai.onrender.com)
42
+
43
+ <p align="center">
44
+ <img src="docs/screenshots/cli-output.svg" alt="ShieldOps CLI in action" width="800">
45
+ </p>
46
+
47
+ ---
48
+
49
+ ## Why ShieldOps CLI
50
+
51
+ Most Dockerfile/K8s scanners tell you **what** is wrong. ShieldOps CLI also tells you **how to fix it** — using AI that understands your specific configuration, not generic rule text.
52
+
53
+ | Feature | ShieldOps CLI | Hadolint | Trivy |
54
+ |---|---|---|---|
55
+ | Dockerfile scan | Yes | Yes | Partial |
56
+ | Docker Compose scan | Yes | No | No |
57
+ | K8s manifest scan | Yes | No | Yes |
58
+ | AI-powered autofix | Yes | No | No |
59
+ | SBOM generation | Yes | No | Yes |
60
+ | Compose file generation | Yes | No | No |
61
+ | Docker image scan | Yes | No | Yes (built-in) |
62
+ | Interactive TUI | Yes | No | No |
63
+ | CI/CD ready (`--fail-on`) | Yes | Yes | Yes |
64
+ | Free tier | Yes (5 scans/day) | Yes | Yes |
65
+
66
+ ### What makes it different
67
+
68
+ 1. **AI Autofix** — not just "you have a problem" but "here's your fixed Dockerfile, ready to apply"
69
+ 2. **Interactive TUI** — slash-command interface with fuzzy completion, history, and live spinner (think Claude Code but for security scans)
70
+ 3. **One tool, many inputs** — Dockerfile, docker-compose.yml, K8s YAML, requirements.txt, package.json, Docker images
71
+ 4. **CI/CD gate** — `--fail-on high` exits non-zero in pipelines so bad configs never merge
72
+
73
+ ---
74
+
75
+ ## Quick Start
76
+
77
+ ```bash
78
+ # 1. Install
79
+ pip install shieldops-cli
80
+
81
+ # 2. Login (free tier — 5 scans/day)
82
+ shieldops login
83
+
84
+ # 3. Scan your Dockerfile
85
+ shieldops analyze Dockerfile
86
+ ```
87
+
88
+ That's it. You get severity-graded findings, compliance mapping (CIS, SOC 2, NIST), and AI remediation guidance.
89
+
90
+ ---
91
+
92
+ ## Installation
93
+
94
+ ### From PyPI
95
+
96
+ ```bash
97
+ pip install shieldops-cli
98
+ ```
99
+
100
+ ### With TUI (interactive terminal)
101
+
102
+ ```bash
103
+ pip install 'shieldops-cli[tui]'
104
+ ```
105
+
106
+ ### CI/CD (no TUI)
107
+
108
+ ```bash
109
+ pip install shieldops-cli
110
+ ```
111
+
112
+ ---
113
+
114
+ ## Commands
115
+
116
+ ### `analyze` — Dockerfile Security Scan
117
+
118
+ ```bash
119
+ shieldops analyze Dockerfile
120
+ shieldops analyze Dockerfile --format json
121
+ shieldops analyze Dockerfile --fail-on high # CI/CD gate
122
+ shieldops analyze Dockerfile --open-report # open browser report
123
+ ```
124
+
125
+ ### `autofix` — AI-Powered Dockerfile Fix
126
+
127
+ ```bash
128
+ shieldops autofix Dockerfile # see suggested fix
129
+ shieldops autofix Dockerfile --apply # apply fix in-place (.bak backup)
130
+ shieldops autofix Dockerfile --format json -o fix.json
131
+ ```
132
+
133
+ ### `sbom` — Software Bill of Materials
134
+
135
+ ```bash
136
+ shieldops sbom requirements.txt
137
+ shieldops sbom package.json
138
+ shieldops sbom Dockerfile --format json
139
+ ```
140
+
141
+ ### `compose-scan` — Docker Compose Scan
142
+
143
+ ```bash
144
+ shieldops compose-scan docker-compose.yml
145
+ shieldops compose-scan docker-compose.yml --fail-on high
146
+ ```
147
+
148
+ ### `compose-generate` — Generate Compose from Dockerfile
149
+
150
+ ```bash
151
+ shieldops compose-generate Dockerfile
152
+ shieldops compose-generate Dockerfile --output docker-compose.yml
153
+ ```
154
+
155
+ ### `k8s-scan` — Kubernetes Manifest Scan
156
+
157
+ ```bash
158
+ shieldops k8s-scan deployment.yaml
159
+ shieldops k8s-scan pod.yaml --format sarif
160
+ ```
161
+
162
+ ### `scan-image` — Docker Image Scan
163
+
164
+ ```bash
165
+ shieldops scan-image nginx:latest
166
+ shieldops scan-image myapp:v1.2.3 --format json
167
+ ```
168
+
169
+ ### `login` / `logout` / `whoami`
170
+
171
+ ```bash
172
+ shieldops login # interactive prompt
173
+ shieldops login --key sk-... # direct key
174
+ export SHIELDOPS_API_KEY=sk-... # or env var (CI/CD)
175
+ shieldops whoami
176
+ shieldops logout
177
+ ```
178
+
179
+ ---
180
+
181
+ ## Output Formats
182
+
183
+ | Format | Best For |
184
+ |---|---|
185
+ | `table` (default) | Terminal reading |
186
+ | `json` | Scripting, API integration |
187
+ | `sarif` | GitHub Security tab, CodeQL |
188
+ | `summary` | One-line pipeline status |
189
+
190
+ ```bash
191
+ shieldops analyze Dockerfile --format json --output scan.json
192
+ shieldops analyze Dockerfile --format sarif --output results.sarif
193
+ shieldops analyze Dockerfile --format summary
194
+ ```
195
+
196
+ ---
197
+
198
+ ## TUI — Interactive Terminal Interface
199
+
200
+ ```bash
201
+ shieldops tui
202
+ ```
203
+
204
+ Slash-command interface with fuzzy completion, command history, and live loading spinner:
205
+
206
+ ```
207
+ shieldops> /analyze
208
+ Path to Dockerfile: ./Dockerfile
209
+ Analyzing... [results]
210
+ Completed
211
+
212
+ shieldops> /autofix
213
+ Path to Dockerfile: ./Dockerfile
214
+ [AI fix suggestions]
215
+
216
+ shieldops> /save
217
+ Report saved: reports/autofix_20260528_143022.txt
218
+
219
+ shieldops> /exit
220
+ Session closed.
221
+ ```
222
+
223
+ **Available commands**: `/analyze`, `/autofix`, `/sbom`, `/compose-scan`, `/compose-generate`, `/k8s-scan`, `/scan-image`, `/login`, `/logout`, `/whoami`, `/config`, `/save`, `/help`, `/clear`, `/exit`
224
+
225
+ Append `-json` to any scan command for JSON output (e.g., `/analyze-json`).
226
+
227
+ **Tab** = autocomplete, **Up/Down** = history, **/save** = write to file, **/exit** = return to normal terminal for scroll/copy.
228
+
229
+ ---
230
+
231
+ ## CI/CD Integration
232
+
233
+ ### GitHub Actions
234
+
235
+ ```yaml
236
+ name: ShieldOps Security Scan
237
+ on: [push, pull_request]
238
+
239
+ jobs:
240
+ security:
241
+ runs-on: ubuntu-latest
242
+ steps:
243
+ - uses: actions/checkout@v4
244
+ - name: Install ShieldOps CLI
245
+ run: pip install shieldops-cli
246
+ - name: Scan Dockerfile
247
+ env:
248
+ SHIELDOPS_API_KEY: ${{ secrets.SHIELDOPS_API_KEY }}
249
+ run: shieldops analyze Dockerfile --fail-on high --format sarif --output results.sarif
250
+ - name: Upload SARIF
251
+ uses: github/codeql-action/upload-sarif@v3
252
+ with:
253
+ sarif_file: results.sarif
254
+ ```
255
+
256
+ ### GitLab CI
257
+
258
+ ```yaml
259
+ shieldops-scan:
260
+ image: python:3.11-slim
261
+ stage: test
262
+ before_script:
263
+ - pip install shieldops-cli
264
+ script:
265
+ - shieldops analyze Dockerfile --fail-on high --format summary
266
+ variables:
267
+ SHIELDOPS_API_KEY: $SHIELDOPS_API_KEY
268
+ ```
269
+
270
+ ### Exit Codes
271
+
272
+ | Code | Meaning |
273
+ |---|---|
274
+ | `0` | Pass — no issues above threshold |
275
+ | `1` | Fail — issues found at or above `--fail-on` severity |
276
+ | `2` | Error — auth, network, or configuration problem |
277
+
278
+ ---
279
+
280
+ ## Free vs Pro
281
+
282
+ | Feature | Free | Pro |
283
+ |---|---|---|
284
+ | Scans per day | 5 | Unlimited |
285
+ | Dockerfile analysis | Yes | Yes |
286
+ | K8s / Compose scan | Yes | Yes |
287
+ | SBOM | Yes | Yes |
288
+ | AI Autofix | Yes | Yes + `--apply` |
289
+ | Image scan | Yes | Yes |
290
+ | HTML reports | Yes | Yes + PDF |
291
+ | Browser reports | Yes | Yes |
292
+ | Team access | No | Yes |
293
+ | Policy engine | No | Yes |
294
+ | Priority queue | No | Yes |
295
+
296
+ Get your API key at [shieldops-ai.onrender.com](https://shieldops-ai.onrender.com).
297
+
298
+ ---
299
+
300
+ ## Configuration
301
+
302
+ ```bash
303
+ shieldops config list # show all settings
304
+ shieldops config set api_url ... # custom API endpoint
305
+ shieldops config get api_key # check stored key
306
+ ```
307
+
308
+ Config is stored in `~/.shieldops/config.json`. API keys are stored as-is (encrypt at rest on your machine if needed).
309
+
310
+ ---
311
+
312
+ ## What Runs Where
313
+
314
+ | Component | Runs Locally | Requires API Key |
315
+ |---|---|---|
316
+ | CLI argument parsing | Yes | No |
317
+ | File reading & validation | Yes | No |
318
+ | Output formatting (table/json/sarif) | Yes | No |
319
+ | Security analysis | No | Yes — sent to ShieldOps AI backend |
320
+ | AI autofix | No | Yes |
321
+ | SBOM generation | No | Yes |
322
+ | Report generation | No | Yes |
323
+
324
+ The CLI reads your file locally and sends only the file content (never secrets, env vars, or other system data) to the ShieldOps AI backend for analysis. Your file is not stored on our servers beyond the scan session.
325
+
326
+ ---
327
+
328
+ ## Development
329
+
330
+ ```bash
331
+ git clone https://github.com/mohammedabdallahcv-creator/shieldops-cli.git
332
+ cd shieldops-cli
333
+ pip install -e '.[dev]'
334
+ pytest
335
+ ```
336
+
337
+ Run the CLI from source:
338
+
339
+ ```bash
340
+ python -m shieldops_cli.main analyze Dockerfile
341
+ ```
342
+
343
+ ---
344
+
345
+ ## License
346
+
347
+ MIT
348
+
349
+ ---
350
+
351
+ ShieldOps CLI is open-source. The analysis backend is proprietary and hosted at [shieldops-ai.onrender.com](https://shieldops-ai.onrender.com).
@@ -0,0 +1,319 @@
1
+ # ShieldOps CLI
2
+
3
+ > AI-powered security scanner for Dockerfiles, Kubernetes, Docker Compose, and more. Scan, fix, and secure your infrastructure from the terminal.
4
+
5
+ [![PyPI version](https://img.shields.io/pypi/v/shieldops-cli.svg)](https://pypi.org/project/shieldops-cli/)
6
+ [![Python](https://img.shields.io/pypi/pyversions/shieldops-cli.svg)](https://pypi.org/project/shieldops-cli/)
7
+ [![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)
8
+ [![GitHub Stars](https://img.shields.io/github/stars/mohammedabdallahcv-creator/shieldops-cli?style=social)](https://github.com/mohammedabdallahcv-creator/shieldops-cli)
9
+ [![Powered by ShieldOps AI](https://img.shields.io/badge/powered%20by-ShieldOps%20AI-8B5CF6)](https://shieldops-ai.onrender.com)
10
+
11
+ <p align="center">
12
+ <img src="docs/screenshots/cli-output.svg" alt="ShieldOps CLI in action" width="800">
13
+ </p>
14
+
15
+ ---
16
+
17
+ ## Why ShieldOps CLI
18
+
19
+ Most Dockerfile/K8s scanners tell you **what** is wrong. ShieldOps CLI also tells you **how to fix it** — using AI that understands your specific configuration, not generic rule text.
20
+
21
+ | Feature | ShieldOps CLI | Hadolint | Trivy |
22
+ |---|---|---|---|
23
+ | Dockerfile scan | Yes | Yes | Partial |
24
+ | Docker Compose scan | Yes | No | No |
25
+ | K8s manifest scan | Yes | No | Yes |
26
+ | AI-powered autofix | Yes | No | No |
27
+ | SBOM generation | Yes | No | Yes |
28
+ | Compose file generation | Yes | No | No |
29
+ | Docker image scan | Yes | No | Yes (built-in) |
30
+ | Interactive TUI | Yes | No | No |
31
+ | CI/CD ready (`--fail-on`) | Yes | Yes | Yes |
32
+ | Free tier | Yes (5 scans/day) | Yes | Yes |
33
+
34
+ ### What makes it different
35
+
36
+ 1. **AI Autofix** — not just "you have a problem" but "here's your fixed Dockerfile, ready to apply"
37
+ 2. **Interactive TUI** — slash-command interface with fuzzy completion, history, and live spinner (think Claude Code but for security scans)
38
+ 3. **One tool, many inputs** — Dockerfile, docker-compose.yml, K8s YAML, requirements.txt, package.json, Docker images
39
+ 4. **CI/CD gate** — `--fail-on high` exits non-zero in pipelines so bad configs never merge
40
+
41
+ ---
42
+
43
+ ## Quick Start
44
+
45
+ ```bash
46
+ # 1. Install
47
+ pip install shieldops-cli
48
+
49
+ # 2. Login (free tier — 5 scans/day)
50
+ shieldops login
51
+
52
+ # 3. Scan your Dockerfile
53
+ shieldops analyze Dockerfile
54
+ ```
55
+
56
+ That's it. You get severity-graded findings, compliance mapping (CIS, SOC 2, NIST), and AI remediation guidance.
57
+
58
+ ---
59
+
60
+ ## Installation
61
+
62
+ ### From PyPI
63
+
64
+ ```bash
65
+ pip install shieldops-cli
66
+ ```
67
+
68
+ ### With TUI (interactive terminal)
69
+
70
+ ```bash
71
+ pip install 'shieldops-cli[tui]'
72
+ ```
73
+
74
+ ### CI/CD (no TUI)
75
+
76
+ ```bash
77
+ pip install shieldops-cli
78
+ ```
79
+
80
+ ---
81
+
82
+ ## Commands
83
+
84
+ ### `analyze` — Dockerfile Security Scan
85
+
86
+ ```bash
87
+ shieldops analyze Dockerfile
88
+ shieldops analyze Dockerfile --format json
89
+ shieldops analyze Dockerfile --fail-on high # CI/CD gate
90
+ shieldops analyze Dockerfile --open-report # open browser report
91
+ ```
92
+
93
+ ### `autofix` — AI-Powered Dockerfile Fix
94
+
95
+ ```bash
96
+ shieldops autofix Dockerfile # see suggested fix
97
+ shieldops autofix Dockerfile --apply # apply fix in-place (.bak backup)
98
+ shieldops autofix Dockerfile --format json -o fix.json
99
+ ```
100
+
101
+ ### `sbom` — Software Bill of Materials
102
+
103
+ ```bash
104
+ shieldops sbom requirements.txt
105
+ shieldops sbom package.json
106
+ shieldops sbom Dockerfile --format json
107
+ ```
108
+
109
+ ### `compose-scan` — Docker Compose Scan
110
+
111
+ ```bash
112
+ shieldops compose-scan docker-compose.yml
113
+ shieldops compose-scan docker-compose.yml --fail-on high
114
+ ```
115
+
116
+ ### `compose-generate` — Generate Compose from Dockerfile
117
+
118
+ ```bash
119
+ shieldops compose-generate Dockerfile
120
+ shieldops compose-generate Dockerfile --output docker-compose.yml
121
+ ```
122
+
123
+ ### `k8s-scan` — Kubernetes Manifest Scan
124
+
125
+ ```bash
126
+ shieldops k8s-scan deployment.yaml
127
+ shieldops k8s-scan pod.yaml --format sarif
128
+ ```
129
+
130
+ ### `scan-image` — Docker Image Scan
131
+
132
+ ```bash
133
+ shieldops scan-image nginx:latest
134
+ shieldops scan-image myapp:v1.2.3 --format json
135
+ ```
136
+
137
+ ### `login` / `logout` / `whoami`
138
+
139
+ ```bash
140
+ shieldops login # interactive prompt
141
+ shieldops login --key sk-... # direct key
142
+ export SHIELDOPS_API_KEY=sk-... # or env var (CI/CD)
143
+ shieldops whoami
144
+ shieldops logout
145
+ ```
146
+
147
+ ---
148
+
149
+ ## Output Formats
150
+
151
+ | Format | Best For |
152
+ |---|---|
153
+ | `table` (default) | Terminal reading |
154
+ | `json` | Scripting, API integration |
155
+ | `sarif` | GitHub Security tab, CodeQL |
156
+ | `summary` | One-line pipeline status |
157
+
158
+ ```bash
159
+ shieldops analyze Dockerfile --format json --output scan.json
160
+ shieldops analyze Dockerfile --format sarif --output results.sarif
161
+ shieldops analyze Dockerfile --format summary
162
+ ```
163
+
164
+ ---
165
+
166
+ ## TUI — Interactive Terminal Interface
167
+
168
+ ```bash
169
+ shieldops tui
170
+ ```
171
+
172
+ Slash-command interface with fuzzy completion, command history, and live loading spinner:
173
+
174
+ ```
175
+ shieldops> /analyze
176
+ Path to Dockerfile: ./Dockerfile
177
+ Analyzing... [results]
178
+ Completed
179
+
180
+ shieldops> /autofix
181
+ Path to Dockerfile: ./Dockerfile
182
+ [AI fix suggestions]
183
+
184
+ shieldops> /save
185
+ Report saved: reports/autofix_20260528_143022.txt
186
+
187
+ shieldops> /exit
188
+ Session closed.
189
+ ```
190
+
191
+ **Available commands**: `/analyze`, `/autofix`, `/sbom`, `/compose-scan`, `/compose-generate`, `/k8s-scan`, `/scan-image`, `/login`, `/logout`, `/whoami`, `/config`, `/save`, `/help`, `/clear`, `/exit`
192
+
193
+ Append `-json` to any scan command for JSON output (e.g., `/analyze-json`).
194
+
195
+ **Tab** = autocomplete, **Up/Down** = history, **/save** = write to file, **/exit** = return to normal terminal for scroll/copy.
196
+
197
+ ---
198
+
199
+ ## CI/CD Integration
200
+
201
+ ### GitHub Actions
202
+
203
+ ```yaml
204
+ name: ShieldOps Security Scan
205
+ on: [push, pull_request]
206
+
207
+ jobs:
208
+ security:
209
+ runs-on: ubuntu-latest
210
+ steps:
211
+ - uses: actions/checkout@v4
212
+ - name: Install ShieldOps CLI
213
+ run: pip install shieldops-cli
214
+ - name: Scan Dockerfile
215
+ env:
216
+ SHIELDOPS_API_KEY: ${{ secrets.SHIELDOPS_API_KEY }}
217
+ run: shieldops analyze Dockerfile --fail-on high --format sarif --output results.sarif
218
+ - name: Upload SARIF
219
+ uses: github/codeql-action/upload-sarif@v3
220
+ with:
221
+ sarif_file: results.sarif
222
+ ```
223
+
224
+ ### GitLab CI
225
+
226
+ ```yaml
227
+ shieldops-scan:
228
+ image: python:3.11-slim
229
+ stage: test
230
+ before_script:
231
+ - pip install shieldops-cli
232
+ script:
233
+ - shieldops analyze Dockerfile --fail-on high --format summary
234
+ variables:
235
+ SHIELDOPS_API_KEY: $SHIELDOPS_API_KEY
236
+ ```
237
+
238
+ ### Exit Codes
239
+
240
+ | Code | Meaning |
241
+ |---|---|
242
+ | `0` | Pass — no issues above threshold |
243
+ | `1` | Fail — issues found at or above `--fail-on` severity |
244
+ | `2` | Error — auth, network, or configuration problem |
245
+
246
+ ---
247
+
248
+ ## Free vs Pro
249
+
250
+ | Feature | Free | Pro |
251
+ |---|---|---|
252
+ | Scans per day | 5 | Unlimited |
253
+ | Dockerfile analysis | Yes | Yes |
254
+ | K8s / Compose scan | Yes | Yes |
255
+ | SBOM | Yes | Yes |
256
+ | AI Autofix | Yes | Yes + `--apply` |
257
+ | Image scan | Yes | Yes |
258
+ | HTML reports | Yes | Yes + PDF |
259
+ | Browser reports | Yes | Yes |
260
+ | Team access | No | Yes |
261
+ | Policy engine | No | Yes |
262
+ | Priority queue | No | Yes |
263
+
264
+ Get your API key at [shieldops-ai.onrender.com](https://shieldops-ai.onrender.com).
265
+
266
+ ---
267
+
268
+ ## Configuration
269
+
270
+ ```bash
271
+ shieldops config list # show all settings
272
+ shieldops config set api_url ... # custom API endpoint
273
+ shieldops config get api_key # check stored key
274
+ ```
275
+
276
+ Config is stored in `~/.shieldops/config.json`. API keys are stored as-is (encrypt at rest on your machine if needed).
277
+
278
+ ---
279
+
280
+ ## What Runs Where
281
+
282
+ | Component | Runs Locally | Requires API Key |
283
+ |---|---|---|
284
+ | CLI argument parsing | Yes | No |
285
+ | File reading & validation | Yes | No |
286
+ | Output formatting (table/json/sarif) | Yes | No |
287
+ | Security analysis | No | Yes — sent to ShieldOps AI backend |
288
+ | AI autofix | No | Yes |
289
+ | SBOM generation | No | Yes |
290
+ | Report generation | No | Yes |
291
+
292
+ The CLI reads your file locally and sends only the file content (never secrets, env vars, or other system data) to the ShieldOps AI backend for analysis. Your file is not stored on our servers beyond the scan session.
293
+
294
+ ---
295
+
296
+ ## Development
297
+
298
+ ```bash
299
+ git clone https://github.com/mohammedabdallahcv-creator/shieldops-cli.git
300
+ cd shieldops-cli
301
+ pip install -e '.[dev]'
302
+ pytest
303
+ ```
304
+
305
+ Run the CLI from source:
306
+
307
+ ```bash
308
+ python -m shieldops_cli.main analyze Dockerfile
309
+ ```
310
+
311
+ ---
312
+
313
+ ## License
314
+
315
+ MIT
316
+
317
+ ---
318
+
319
+ ShieldOps CLI is open-source. The analysis backend is proprietary and hosted at [shieldops-ai.onrender.com](https://shieldops-ai.onrender.com).