codedd-cli 0.1.0__tar.gz → 0.1.2__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.
- {codedd_cli-0.1.0 → codedd_cli-0.1.2}/PKG-INFO +70 -38
- {codedd_cli-0.1.0 → codedd_cli-0.1.2}/README.md +64 -35
- {codedd_cli-0.1.0 → codedd_cli-0.1.2}/codedd_cli/__init__.py +1 -1
- {codedd_cli-0.1.0 → codedd_cli-0.1.2}/codedd_cli/api/client.py +8 -6
- {codedd_cli-0.1.0 → codedd_cli-0.1.2}/codedd_cli/api/endpoints.py +2 -0
- {codedd_cli-0.1.0 → codedd_cli-0.1.2}/codedd_cli/api/exceptions.py +0 -1
- codedd_cli-0.1.2/codedd_cli/auditor/architecture_analyzer.py +2189 -0
- {codedd_cli-0.1.0 → codedd_cli-0.1.2}/codedd_cli/auditor/architecture_prompts.py +72 -2
- codedd_cli-0.1.2/codedd_cli/auditor/commit_classifier.py +350 -0
- codedd_cli-0.1.2/codedd_cli/auditor/complexity_analyzer.py +2050 -0
- {codedd_cli-0.1.0 → codedd_cli-0.1.2}/codedd_cli/auditor/dependency_scanner.py +227 -134
- codedd_cli-0.1.2/codedd_cli/auditor/enhanced_architecture_detectors.py +381 -0
- {codedd_cli-0.1.0 → codedd_cli-0.1.2}/codedd_cli/auditor/file_auditor.py +36 -27
- codedd_cli-0.1.2/codedd_cli/auditor/git_stats_collector.py +711 -0
- {codedd_cli-0.1.0 → codedd_cli-0.1.2}/codedd_cli/auditor/response_parser.py +35 -38
- codedd_cli-0.1.2/codedd_cli/auditor/sub_audit_runner.py +601 -0
- {codedd_cli-0.1.0 → codedd_cli-0.1.2}/codedd_cli/auditor/vulnerability_validator.py +101 -43
- {codedd_cli-0.1.0 → codedd_cli-0.1.2}/codedd_cli/auth/session.py +2 -3
- {codedd_cli-0.1.0 → codedd_cli-0.1.2}/codedd_cli/auth/token_manager.py +1 -2
- codedd_cli-0.1.2/codedd_cli/commands/audit_cmd.py +1291 -0
- {codedd_cli-0.1.0 → codedd_cli-0.1.2}/codedd_cli/commands/audits_cmd.py +13 -10
- {codedd_cli-0.1.0 → codedd_cli-0.1.2}/codedd_cli/commands/auth_cmd.py +14 -9
- {codedd_cli-0.1.0 → codedd_cli-0.1.2}/codedd_cli/commands/config_cmd.py +25 -58
- {codedd_cli-0.1.0 → codedd_cli-0.1.2}/codedd_cli/commands/scope_cmd.py +346 -58
- {codedd_cli-0.1.0 → codedd_cli-0.1.2}/codedd_cli/config/__init__.py +1 -1
- {codedd_cli-0.1.0 → codedd_cli-0.1.2}/codedd_cli/config/constants.py +1 -1
- {codedd_cli-0.1.0 → codedd_cli-0.1.2}/codedd_cli/config/settings.py +38 -18
- {codedd_cli-0.1.0 → codedd_cli-0.1.2}/codedd_cli/llm/key_manager.py +3 -7
- {codedd_cli-0.1.0 → codedd_cli-0.1.2}/codedd_cli/models/audit.py +3 -4
- {codedd_cli-0.1.0 → codedd_cli-0.1.2}/codedd_cli/models/local_directory.py +0 -1
- codedd_cli-0.1.2/codedd_cli/scanner/file_classifier.py +752 -0
- {codedd_cli-0.1.0 → codedd_cli-0.1.2}/codedd_cli/scanner/file_walker.py +20 -14
- {codedd_cli-0.1.0 → codedd_cli-0.1.2}/codedd_cli/scanner/line_counter.py +13 -8
- {codedd_cli-0.1.0 → codedd_cli-0.1.2}/codedd_cli/utils/directory_validator.py +2 -3
- {codedd_cli-0.1.0 → codedd_cli-0.1.2}/codedd_cli/utils/display.py +313 -19
- {codedd_cli-0.1.0 → codedd_cli-0.1.2}/codedd_cli/utils/payload_inspector.py +4 -6
- {codedd_cli-0.1.0 → codedd_cli-0.1.2}/codedd_cli/utils/validators.py +1 -1
- {codedd_cli-0.1.0 → codedd_cli-0.1.2}/pyproject.toml +12 -3
- codedd_cli-0.1.0/codedd_cli/auditor/architecture_analyzer.py +0 -1241
- codedd_cli-0.1.0/codedd_cli/auditor/complexity_analyzer.py +0 -942
- codedd_cli-0.1.0/codedd_cli/auditor/git_stats_collector.py +0 -332
- codedd_cli-0.1.0/codedd_cli/commands/audit_cmd.py +0 -1877
- codedd_cli-0.1.0/codedd_cli/scanner/file_classifier.py +0 -247
- {codedd_cli-0.1.0 → codedd_cli-0.1.2}/LICENSE +0 -0
- {codedd_cli-0.1.0 → codedd_cli-0.1.2}/codedd_cli/__main__.py +0 -0
- {codedd_cli-0.1.0 → codedd_cli-0.1.2}/codedd_cli/api/__init__.py +0 -0
- {codedd_cli-0.1.0 → codedd_cli-0.1.2}/codedd_cli/auditor/__init__.py +0 -0
- {codedd_cli-0.1.0 → codedd_cli-0.1.2}/codedd_cli/auth/__init__.py +1 -1
- {codedd_cli-0.1.0 → codedd_cli-0.1.2}/codedd_cli/cli.py +2 -2
- {codedd_cli-0.1.0 → codedd_cli-0.1.2}/codedd_cli/commands/__init__.py +0 -0
- {codedd_cli-0.1.0 → codedd_cli-0.1.2}/codedd_cli/llm/__init__.py +0 -0
- {codedd_cli-0.1.0 → codedd_cli-0.1.2}/codedd_cli/models/__init__.py +1 -1
- {codedd_cli-0.1.0 → codedd_cli-0.1.2}/codedd_cli/models/account.py +0 -0
- {codedd_cli-0.1.0 → codedd_cli-0.1.2}/codedd_cli/scanner/__init__.py +1 -1
- {codedd_cli-0.1.0 → codedd_cli-0.1.2}/codedd_cli/utils/__init__.py +0 -0
- {codedd_cli-0.1.0 → codedd_cli-0.1.2}/codedd_cli/utils/security.py +0 -0
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: codedd-cli
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.2
|
|
4
4
|
Summary: CLI tool for CodeDD — run code audits from your terminal
|
|
5
5
|
License: MIT
|
|
6
6
|
License-File: LICENSE
|
|
7
7
|
Keywords: code-audit,security,cli,codedd
|
|
8
8
|
Author: CodeDD
|
|
9
|
-
Author-email:
|
|
9
|
+
Author-email: info@codedd.ai
|
|
10
10
|
Requires-Python: >=3.10,<4.0
|
|
11
11
|
Classifier: Development Status :: 3 - Alpha
|
|
12
12
|
Classifier: Environment :: Console
|
|
@@ -20,6 +20,9 @@ Classifier: Programming Language :: Python :: 3.13
|
|
|
20
20
|
Classifier: Programming Language :: Python :: 3.14
|
|
21
21
|
Classifier: Topic :: Security
|
|
22
22
|
Classifier: Topic :: Software Development :: Quality Assurance
|
|
23
|
+
Provides-Extra: esprima
|
|
24
|
+
Requires-Dist: defusedxml (>=0.7.1)
|
|
25
|
+
Requires-Dist: esprima (>=4.0.0) ; extra == "esprima"
|
|
23
26
|
Requires-Dist: httpx (>=0.27.0)
|
|
24
27
|
Requires-Dist: keyring (>=25.0.0)
|
|
25
28
|
Requires-Dist: lizard (>=1.17.0)
|
|
@@ -29,7 +32,7 @@ Requires-Dist: tomli (>=2.0.0) ; python_version < "3.11"
|
|
|
29
32
|
Requires-Dist: tomli-w (>=1.0.0)
|
|
30
33
|
Requires-Dist: typer[all] (>=0.9.0)
|
|
31
34
|
Project-URL: Homepage, https://codedd.ai
|
|
32
|
-
Project-URL: Repository, https://
|
|
35
|
+
Project-URL: Repository, https://gitlab.com/codedd1/codedd-cli
|
|
33
36
|
Description-Content-Type: text/markdown
|
|
34
37
|
|
|
35
38
|
# CodeDD CLI
|
|
@@ -66,18 +69,18 @@ Ideal for teams who want to keep source code local while still using CodeDD’s
|
|
|
66
69
|
|
|
67
70
|
### Requirements
|
|
68
71
|
|
|
69
|
-
- **Python 3.
|
|
72
|
+
- **Python 3.11+**
|
|
70
73
|
- A [CodeDD](https://codedd.ai) account and a CLI token (Account → CLI Access → Generate Token)
|
|
71
74
|
|
|
72
75
|
### From source (development)
|
|
73
76
|
|
|
74
77
|
```bash
|
|
75
|
-
git clone https://
|
|
78
|
+
git clone https://gitlab.com/codedd1/codedd-cli
|
|
76
79
|
cd codedd-cli
|
|
77
80
|
pip install -e .
|
|
78
81
|
```
|
|
79
82
|
|
|
80
|
-
### From PyPI
|
|
83
|
+
### From PyPI
|
|
81
84
|
|
|
82
85
|
```bash
|
|
83
86
|
pip install codedd-cli
|
|
@@ -91,11 +94,11 @@ codedd --version
|
|
|
91
94
|
|
|
92
95
|
---
|
|
93
96
|
|
|
94
|
-
## Quick start
|
|
97
|
+
## Quick start (recommended workflow)
|
|
95
98
|
|
|
96
|
-
### 1. Authenticate
|
|
99
|
+
### 1. Authenticate once
|
|
97
100
|
|
|
98
|
-
Generate a CLI token at [codedd.ai](https://codedd.ai) (Account
|
|
101
|
+
Generate a CLI token at [codedd.ai](https://codedd.ai) (Account -> CLI Access), then:
|
|
99
102
|
|
|
100
103
|
```bash
|
|
101
104
|
codedd auth login --token <your_token>
|
|
@@ -103,18 +106,24 @@ codedd auth login --token <your_token>
|
|
|
103
106
|
|
|
104
107
|
Or run `codedd auth login` and paste the token when prompted.
|
|
105
108
|
|
|
106
|
-
|
|
109
|
+
Optional sanity check:
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
codedd auth status
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
### 2. Select the active audit context
|
|
107
116
|
|
|
108
117
|
```bash
|
|
109
118
|
codedd audits list
|
|
110
119
|
codedd audits select
|
|
111
120
|
```
|
|
112
121
|
|
|
113
|
-
Choose a **group audit** (multiple repos) or a **single audit** (one repo). The selected audit becomes the active context
|
|
122
|
+
Choose a **group audit** (multiple repos) or a **single audit** (one repo). The selected audit becomes the active context used by all `scope` and `audit` commands.
|
|
114
123
|
|
|
115
|
-
### 3. Define scope
|
|
124
|
+
### 3. Define local scope
|
|
116
125
|
|
|
117
|
-
Add
|
|
126
|
+
Add local paths that correspond to the repositories in that audit (each path must be a Git repository root with commits):
|
|
118
127
|
|
|
119
128
|
```bash
|
|
120
129
|
codedd scope add /path/to/my-repo
|
|
@@ -122,18 +131,25 @@ codedd scope list
|
|
|
122
131
|
codedd scope confirm
|
|
123
132
|
```
|
|
124
133
|
|
|
125
|
-
`scope confirm`
|
|
134
|
+
`scope confirm` performs a metadata scan (paths, file types, LoC) and registers scope with CodeDD.
|
|
135
|
+
If files change later, `codedd audit start` auto-checks sync and prompts for re-confirmation when needed.
|
|
126
136
|
|
|
127
|
-
### 4.
|
|
137
|
+
### 4. Configure LLM key(s)
|
|
128
138
|
|
|
129
|
-
Configure at least one
|
|
139
|
+
Configure at least one provider key (used for local file-level auditing):
|
|
130
140
|
|
|
131
141
|
```bash
|
|
132
142
|
codedd config set-key anthropic
|
|
133
143
|
# or: codedd config set-key openai
|
|
134
144
|
```
|
|
135
145
|
|
|
136
|
-
|
|
146
|
+
Optional (recommended if both are configured):
|
|
147
|
+
|
|
148
|
+
```bash
|
|
149
|
+
codedd config provider both
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
### 5. Start the audit
|
|
137
153
|
|
|
138
154
|
```bash
|
|
139
155
|
codedd audit start
|
|
@@ -144,7 +160,7 @@ The CLI will:
|
|
|
144
160
|
- Sync scope with CodeDD (and prompt to re-confirm if local files changed).
|
|
145
161
|
- Run pre-flight checks (payment, LoC budget).
|
|
146
162
|
- Optionally open payment in the browser or deduct from budget.
|
|
147
|
-
- Fetch the
|
|
163
|
+
- Fetch the plan, run local analysis, submit structured results, and trigger server-side post-processing.
|
|
148
164
|
|
|
149
165
|
Results and recommendations are available in the CodeDD dashboard; you can also run `codedd audits list` to see status.
|
|
150
166
|
|
|
@@ -152,22 +168,35 @@ Results and recommendations are available in the CodeDD dashboard; you can also
|
|
|
152
168
|
|
|
153
169
|
## Workflow overview
|
|
154
170
|
|
|
155
|
-
|
|
171
|
+
Use this exact order for a predictable run:
|
|
156
172
|
|
|
173
|
+
```text
|
|
174
|
+
1. codedd auth login
|
|
175
|
+
2. codedd audits select
|
|
176
|
+
3. codedd scope add <repo-path> [more paths...]
|
|
177
|
+
4. codedd scope confirm
|
|
178
|
+
5. codedd config set-key <anthropic|openai> # at least one
|
|
179
|
+
6. codedd audit start
|
|
157
180
|
```
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
181
|
+
|
|
182
|
+
What `codedd audit start` does, in order:
|
|
183
|
+
|
|
184
|
+
```text
|
|
185
|
+
A. Auto-sync scope -> if changed, asks to re-confirm
|
|
186
|
+
B. Pre-flight on CodeDD -> checks status/payment/budget
|
|
187
|
+
C. Payment path -> budget deduction OR checkout flow
|
|
188
|
+
D. Local execution -> file audit (LLM), complexity, dependencies, git stats, architecture
|
|
189
|
+
E. Submission -> sends structured outputs to CodeDD
|
|
190
|
+
F. Completion -> triggers server-side consolidation/recommendations
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
If you update files after confirming scope:
|
|
194
|
+
|
|
195
|
+
```text
|
|
196
|
+
Run: codedd audit start
|
|
197
|
+
-> CLI detects drift
|
|
198
|
+
-> Re-confirm prompt appears
|
|
199
|
+
-> Continue with updated scope
|
|
171
200
|
```
|
|
172
201
|
|
|
173
202
|
| Step | Where it runs | What happens |
|
|
@@ -176,8 +205,9 @@ High-level flow:
|
|
|
176
205
|
| Pre-flight | CodeDD | Check payment, budget, status. |
|
|
177
206
|
| File audit | Local | LLM (Anthropic/OpenAI) analyses each file; results sent to CodeDD. |
|
|
178
207
|
| Complexity | Local | Radon/Lizard; metrics sent to CodeDD. |
|
|
179
|
-
| Dependencies | Local + CodeDD| Lockfiles/imports
|
|
180
|
-
|
|
|
208
|
+
| Dependencies | Local + CodeDD| Lockfiles/imports scanned locally; package/vuln data stored and enriched on CodeDD. |
|
|
209
|
+
| Git statistics | Local + CodeDD| Commit/churn/collaboration metrics collected locally, then submitted. |
|
|
210
|
+
| Architecture | Local + CodeDD| Components/relations extracted locally; persisted and processed on CodeDD. |
|
|
181
211
|
| Recommendations | CodeDD | Consolidation, technical debt, security, licenses, etc. |
|
|
182
212
|
|
|
183
213
|
---
|
|
@@ -215,7 +245,7 @@ High-level flow:
|
|
|
215
245
|
|
|
216
246
|
| Command | Description |
|
|
217
247
|
|--------|-------------|
|
|
218
|
-
| `codedd audit start` | Sync scope (if needed), pre-flight, pay/budget, then run full local audit and submit to CodeDD. Use `--skip-sync` to skip scope sync; `--yes` to auto-confirm; `--debug-llm` for LLM debug output. |
|
|
248
|
+
| `codedd audit start` | Sync scope (if needed), pre-flight, pay/budget, then run full local audit and submit to CodeDD. Use `--skip-sync` to skip scope sync; `--yes` to auto-confirm; `--show` for one-shot transparency summary; `--show-interactive` for per-request confirmations (debug); `--show-force-interactive` to override large-audit guardrails; `--debug-llm` for LLM debug output. |
|
|
219
249
|
|
|
220
250
|
### Configuration
|
|
221
251
|
|
|
@@ -225,6 +255,7 @@ High-level flow:
|
|
|
225
255
|
| `codedd config set <key> <value>` | Set a config value |
|
|
226
256
|
| `codedd config set-key [anthropic\|openai]` | Store an LLM API key in the OS keychain |
|
|
227
257
|
| `codedd config show-keys` | List which providers have keys configured (not the keys themselves) |
|
|
258
|
+
| `codedd config remove-key <anthropic\|openai>` | Remove a stored LLM API key from keychain |
|
|
228
259
|
| `codedd config provider [anthropic\|openai\|both]` | Set preferred LLM provider |
|
|
229
260
|
| `codedd config concurrency <n>` | Set max concurrent LLM requests (default 6) |
|
|
230
261
|
|
|
@@ -240,7 +271,7 @@ High-level flow:
|
|
|
240
271
|
| Variable | Purpose |
|
|
241
272
|
|---------|---------|
|
|
242
273
|
| `CODEDD_API_TOKEN` | Override the stored CLI token (e.g. for CI) |
|
|
243
|
-
|
|
274
|
+
|
|
244
275
|
|
|
245
276
|
---
|
|
246
277
|
|
|
@@ -256,7 +287,8 @@ High-level flow:
|
|
|
256
287
|
## Development
|
|
257
288
|
|
|
258
289
|
```bash
|
|
259
|
-
pip install -e
|
|
290
|
+
pip install -e .
|
|
291
|
+
pip install pytest pytest-httpx pytest-mock ruff
|
|
260
292
|
pytest
|
|
261
293
|
ruff check .
|
|
262
294
|
```
|
|
@@ -271,6 +303,6 @@ MIT License — see [LICENSE](LICENSE).
|
|
|
271
303
|
|
|
272
304
|
## Support
|
|
273
305
|
|
|
274
|
-
- **Issues:** [
|
|
306
|
+
- **Issues:** [GitLab Issues](https://gitlab.com/codedd1/codedd-cli/-/work_items)
|
|
275
307
|
- **Product:** [CodeDD](https://codedd.ai)
|
|
276
308
|
|
|
@@ -32,18 +32,18 @@ Ideal for teams who want to keep source code local while still using CodeDD’s
|
|
|
32
32
|
|
|
33
33
|
### Requirements
|
|
34
34
|
|
|
35
|
-
- **Python 3.
|
|
35
|
+
- **Python 3.11+**
|
|
36
36
|
- A [CodeDD](https://codedd.ai) account and a CLI token (Account → CLI Access → Generate Token)
|
|
37
37
|
|
|
38
38
|
### From source (development)
|
|
39
39
|
|
|
40
40
|
```bash
|
|
41
|
-
git clone https://
|
|
41
|
+
git clone https://gitlab.com/codedd1/codedd-cli
|
|
42
42
|
cd codedd-cli
|
|
43
43
|
pip install -e .
|
|
44
44
|
```
|
|
45
45
|
|
|
46
|
-
### From PyPI
|
|
46
|
+
### From PyPI
|
|
47
47
|
|
|
48
48
|
```bash
|
|
49
49
|
pip install codedd-cli
|
|
@@ -57,11 +57,11 @@ codedd --version
|
|
|
57
57
|
|
|
58
58
|
---
|
|
59
59
|
|
|
60
|
-
## Quick start
|
|
60
|
+
## Quick start (recommended workflow)
|
|
61
61
|
|
|
62
|
-
### 1. Authenticate
|
|
62
|
+
### 1. Authenticate once
|
|
63
63
|
|
|
64
|
-
Generate a CLI token at [codedd.ai](https://codedd.ai) (Account
|
|
64
|
+
Generate a CLI token at [codedd.ai](https://codedd.ai) (Account -> CLI Access), then:
|
|
65
65
|
|
|
66
66
|
```bash
|
|
67
67
|
codedd auth login --token <your_token>
|
|
@@ -69,18 +69,24 @@ codedd auth login --token <your_token>
|
|
|
69
69
|
|
|
70
70
|
Or run `codedd auth login` and paste the token when prompted.
|
|
71
71
|
|
|
72
|
-
|
|
72
|
+
Optional sanity check:
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
codedd auth status
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### 2. Select the active audit context
|
|
73
79
|
|
|
74
80
|
```bash
|
|
75
81
|
codedd audits list
|
|
76
82
|
codedd audits select
|
|
77
83
|
```
|
|
78
84
|
|
|
79
|
-
Choose a **group audit** (multiple repos) or a **single audit** (one repo). The selected audit becomes the active context
|
|
85
|
+
Choose a **group audit** (multiple repos) or a **single audit** (one repo). The selected audit becomes the active context used by all `scope` and `audit` commands.
|
|
80
86
|
|
|
81
|
-
### 3. Define scope
|
|
87
|
+
### 3. Define local scope
|
|
82
88
|
|
|
83
|
-
Add
|
|
89
|
+
Add local paths that correspond to the repositories in that audit (each path must be a Git repository root with commits):
|
|
84
90
|
|
|
85
91
|
```bash
|
|
86
92
|
codedd scope add /path/to/my-repo
|
|
@@ -88,18 +94,25 @@ codedd scope list
|
|
|
88
94
|
codedd scope confirm
|
|
89
95
|
```
|
|
90
96
|
|
|
91
|
-
`scope confirm`
|
|
97
|
+
`scope confirm` performs a metadata scan (paths, file types, LoC) and registers scope with CodeDD.
|
|
98
|
+
If files change later, `codedd audit start` auto-checks sync and prompts for re-confirmation when needed.
|
|
92
99
|
|
|
93
|
-
### 4.
|
|
100
|
+
### 4. Configure LLM key(s)
|
|
94
101
|
|
|
95
|
-
Configure at least one
|
|
102
|
+
Configure at least one provider key (used for local file-level auditing):
|
|
96
103
|
|
|
97
104
|
```bash
|
|
98
105
|
codedd config set-key anthropic
|
|
99
106
|
# or: codedd config set-key openai
|
|
100
107
|
```
|
|
101
108
|
|
|
102
|
-
|
|
109
|
+
Optional (recommended if both are configured):
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
codedd config provider both
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
### 5. Start the audit
|
|
103
116
|
|
|
104
117
|
```bash
|
|
105
118
|
codedd audit start
|
|
@@ -110,7 +123,7 @@ The CLI will:
|
|
|
110
123
|
- Sync scope with CodeDD (and prompt to re-confirm if local files changed).
|
|
111
124
|
- Run pre-flight checks (payment, LoC budget).
|
|
112
125
|
- Optionally open payment in the browser or deduct from budget.
|
|
113
|
-
- Fetch the
|
|
126
|
+
- Fetch the plan, run local analysis, submit structured results, and trigger server-side post-processing.
|
|
114
127
|
|
|
115
128
|
Results and recommendations are available in the CodeDD dashboard; you can also run `codedd audits list` to see status.
|
|
116
129
|
|
|
@@ -118,22 +131,35 @@ Results and recommendations are available in the CodeDD dashboard; you can also
|
|
|
118
131
|
|
|
119
132
|
## Workflow overview
|
|
120
133
|
|
|
121
|
-
|
|
134
|
+
Use this exact order for a predictable run:
|
|
122
135
|
|
|
136
|
+
```text
|
|
137
|
+
1. codedd auth login
|
|
138
|
+
2. codedd audits select
|
|
139
|
+
3. codedd scope add <repo-path> [more paths...]
|
|
140
|
+
4. codedd scope confirm
|
|
141
|
+
5. codedd config set-key <anthropic|openai> # at least one
|
|
142
|
+
6. codedd audit start
|
|
123
143
|
```
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
144
|
+
|
|
145
|
+
What `codedd audit start` does, in order:
|
|
146
|
+
|
|
147
|
+
```text
|
|
148
|
+
A. Auto-sync scope -> if changed, asks to re-confirm
|
|
149
|
+
B. Pre-flight on CodeDD -> checks status/payment/budget
|
|
150
|
+
C. Payment path -> budget deduction OR checkout flow
|
|
151
|
+
D. Local execution -> file audit (LLM), complexity, dependencies, git stats, architecture
|
|
152
|
+
E. Submission -> sends structured outputs to CodeDD
|
|
153
|
+
F. Completion -> triggers server-side consolidation/recommendations
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
If you update files after confirming scope:
|
|
157
|
+
|
|
158
|
+
```text
|
|
159
|
+
Run: codedd audit start
|
|
160
|
+
-> CLI detects drift
|
|
161
|
+
-> Re-confirm prompt appears
|
|
162
|
+
-> Continue with updated scope
|
|
137
163
|
```
|
|
138
164
|
|
|
139
165
|
| Step | Where it runs | What happens |
|
|
@@ -142,8 +168,9 @@ High-level flow:
|
|
|
142
168
|
| Pre-flight | CodeDD | Check payment, budget, status. |
|
|
143
169
|
| File audit | Local | LLM (Anthropic/OpenAI) analyses each file; results sent to CodeDD. |
|
|
144
170
|
| Complexity | Local | Radon/Lizard; metrics sent to CodeDD. |
|
|
145
|
-
| Dependencies | Local + CodeDD| Lockfiles/imports
|
|
146
|
-
|
|
|
171
|
+
| Dependencies | Local + CodeDD| Lockfiles/imports scanned locally; package/vuln data stored and enriched on CodeDD. |
|
|
172
|
+
| Git statistics | Local + CodeDD| Commit/churn/collaboration metrics collected locally, then submitted. |
|
|
173
|
+
| Architecture | Local + CodeDD| Components/relations extracted locally; persisted and processed on CodeDD. |
|
|
147
174
|
| Recommendations | CodeDD | Consolidation, technical debt, security, licenses, etc. |
|
|
148
175
|
|
|
149
176
|
---
|
|
@@ -181,7 +208,7 @@ High-level flow:
|
|
|
181
208
|
|
|
182
209
|
| Command | Description |
|
|
183
210
|
|--------|-------------|
|
|
184
|
-
| `codedd audit start` | Sync scope (if needed), pre-flight, pay/budget, then run full local audit and submit to CodeDD. Use `--skip-sync` to skip scope sync; `--yes` to auto-confirm; `--debug-llm` for LLM debug output. |
|
|
211
|
+
| `codedd audit start` | Sync scope (if needed), pre-flight, pay/budget, then run full local audit and submit to CodeDD. Use `--skip-sync` to skip scope sync; `--yes` to auto-confirm; `--show` for one-shot transparency summary; `--show-interactive` for per-request confirmations (debug); `--show-force-interactive` to override large-audit guardrails; `--debug-llm` for LLM debug output. |
|
|
185
212
|
|
|
186
213
|
### Configuration
|
|
187
214
|
|
|
@@ -191,6 +218,7 @@ High-level flow:
|
|
|
191
218
|
| `codedd config set <key> <value>` | Set a config value |
|
|
192
219
|
| `codedd config set-key [anthropic\|openai]` | Store an LLM API key in the OS keychain |
|
|
193
220
|
| `codedd config show-keys` | List which providers have keys configured (not the keys themselves) |
|
|
221
|
+
| `codedd config remove-key <anthropic\|openai>` | Remove a stored LLM API key from keychain |
|
|
194
222
|
| `codedd config provider [anthropic\|openai\|both]` | Set preferred LLM provider |
|
|
195
223
|
| `codedd config concurrency <n>` | Set max concurrent LLM requests (default 6) |
|
|
196
224
|
|
|
@@ -206,7 +234,7 @@ High-level flow:
|
|
|
206
234
|
| Variable | Purpose |
|
|
207
235
|
|---------|---------|
|
|
208
236
|
| `CODEDD_API_TOKEN` | Override the stored CLI token (e.g. for CI) |
|
|
209
|
-
|
|
237
|
+
|
|
210
238
|
|
|
211
239
|
---
|
|
212
240
|
|
|
@@ -222,7 +250,8 @@ High-level flow:
|
|
|
222
250
|
## Development
|
|
223
251
|
|
|
224
252
|
```bash
|
|
225
|
-
pip install -e
|
|
253
|
+
pip install -e .
|
|
254
|
+
pip install pytest pytest-httpx pytest-mock ruff
|
|
226
255
|
pytest
|
|
227
256
|
ruff check .
|
|
228
257
|
```
|
|
@@ -237,5 +266,5 @@ MIT License — see [LICENSE](LICENSE).
|
|
|
237
266
|
|
|
238
267
|
## Support
|
|
239
268
|
|
|
240
|
-
- **Issues:** [
|
|
269
|
+
- **Issues:** [GitLab Issues](https://gitlab.com/codedd1/codedd-cli/-/work_items)
|
|
241
270
|
- **Product:** [CodeDD](https://codedd.ai)
|
|
@@ -10,7 +10,7 @@ Wraps ``httpx`` with:
|
|
|
10
10
|
"""
|
|
11
11
|
|
|
12
12
|
import time
|
|
13
|
-
from typing import Any
|
|
13
|
+
from typing import Any
|
|
14
14
|
|
|
15
15
|
import httpx
|
|
16
16
|
|
|
@@ -36,15 +36,17 @@ class CodeDDClient:
|
|
|
36
36
|
data = resp.json()
|
|
37
37
|
"""
|
|
38
38
|
|
|
39
|
-
def __init__(self, config:
|
|
39
|
+
def __init__(self, config: ConfigManager | None = None) -> None:
|
|
40
40
|
self._config = config or ConfigManager()
|
|
41
41
|
self._base_url = self._config.api_url.rstrip("/")
|
|
42
42
|
self._token = TokenManager.retrieve()
|
|
43
|
-
|
|
43
|
+
|
|
44
44
|
# For localhost HTTP, disable TLS verification (not applicable anyway)
|
|
45
45
|
# For HTTPS, always verify certificates
|
|
46
|
-
verify_tls = not self._base_url.startswith("http://localhost") and not self._base_url.startswith(
|
|
47
|
-
|
|
46
|
+
verify_tls = not self._base_url.startswith("http://localhost") and not self._base_url.startswith(
|
|
47
|
+
"http://127.0.0.1"
|
|
48
|
+
)
|
|
49
|
+
|
|
48
50
|
self._client = httpx.Client(
|
|
49
51
|
base_url=self._base_url,
|
|
50
52
|
headers=self._build_headers(),
|
|
@@ -79,7 +81,7 @@ class CodeDDClient:
|
|
|
79
81
|
Retries on 5xx responses and connection errors using exponential
|
|
80
82
|
back-off (1s, 2s, 4s …).
|
|
81
83
|
"""
|
|
82
|
-
last_exc:
|
|
84
|
+
last_exc: Exception | None = None
|
|
83
85
|
|
|
84
86
|
for attempt in range(1, MAX_RETRIES + 1):
|
|
85
87
|
try:
|
|
@@ -17,6 +17,7 @@ class Endpoints:
|
|
|
17
17
|
# Scope
|
|
18
18
|
REGISTER_SCOPE = "/api/cli/scope/register/"
|
|
19
19
|
SCOPE_FILES = "/api/cli/scope/files/"
|
|
20
|
+
DELETE_REPO_FROM_SCOPE = "/delete_repo_from_scope/"
|
|
20
21
|
|
|
21
22
|
# Audit lifecycle
|
|
22
23
|
AUDIT_CAN_START = "/api/cli/audit/can-start/"
|
|
@@ -38,6 +39,7 @@ class Endpoints:
|
|
|
38
39
|
|
|
39
40
|
# Local git statistics (for CLI-driven audits; enables dashboards)
|
|
40
41
|
AUDIT_GIT_STATISTICS = "/api/cli/audit/git-statistics/"
|
|
42
|
+
AUDIT_GIT_DEVELOPMENT_ANALYSIS = "/api/cli/audit/git-development-analysis/"
|
|
41
43
|
AUDIT_VULNERABILITY_VALIDATION = "/api/cli/audit/vulnerability-validation/"
|
|
42
44
|
|
|
43
45
|
# Architecture analysis (Phase 1+2 run locally; server runs Phase 3 + storage)
|
|
@@ -6,7 +6,6 @@ timeout, server disconnected, etc.). Handled at the CLI entry point to
|
|
|
6
6
|
display a single, clear message instead of a full traceback.
|
|
7
7
|
"""
|
|
8
8
|
|
|
9
|
-
|
|
10
9
|
# Pre-defined message shown when the remote is not responding.
|
|
11
10
|
CONNECTION_ERROR_MESSAGE = (
|
|
12
11
|
"Unable to reach CodeDD. "
|