codedd-cli 0.1.9__tar.gz → 0.1.10__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.9 → codedd_cli-0.1.10}/PKG-INFO +78 -4
- {codedd_cli-0.1.9 → codedd_cli-0.1.10}/README.md +77 -3
- {codedd_cli-0.1.9 → codedd_cli-0.1.10}/codedd_cli/__init__.py +1 -1
- {codedd_cli-0.1.9 → codedd_cli-0.1.10}/codedd_cli/auth/session.py +24 -8
- {codedd_cli-0.1.9 → codedd_cli-0.1.10}/codedd_cli/commands/ai_docs_cmd.py +129 -31
- {codedd_cli-0.1.9 → codedd_cli-0.1.10}/codedd_cli/commands/audit_cmd.py +5 -1
- {codedd_cli-0.1.9 → codedd_cli-0.1.10}/codedd_cli/commands/auth_cmd.py +81 -41
- {codedd_cli-0.1.9 → codedd_cli-0.1.10}/codedd_cli/commands/config_cmd.py +7 -0
- {codedd_cli-0.1.9 → codedd_cli-0.1.10}/codedd_cli/commands/fix_cmd.py +578 -91
- {codedd_cli-0.1.9 → codedd_cli-0.1.10}/codedd_cli/llm/anthropic_utils.py +4 -5
- {codedd_cli-0.1.9 → codedd_cli-0.1.10}/codedd_cli/llm/key_manager.py +37 -8
- {codedd_cli-0.1.9 → codedd_cli-0.1.10}/pyproject.toml +1 -1
- {codedd_cli-0.1.9 → codedd_cli-0.1.10}/LICENSE +0 -0
- {codedd_cli-0.1.9 → codedd_cli-0.1.10}/codedd_cli/__main__.py +0 -0
- {codedd_cli-0.1.9 → codedd_cli-0.1.10}/codedd_cli/api/__init__.py +0 -0
- {codedd_cli-0.1.9 → codedd_cli-0.1.10}/codedd_cli/api/client.py +0 -0
- {codedd_cli-0.1.9 → codedd_cli-0.1.10}/codedd_cli/api/endpoints.py +0 -0
- {codedd_cli-0.1.9 → codedd_cli-0.1.10}/codedd_cli/api/exceptions.py +0 -0
- {codedd_cli-0.1.9 → codedd_cli-0.1.10}/codedd_cli/auditor/__init__.py +0 -0
- {codedd_cli-0.1.9 → codedd_cli-0.1.10}/codedd_cli/auditor/archetype_classifier.py +0 -0
- {codedd_cli-0.1.9 → codedd_cli-0.1.10}/codedd_cli/auditor/architecture_analyzer.py +0 -0
- {codedd_cli-0.1.9 → codedd_cli-0.1.10}/codedd_cli/auditor/architecture_prompts.py +0 -0
- {codedd_cli-0.1.9 → codedd_cli-0.1.10}/codedd_cli/auditor/architecture_schema_contract.py +0 -0
- {codedd_cli-0.1.9 → codedd_cli-0.1.10}/codedd_cli/auditor/audit_checkpoint.py +0 -0
- {codedd_cli-0.1.9 → codedd_cli-0.1.10}/codedd_cli/auditor/audit_progress_sync.py +0 -0
- {codedd_cli-0.1.9 → codedd_cli-0.1.10}/codedd_cli/auditor/commit_classifier.py +0 -0
- {codedd_cli-0.1.9 → codedd_cli-0.1.10}/codedd_cli/auditor/complexity_analyzer.py +0 -0
- {codedd_cli-0.1.9 → codedd_cli-0.1.10}/codedd_cli/auditor/cross_repo_evidence.py +0 -0
- {codedd_cli-0.1.9 → codedd_cli-0.1.10}/codedd_cli/auditor/dependency_scanner.py +0 -0
- {codedd_cli-0.1.9 → codedd_cli-0.1.10}/codedd_cli/auditor/file_auditor.py +0 -0
- {codedd_cli-0.1.9 → codedd_cli-0.1.10}/codedd_cli/auditor/git_stats_collector.py +0 -0
- {codedd_cli-0.1.9 → codedd_cli-0.1.10}/codedd_cli/auditor/parity_overrides.py +0 -0
- {codedd_cli-0.1.9 → codedd_cli-0.1.10}/codedd_cli/auditor/response_parser.py +0 -0
- {codedd_cli-0.1.9 → codedd_cli-0.1.10}/codedd_cli/auditor/server_parity/MANIFEST.json +0 -0
- {codedd_cli-0.1.9 → codedd_cli-0.1.10}/codedd_cli/auditor/server_parity/__init__.py +0 -0
- {codedd_cli-0.1.9 → codedd_cli-0.1.10}/codedd_cli/auditor/server_parity/enhanced_relationship_detector.py +0 -0
- {codedd_cli-0.1.9 → codedd_cli-0.1.10}/codedd_cli/auditor/server_parity/enhanced_technology_detector.py +0 -0
- {codedd_cli-0.1.9 → codedd_cli-0.1.10}/codedd_cli/auditor/server_parity/evidence_extractor.py +0 -0
- {codedd_cli-0.1.9 → codedd_cli-0.1.10}/codedd_cli/auditor/server_parity/infra_scan.py +0 -0
- {codedd_cli-0.1.9 → codedd_cli-0.1.10}/codedd_cli/auditor/server_parity/manifest_coordinate_resolver.py +0 -0
- {codedd_cli-0.1.9 → codedd_cli-0.1.10}/codedd_cli/auditor/server_parity/published_identity.py +0 -0
- {codedd_cli-0.1.9 → codedd_cli-0.1.10}/codedd_cli/auditor/server_parity/repo_file.py +0 -0
- {codedd_cli-0.1.9 → codedd_cli-0.1.10}/codedd_cli/auditor/server_parity/repo_kind.py +0 -0
- {codedd_cli-0.1.9 → codedd_cli-0.1.10}/codedd_cli/auditor/server_parity/taxonomy.py +0 -0
- {codedd_cli-0.1.9 → codedd_cli-0.1.10}/codedd_cli/auditor/server_parity/tech_normalizer.py +0 -0
- {codedd_cli-0.1.9 → codedd_cli-0.1.10}/codedd_cli/auditor/server_parity/technology_lists.py +0 -0
- {codedd_cli-0.1.9 → codedd_cli-0.1.10}/codedd_cli/auditor/server_parity/tier_definitions.py +0 -0
- {codedd_cli-0.1.9 → codedd_cli-0.1.10}/codedd_cli/auditor/sub_audit_runner.py +0 -0
- {codedd_cli-0.1.9 → codedd_cli-0.1.10}/codedd_cli/auditor/tier_definitions.py +0 -0
- {codedd_cli-0.1.9 → codedd_cli-0.1.10}/codedd_cli/auditor/vulnerability_analysis/__init__.py +0 -0
- {codedd_cli-0.1.9 → codedd_cli-0.1.10}/codedd_cli/auditor/vulnerability_analysis/agents.py +0 -0
- {codedd_cli-0.1.9 → codedd_cli-0.1.10}/codedd_cli/auditor/vulnerability_analysis/cli_ai_auditor.py +0 -0
- {codedd_cli-0.1.9 → codedd_cli-0.1.10}/codedd_cli/auditor/vulnerability_analysis/cli_orchestrator.py +0 -0
- {codedd_cli-0.1.9 → codedd_cli-0.1.10}/codedd_cli/auditor/vulnerability_analysis/cli_settings.py +0 -0
- {codedd_cli-0.1.9 → codedd_cli-0.1.10}/codedd_cli/auditor/vulnerability_analysis/file_io.py +0 -0
- {codedd_cli-0.1.9 → codedd_cli-0.1.10}/codedd_cli/auditor/vulnerability_analysis/lang_ast/__init__.py +0 -0
- {codedd_cli-0.1.9 → codedd_cli-0.1.10}/codedd_cli/auditor/vulnerability_analysis/lang_ast/_generic.py +0 -0
- {codedd_cli-0.1.9 → codedd_cli-0.1.10}/codedd_cli/auditor/vulnerability_analysis/lang_ast/c_cpp.py +0 -0
- {codedd_cli-0.1.9 → codedd_cli-0.1.10}/codedd_cli/auditor/vulnerability_analysis/lang_ast/csharp.py +0 -0
- {codedd_cli-0.1.9 → codedd_cli-0.1.10}/codedd_cli/auditor/vulnerability_analysis/lang_ast/go.py +0 -0
- {codedd_cli-0.1.9 → codedd_cli-0.1.10}/codedd_cli/auditor/vulnerability_analysis/lang_ast/java.py +0 -0
- {codedd_cli-0.1.9 → codedd_cli-0.1.10}/codedd_cli/auditor/vulnerability_analysis/lang_ast/js_ts.py +0 -0
- {codedd_cli-0.1.9 → codedd_cli-0.1.10}/codedd_cli/auditor/vulnerability_analysis/lang_ast/kotlin.py +0 -0
- {codedd_cli-0.1.9 → codedd_cli-0.1.10}/codedd_cli/auditor/vulnerability_analysis/lang_ast/php.py +0 -0
- {codedd_cli-0.1.9 → codedd_cli-0.1.10}/codedd_cli/auditor/vulnerability_analysis/lang_ast/ruby.py +0 -0
- {codedd_cli-0.1.9 → codedd_cli-0.1.10}/codedd_cli/auditor/vulnerability_analysis/lang_ast/rust.py +0 -0
- {codedd_cli-0.1.9 → codedd_cli-0.1.10}/codedd_cli/auditor/vulnerability_analysis/lang_ast/scala.py +0 -0
- {codedd_cli-0.1.9 → codedd_cli-0.1.10}/codedd_cli/auditor/vulnerability_analysis/lang_ast/shell.py +0 -0
- {codedd_cli-0.1.9 → codedd_cli-0.1.10}/codedd_cli/auditor/vulnerability_analysis/lang_ast/swift.py +0 -0
- {codedd_cli-0.1.9 → codedd_cli-0.1.10}/codedd_cli/auditor/vulnerability_analysis/lang_ast/taint.py +0 -0
- {codedd_cli-0.1.9 → codedd_cli-0.1.10}/codedd_cli/auditor/vulnerability_analysis/lang_snippets.py +0 -0
- {codedd_cli-0.1.9 → codedd_cli-0.1.10}/codedd_cli/auditor/vulnerability_analysis/langgraph_runner.py +0 -0
- {codedd_cli-0.1.9 → codedd_cli-0.1.10}/codedd_cli/auditor/vulnerability_analysis/planner.py +0 -0
- {codedd_cli-0.1.9 → codedd_cli-0.1.10}/codedd_cli/auditor/vulnerability_analysis/prompts.py +0 -0
- {codedd_cli-0.1.9 → codedd_cli-0.1.10}/codedd_cli/auditor/vulnerability_analysis/scope.py +0 -0
- {codedd_cli-0.1.9 → codedd_cli-0.1.10}/codedd_cli/auditor/vulnerability_analysis/security_patterns.py +0 -0
- {codedd_cli-0.1.9 → codedd_cli-0.1.10}/codedd_cli/auditor/vulnerability_analysis/semgrep_runner.py +0 -0
- {codedd_cli-0.1.9 → codedd_cli-0.1.10}/codedd_cli/auditor/vulnerability_analysis/state.py +0 -0
- {codedd_cli-0.1.9 → codedd_cli-0.1.10}/codedd_cli/auditor/vulnerability_analysis/tools.py +0 -0
- {codedd_cli-0.1.9 → codedd_cli-0.1.10}/codedd_cli/auditor/vulnerability_validator.py +0 -0
- {codedd_cli-0.1.9 → codedd_cli-0.1.10}/codedd_cli/auth/__init__.py +0 -0
- {codedd_cli-0.1.9 → codedd_cli-0.1.10}/codedd_cli/auth/token_manager.py +0 -0
- {codedd_cli-0.1.9 → codedd_cli-0.1.10}/codedd_cli/cli.py +0 -0
- {codedd_cli-0.1.9 → codedd_cli-0.1.10}/codedd_cli/commands/__init__.py +0 -0
- {codedd_cli-0.1.9 → codedd_cli-0.1.10}/codedd_cli/commands/audits_cmd.py +0 -0
- {codedd_cli-0.1.9 → codedd_cli-0.1.10}/codedd_cli/commands/scope_cmd.py +0 -0
- {codedd_cli-0.1.9 → codedd_cli-0.1.10}/codedd_cli/config/__init__.py +0 -0
- {codedd_cli-0.1.9 → codedd_cli-0.1.10}/codedd_cli/config/constants.py +0 -0
- {codedd_cli-0.1.9 → codedd_cli-0.1.10}/codedd_cli/config/fix_session.py +0 -0
- {codedd_cli-0.1.9 → codedd_cli-0.1.10}/codedd_cli/config/settings.py +0 -0
- {codedd_cli-0.1.9 → codedd_cli-0.1.10}/codedd_cli/config/url_validation.py +0 -0
- {codedd_cli-0.1.9 → codedd_cli-0.1.10}/codedd_cli/llm/__init__.py +0 -0
- {codedd_cli-0.1.9 → codedd_cli-0.1.10}/codedd_cli/models/__init__.py +0 -0
- {codedd_cli-0.1.9 → codedd_cli-0.1.10}/codedd_cli/models/account.py +0 -0
- {codedd_cli-0.1.9 → codedd_cli-0.1.10}/codedd_cli/models/audit.py +0 -0
- {codedd_cli-0.1.9 → codedd_cli-0.1.10}/codedd_cli/models/local_directory.py +0 -0
- {codedd_cli-0.1.9 → codedd_cli-0.1.10}/codedd_cli/scanner/__init__.py +0 -0
- {codedd_cli-0.1.9 → codedd_cli-0.1.10}/codedd_cli/scanner/file_classifier.py +0 -0
- {codedd_cli-0.1.9 → codedd_cli-0.1.10}/codedd_cli/scanner/file_walker.py +0 -0
- {codedd_cli-0.1.9 → codedd_cli-0.1.10}/codedd_cli/scanner/line_counter.py +0 -0
- {codedd_cli-0.1.9 → codedd_cli-0.1.10}/codedd_cli/utils/__init__.py +0 -0
- {codedd_cli-0.1.9 → codedd_cli-0.1.10}/codedd_cli/utils/directory_validator.py +0 -0
- {codedd_cli-0.1.9 → codedd_cli-0.1.10}/codedd_cli/utils/display.py +0 -0
- {codedd_cli-0.1.9 → codedd_cli-0.1.10}/codedd_cli/utils/payload_inspector.py +0 -0
- {codedd_cli-0.1.9 → codedd_cli-0.1.10}/codedd_cli/utils/safe_path.py +0 -0
- {codedd_cli-0.1.9 → codedd_cli-0.1.10}/codedd_cli/utils/security.py +0 -0
- {codedd_cli-0.1.9 → codedd_cli-0.1.10}/codedd_cli/utils/validators.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: codedd-cli
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.10
|
|
4
4
|
Summary: CLI tool for CodeDD — run code audits from your terminal
|
|
5
5
|
License: MIT
|
|
6
6
|
License-File: LICENSE
|
|
@@ -62,6 +62,7 @@ Ideal for teams who want to keep source code local while still using CodeDD’s
|
|
|
62
62
|
- **Complexity analysis** — Cyclomatic complexity and Halstead metrics (Radon/Lizard) run locally and are submitted to CodeDD.
|
|
63
63
|
- **Dependency scanning** — Local lockfile/manifest and import parsing; dependency data is sent to CodeDD for vulnerability and license analysis.
|
|
64
64
|
- **Architecture analysis** — Local component/relationship extraction with optional LLM enhancement; additional local heuristics infer technologies, coupling, and communication-style signals (aligned with CodeDD payloads). Phase 3 synthesis and storage run on CodeDD.
|
|
65
|
+
- **Issue remediation (`codedd fix`)** — Work through audit flags and dependency vulnerabilities from the terminal: fetch overviews, get the next issue by priority, record progress, mark resolved, and scope to a repo or Issue Compass saved list. Designed for interactive use and AI-agent workflows (`context`, `summarize`, `--json`).
|
|
65
66
|
- **Payment and budget** — Pre-flight checks, LoC budget deduction, or Stripe checkout when additional payment is required.
|
|
66
67
|
- **Secure auth** — CLI tokens stored in the OS credential store (Windows Credential Locker, macOS Keychain, Linux Secret Service).
|
|
67
68
|
|
|
@@ -94,6 +95,8 @@ Verify:
|
|
|
94
95
|
codedd --version
|
|
95
96
|
```
|
|
96
97
|
|
|
98
|
+
On Linux, the OS credential store needs a Secret Service provider such as gnome-keyring or KWallet (typically present on desktop environments). Headless servers, containers, and CI runners generally do not; use environment variables instead of `codedd auth login` / `codedd config set-key` (see [Environment variables](#environment-variables)).
|
|
99
|
+
|
|
97
100
|
---
|
|
98
101
|
|
|
99
102
|
## Quick start (recommended workflow)
|
|
@@ -108,6 +111,8 @@ codedd auth login --token <your_token>
|
|
|
108
111
|
|
|
109
112
|
Or run `codedd auth login` and paste the token when prompted.
|
|
110
113
|
|
|
114
|
+
On headless Linux or in CI, skip login and export `CODEDD_API_TOKEN` instead (see [Environment variables](#environment-variables)).
|
|
115
|
+
|
|
111
116
|
Optional sanity check:
|
|
112
117
|
|
|
113
118
|
```bash
|
|
@@ -145,6 +150,8 @@ codedd config set-key anthropic
|
|
|
145
150
|
# or: codedd config set-key openai
|
|
146
151
|
```
|
|
147
152
|
|
|
153
|
+
Alternatively, export a provider key (`ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, `GEMINI_API_KEY`, `XAI_API_KEY`, or the `CODEDD_*` equivalents). Environment variables take precedence over the keychain.
|
|
154
|
+
|
|
148
155
|
Optional (recommended if both are configured):
|
|
149
156
|
|
|
150
157
|
```bash
|
|
@@ -166,6 +173,35 @@ The CLI will:
|
|
|
166
173
|
|
|
167
174
|
Results and recommendations are available in the CodeDD dashboard; you can also run `codedd audits list` to see status.
|
|
168
175
|
|
|
176
|
+
### 6. Fix issues (optional, after audit completes)
|
|
177
|
+
|
|
178
|
+
Once an audit has finished and remediation data is available on CodeDD, use `codedd fix` to work through flags and vulnerabilities locally:
|
|
179
|
+
|
|
180
|
+
**Group / portfolio audit** (multiple repos):
|
|
181
|
+
|
|
182
|
+
```bash
|
|
183
|
+
codedd fix status # repos ranked by severity
|
|
184
|
+
codedd fix repo my-service # scope to one repository
|
|
185
|
+
codedd fix flags next --auto # next unresolved flag (red first)
|
|
186
|
+
codedd fix resolve --comment "Fixed null check in auth handler"
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
**Single-repo audit:**
|
|
190
|
+
|
|
191
|
+
```bash
|
|
192
|
+
codedd fix fetch flags
|
|
193
|
+
codedd fix flags next --auto
|
|
194
|
+
codedd fix resolve --comment "Updated lodash to 4.17.21"
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
`codedd fix resolve` records the comment, marks the issue fixed, and prints the next one, so the remediation loop is a single command per issue. Repeat it until the output shows `QUEUE EMPTY`.
|
|
198
|
+
|
|
199
|
+
For dependency vulnerabilities, swap `flags` for `vulns` (`codedd fix fetch vulns`, `codedd fix vulns next --auto`, `codedd fix vulns affected-files <package>`).
|
|
200
|
+
|
|
201
|
+
Issue Compass saved lists from the web UI can narrow flag remediation: `codedd fix selections list`, then `codedd fix selections use <n>`.
|
|
202
|
+
|
|
203
|
+
Run `codedd ai-docs fix` for the full remediation reference (AI-agent workflows, JSON output, access controls).
|
|
204
|
+
|
|
169
205
|
---
|
|
170
206
|
|
|
171
207
|
## Workflow overview
|
|
@@ -248,6 +284,32 @@ Run: codedd audit start
|
|
|
248
284
|
| Command | Description |
|
|
249
285
|
|--------|-------------|
|
|
250
286
|
| `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; `--debug-llm-full-prompt` to include the full proprietary system prompt in that output (sensitive). |
|
|
287
|
+
| `codedd audit status` | Show pipeline step progress for an active or resumable audit. |
|
|
288
|
+
|
|
289
|
+
### Issue remediation (`codedd fix`)
|
|
290
|
+
|
|
291
|
+
Requires a completed audit with remediation data on CodeDD. Select the audit first (`codedd audits select`).
|
|
292
|
+
|
|
293
|
+
| Command | Description |
|
|
294
|
+
|--------|-------------|
|
|
295
|
+
| `codedd fix status [--json]` | Dashboard of open flags/vulns; repos ranked by severity in group audits |
|
|
296
|
+
| `codedd fix repo [name\|uuid]` | Scope fix workflow to one sub-audit (group audits) |
|
|
297
|
+
| `codedd fix fetch flags\|vulns` | Load issue overview (interactive sub-audit pick when needed) |
|
|
298
|
+
| `codedd fix flags next [--auto] [--json]` | Next unresolved flag; `--auto` prioritizes red issues |
|
|
299
|
+
| `codedd fix flags invalidate [--reason "<text>"]` | Mark current flag as invalid and advance |
|
|
300
|
+
| `codedd fix vulns next [--auto] [--severity S] [--used-only] [--json]` | Next vulnerability; `--auto` prioritizes critical |
|
|
301
|
+
| `codedd fix vulns affected-files <package> [--json]` | List local files importing a vulnerable package |
|
|
302
|
+
| `codedd fix resolve [--comment "<text>"]` | Record progress, mark resolved, and print the next issue |
|
|
303
|
+
| `codedd fix comment "<text>"` | Record progress without resolving |
|
|
304
|
+
| `codedd fix context [--json]` / `summarize` | Session snapshot for AI agents |
|
|
305
|
+
| `codedd fix selections list\|show\|use\|clear` | Issue Compass saved flag lists from the web UI |
|
|
306
|
+
| `codedd fix access status\|enable\|disable\|activate\|deactivate` | Remediation Module access (org initiator) |
|
|
307
|
+
|
|
308
|
+
Comment text can also be supplied with `--comment-file <path>` or on stdin (`codedd fix comment -`), which avoids shell quoting for multi-line or quote-heavy notes.
|
|
309
|
+
|
|
310
|
+
**Exit codes** (for scripted and AI-agent loops): `0` issue delivered or action succeeded, `1` error, `3` no unresolved issues left in the current scope. Commands that deliver an issue also print a loop protocol block — the remaining count, the exact next command, and the stop condition — on every invocation, so long remediation runs do not depend on the instruction surviving in an agent's context window.
|
|
311
|
+
|
|
312
|
+
See `codedd ai-docs fix` for detailed examples and agent integration patterns.
|
|
251
313
|
|
|
252
314
|
### Configuration
|
|
253
315
|
|
|
@@ -266,7 +328,7 @@ Run: codedd audit start
|
|
|
266
328
|
## Configuration
|
|
267
329
|
|
|
268
330
|
- **Config file:** `~/.codedd/config.toml` (TOML). Stores API URL, active audit, scope directories, LLM provider, concurrency. Permissions are restricted to the owner (Unix).
|
|
269
|
-
- **Secrets:**
|
|
331
|
+
- **Secrets:** On desktop, the CLI token and LLM API keys are stored in the system keychain (Windows Credential Locker, macOS Keychain, Linux Secret Service), not in the config file. On headless systems, supply them via environment variables; the CLI does not write secrets to disk.
|
|
270
332
|
|
|
271
333
|
Optional `[audit]` keys (defaults shown) tune how long the CLI waits after opening a payment browser flow:
|
|
272
334
|
|
|
@@ -277,14 +339,26 @@ Optional `[audit]` keys (defaults shown) tune how long the CLI waits after openi
|
|
|
277
339
|
|
|
278
340
|
| Variable | Purpose |
|
|
279
341
|
|---------|---------|
|
|
280
|
-
| `CODEDD_API_TOKEN` |
|
|
342
|
+
| `CODEDD_API_TOKEN` | CLI token (used when the OS keyring is unavailable, e.g. CI or headless Linux). Takes precedence over a stored keyring token. |
|
|
343
|
+
| `CODEDD_ANTHROPIC_API_KEY` / `ANTHROPIC_API_KEY` | Anthropic API key. `CODEDD_*` wins if both are set. |
|
|
344
|
+
| `CODEDD_OPENAI_API_KEY` / `OPENAI_API_KEY` | OpenAI API key. |
|
|
345
|
+
| `CODEDD_GEMINI_API_KEY` / `GEMINI_API_KEY` / `GOOGLE_API_KEY` | Google Gemini API key. |
|
|
346
|
+
| `CODEDD_GROK_API_KEY` / `XAI_API_KEY` / `GROK_API_KEY` | xAI Grok API key. |
|
|
347
|
+
|
|
348
|
+
Headless / CI example:
|
|
349
|
+
|
|
350
|
+
```bash
|
|
351
|
+
export CODEDD_API_TOKEN=codedd_cli_...
|
|
352
|
+
export ANTHROPIC_API_KEY=sk-ant-...
|
|
353
|
+
codedd audit start --yes
|
|
354
|
+
```
|
|
281
355
|
|
|
282
356
|
|
|
283
357
|
---
|
|
284
358
|
|
|
285
359
|
## Security
|
|
286
360
|
|
|
287
|
-
- CLI tokens and LLM keys are stored in the OS credential store, not in plaintext on disk.
|
|
361
|
+
- On desktop, CLI tokens and LLM keys are stored in the OS credential store, not in plaintext on disk. On headless Linux, containers, and CI, supply them through environment variables; the CLI does not write those secrets to disk.
|
|
288
362
|
- TLS certificate verification is always enabled for API requests.
|
|
289
363
|
- Config file and `~/.codedd` directory use owner-only permissions where supported.
|
|
290
364
|
- Tokens expire after 90 days (server-configurable); re-generate from the CodeDD dashboard when needed.
|
|
@@ -23,6 +23,7 @@ Ideal for teams who want to keep source code local while still using CodeDD’s
|
|
|
23
23
|
- **Complexity analysis** — Cyclomatic complexity and Halstead metrics (Radon/Lizard) run locally and are submitted to CodeDD.
|
|
24
24
|
- **Dependency scanning** — Local lockfile/manifest and import parsing; dependency data is sent to CodeDD for vulnerability and license analysis.
|
|
25
25
|
- **Architecture analysis** — Local component/relationship extraction with optional LLM enhancement; additional local heuristics infer technologies, coupling, and communication-style signals (aligned with CodeDD payloads). Phase 3 synthesis and storage run on CodeDD.
|
|
26
|
+
- **Issue remediation (`codedd fix`)** — Work through audit flags and dependency vulnerabilities from the terminal: fetch overviews, get the next issue by priority, record progress, mark resolved, and scope to a repo or Issue Compass saved list. Designed for interactive use and AI-agent workflows (`context`, `summarize`, `--json`).
|
|
26
27
|
- **Payment and budget** — Pre-flight checks, LoC budget deduction, or Stripe checkout when additional payment is required.
|
|
27
28
|
- **Secure auth** — CLI tokens stored in the OS credential store (Windows Credential Locker, macOS Keychain, Linux Secret Service).
|
|
28
29
|
|
|
@@ -55,6 +56,8 @@ Verify:
|
|
|
55
56
|
codedd --version
|
|
56
57
|
```
|
|
57
58
|
|
|
59
|
+
On Linux, the OS credential store needs a Secret Service provider such as gnome-keyring or KWallet (typically present on desktop environments). Headless servers, containers, and CI runners generally do not; use environment variables instead of `codedd auth login` / `codedd config set-key` (see [Environment variables](#environment-variables)).
|
|
60
|
+
|
|
58
61
|
---
|
|
59
62
|
|
|
60
63
|
## Quick start (recommended workflow)
|
|
@@ -69,6 +72,8 @@ codedd auth login --token <your_token>
|
|
|
69
72
|
|
|
70
73
|
Or run `codedd auth login` and paste the token when prompted.
|
|
71
74
|
|
|
75
|
+
On headless Linux or in CI, skip login and export `CODEDD_API_TOKEN` instead (see [Environment variables](#environment-variables)).
|
|
76
|
+
|
|
72
77
|
Optional sanity check:
|
|
73
78
|
|
|
74
79
|
```bash
|
|
@@ -106,6 +111,8 @@ codedd config set-key anthropic
|
|
|
106
111
|
# or: codedd config set-key openai
|
|
107
112
|
```
|
|
108
113
|
|
|
114
|
+
Alternatively, export a provider key (`ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, `GEMINI_API_KEY`, `XAI_API_KEY`, or the `CODEDD_*` equivalents). Environment variables take precedence over the keychain.
|
|
115
|
+
|
|
109
116
|
Optional (recommended if both are configured):
|
|
110
117
|
|
|
111
118
|
```bash
|
|
@@ -127,6 +134,35 @@ The CLI will:
|
|
|
127
134
|
|
|
128
135
|
Results and recommendations are available in the CodeDD dashboard; you can also run `codedd audits list` to see status.
|
|
129
136
|
|
|
137
|
+
### 6. Fix issues (optional, after audit completes)
|
|
138
|
+
|
|
139
|
+
Once an audit has finished and remediation data is available on CodeDD, use `codedd fix` to work through flags and vulnerabilities locally:
|
|
140
|
+
|
|
141
|
+
**Group / portfolio audit** (multiple repos):
|
|
142
|
+
|
|
143
|
+
```bash
|
|
144
|
+
codedd fix status # repos ranked by severity
|
|
145
|
+
codedd fix repo my-service # scope to one repository
|
|
146
|
+
codedd fix flags next --auto # next unresolved flag (red first)
|
|
147
|
+
codedd fix resolve --comment "Fixed null check in auth handler"
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
**Single-repo audit:**
|
|
151
|
+
|
|
152
|
+
```bash
|
|
153
|
+
codedd fix fetch flags
|
|
154
|
+
codedd fix flags next --auto
|
|
155
|
+
codedd fix resolve --comment "Updated lodash to 4.17.21"
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
`codedd fix resolve` records the comment, marks the issue fixed, and prints the next one, so the remediation loop is a single command per issue. Repeat it until the output shows `QUEUE EMPTY`.
|
|
159
|
+
|
|
160
|
+
For dependency vulnerabilities, swap `flags` for `vulns` (`codedd fix fetch vulns`, `codedd fix vulns next --auto`, `codedd fix vulns affected-files <package>`).
|
|
161
|
+
|
|
162
|
+
Issue Compass saved lists from the web UI can narrow flag remediation: `codedd fix selections list`, then `codedd fix selections use <n>`.
|
|
163
|
+
|
|
164
|
+
Run `codedd ai-docs fix` for the full remediation reference (AI-agent workflows, JSON output, access controls).
|
|
165
|
+
|
|
130
166
|
---
|
|
131
167
|
|
|
132
168
|
## Workflow overview
|
|
@@ -209,6 +245,32 @@ Run: codedd audit start
|
|
|
209
245
|
| Command | Description |
|
|
210
246
|
|--------|-------------|
|
|
211
247
|
| `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; `--debug-llm-full-prompt` to include the full proprietary system prompt in that output (sensitive). |
|
|
248
|
+
| `codedd audit status` | Show pipeline step progress for an active or resumable audit. |
|
|
249
|
+
|
|
250
|
+
### Issue remediation (`codedd fix`)
|
|
251
|
+
|
|
252
|
+
Requires a completed audit with remediation data on CodeDD. Select the audit first (`codedd audits select`).
|
|
253
|
+
|
|
254
|
+
| Command | Description |
|
|
255
|
+
|--------|-------------|
|
|
256
|
+
| `codedd fix status [--json]` | Dashboard of open flags/vulns; repos ranked by severity in group audits |
|
|
257
|
+
| `codedd fix repo [name\|uuid]` | Scope fix workflow to one sub-audit (group audits) |
|
|
258
|
+
| `codedd fix fetch flags\|vulns` | Load issue overview (interactive sub-audit pick when needed) |
|
|
259
|
+
| `codedd fix flags next [--auto] [--json]` | Next unresolved flag; `--auto` prioritizes red issues |
|
|
260
|
+
| `codedd fix flags invalidate [--reason "<text>"]` | Mark current flag as invalid and advance |
|
|
261
|
+
| `codedd fix vulns next [--auto] [--severity S] [--used-only] [--json]` | Next vulnerability; `--auto` prioritizes critical |
|
|
262
|
+
| `codedd fix vulns affected-files <package> [--json]` | List local files importing a vulnerable package |
|
|
263
|
+
| `codedd fix resolve [--comment "<text>"]` | Record progress, mark resolved, and print the next issue |
|
|
264
|
+
| `codedd fix comment "<text>"` | Record progress without resolving |
|
|
265
|
+
| `codedd fix context [--json]` / `summarize` | Session snapshot for AI agents |
|
|
266
|
+
| `codedd fix selections list\|show\|use\|clear` | Issue Compass saved flag lists from the web UI |
|
|
267
|
+
| `codedd fix access status\|enable\|disable\|activate\|deactivate` | Remediation Module access (org initiator) |
|
|
268
|
+
|
|
269
|
+
Comment text can also be supplied with `--comment-file <path>` or on stdin (`codedd fix comment -`), which avoids shell quoting for multi-line or quote-heavy notes.
|
|
270
|
+
|
|
271
|
+
**Exit codes** (for scripted and AI-agent loops): `0` issue delivered or action succeeded, `1` error, `3` no unresolved issues left in the current scope. Commands that deliver an issue also print a loop protocol block — the remaining count, the exact next command, and the stop condition — on every invocation, so long remediation runs do not depend on the instruction surviving in an agent's context window.
|
|
272
|
+
|
|
273
|
+
See `codedd ai-docs fix` for detailed examples and agent integration patterns.
|
|
212
274
|
|
|
213
275
|
### Configuration
|
|
214
276
|
|
|
@@ -227,7 +289,7 @@ Run: codedd audit start
|
|
|
227
289
|
## Configuration
|
|
228
290
|
|
|
229
291
|
- **Config file:** `~/.codedd/config.toml` (TOML). Stores API URL, active audit, scope directories, LLM provider, concurrency. Permissions are restricted to the owner (Unix).
|
|
230
|
-
- **Secrets:**
|
|
292
|
+
- **Secrets:** On desktop, the CLI token and LLM API keys are stored in the system keychain (Windows Credential Locker, macOS Keychain, Linux Secret Service), not in the config file. On headless systems, supply them via environment variables; the CLI does not write secrets to disk.
|
|
231
293
|
|
|
232
294
|
Optional `[audit]` keys (defaults shown) tune how long the CLI waits after opening a payment browser flow:
|
|
233
295
|
|
|
@@ -238,14 +300,26 @@ Optional `[audit]` keys (defaults shown) tune how long the CLI waits after openi
|
|
|
238
300
|
|
|
239
301
|
| Variable | Purpose |
|
|
240
302
|
|---------|---------|
|
|
241
|
-
| `CODEDD_API_TOKEN` |
|
|
303
|
+
| `CODEDD_API_TOKEN` | CLI token (used when the OS keyring is unavailable, e.g. CI or headless Linux). Takes precedence over a stored keyring token. |
|
|
304
|
+
| `CODEDD_ANTHROPIC_API_KEY` / `ANTHROPIC_API_KEY` | Anthropic API key. `CODEDD_*` wins if both are set. |
|
|
305
|
+
| `CODEDD_OPENAI_API_KEY` / `OPENAI_API_KEY` | OpenAI API key. |
|
|
306
|
+
| `CODEDD_GEMINI_API_KEY` / `GEMINI_API_KEY` / `GOOGLE_API_KEY` | Google Gemini API key. |
|
|
307
|
+
| `CODEDD_GROK_API_KEY` / `XAI_API_KEY` / `GROK_API_KEY` | xAI Grok API key. |
|
|
308
|
+
|
|
309
|
+
Headless / CI example:
|
|
310
|
+
|
|
311
|
+
```bash
|
|
312
|
+
export CODEDD_API_TOKEN=codedd_cli_...
|
|
313
|
+
export ANTHROPIC_API_KEY=sk-ant-...
|
|
314
|
+
codedd audit start --yes
|
|
315
|
+
```
|
|
242
316
|
|
|
243
317
|
|
|
244
318
|
---
|
|
245
319
|
|
|
246
320
|
## Security
|
|
247
321
|
|
|
248
|
-
- CLI tokens and LLM keys are stored in the OS credential store, not in plaintext on disk.
|
|
322
|
+
- On desktop, CLI tokens and LLM keys are stored in the OS credential store, not in plaintext on disk. On headless Linux, containers, and CI, supply them through environment variables; the CLI does not write those secrets to disk.
|
|
249
323
|
- TLS certificate verification is always enabled for API requests.
|
|
250
324
|
- Config file and `~/.codedd` directory use owner-only permissions where supported.
|
|
251
325
|
- Tokens expire after 90 days (server-configurable); re-generate from the CodeDD dashboard when needed.
|
|
@@ -78,11 +78,14 @@ def require_auth(func: Callable) -> Callable:
|
|
|
78
78
|
Decorator that aborts a CLI command when the user is not authenticated.
|
|
79
79
|
|
|
80
80
|
Checks:
|
|
81
|
-
1.
|
|
82
|
-
|
|
83
|
-
|
|
81
|
+
1. OS keychain or ``CODEDD_API_TOKEN`` has the actual token. A prior
|
|
82
|
+
``token_hint`` in the config file is not required — headless and CI
|
|
83
|
+
environments can authenticate with the env-var alone.
|
|
84
|
+
2. Server confirms the token is still valid — result cached for
|
|
84
85
|
``TOKEN_VERIFY_CACHE_TTL_SECONDS`` to avoid a network call on every
|
|
85
86
|
rapid-fire command.
|
|
87
|
+
3. After a successful verify, a missing ``token_hint`` is hydrated from
|
|
88
|
+
the retrieved token so ``auth status`` / ``config show`` stay consistent.
|
|
86
89
|
"""
|
|
87
90
|
|
|
88
91
|
@functools.wraps(func)
|
|
@@ -90,11 +93,20 @@ def require_auth(func: Callable) -> Callable:
|
|
|
90
93
|
cfg = ConfigManager()
|
|
91
94
|
token = TokenManager.retrieve()
|
|
92
95
|
|
|
93
|
-
if not
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
96
|
+
if not token:
|
|
97
|
+
if cfg.is_authenticated:
|
|
98
|
+
console.print(
|
|
99
|
+
"[bold red]Not authenticated.[/bold red] "
|
|
100
|
+
"A session is stored but no token could be retrieved. "
|
|
101
|
+
"Set [bold cyan]CODEDD_API_TOKEN[/bold cyan] or install a keyring backend, "
|
|
102
|
+
"then retry or run [bold cyan]codedd auth login[/bold cyan]."
|
|
103
|
+
)
|
|
104
|
+
else:
|
|
105
|
+
console.print(
|
|
106
|
+
"[bold red]Not authenticated.[/bold red] "
|
|
107
|
+
"Run [bold cyan]codedd auth login[/bold cyan] first, "
|
|
108
|
+
"or set [bold cyan]CODEDD_API_TOKEN[/bold cyan]."
|
|
109
|
+
)
|
|
98
110
|
raise typer.Exit(code=1)
|
|
99
111
|
|
|
100
112
|
if not _verify_token_server_side(cfg):
|
|
@@ -104,6 +116,10 @@ def require_auth(func: Callable) -> Callable:
|
|
|
104
116
|
)
|
|
105
117
|
raise typer.Exit(code=1)
|
|
106
118
|
|
|
119
|
+
if not cfg.token_hint:
|
|
120
|
+
cfg.token_hint = TokenManager.token_hint(token)
|
|
121
|
+
cfg.save()
|
|
122
|
+
|
|
107
123
|
return func(*args, **kwargs)
|
|
108
124
|
|
|
109
125
|
return wrapper
|
|
@@ -224,9 +224,12 @@ def show_ai_docs(ctx: typer.Context = None) -> None:
|
|
|
224
224
|
Workflow Pattern:
|
|
225
225
|
1. Fetch overview (codedd fix fetch {flags|vulns})
|
|
226
226
|
2. Get next issue (codedd fix {flags|vulns} next [OPTIONS])
|
|
227
|
-
3.
|
|
228
|
-
|
|
229
|
-
|
|
227
|
+
3. Apply the fix, then record and advance in one call
|
|
228
|
+
(codedd fix resolve --comment \"what changed and why\")
|
|
229
|
+
4. Repeat step 3 until the output shows QUEUE EMPTY (exit code 3)
|
|
230
|
+
|
|
231
|
+
Every issue-bearing command reprints the loop protocol, so the contract
|
|
232
|
+
does not need to be remembered from earlier in the conversation.
|
|
230
233
|
""").strip(),
|
|
231
234
|
)
|
|
232
235
|
|
|
@@ -566,20 +569,51 @@ def show_ai_docs(ctx: typer.Context = None) -> None:
|
|
|
566
569
|
# RESOLVE ISSUE
|
|
567
570
|
# =========================================================================
|
|
568
571
|
_subsection(
|
|
569
|
-
"Step 4: Mark Issue Resolved",
|
|
570
|
-
"
|
|
572
|
+
"Step 4: Mark Issue Resolved (the one command per issue)",
|
|
573
|
+
"Records the comment, resolves, and prints the next issue in one call.",
|
|
571
574
|
)
|
|
572
575
|
|
|
573
576
|
_code_block(
|
|
574
|
-
"
|
|
575
|
-
|
|
577
|
+
"Preferred form -- comment and resolve together:",
|
|
578
|
+
'codedd fix resolve --comment "parameterised the user lookup query"',
|
|
579
|
+
)
|
|
580
|
+
_code_block(
|
|
581
|
+
"Comment from a file (no shell quoting):",
|
|
582
|
+
"codedd fix resolve --comment-file note.txt",
|
|
576
583
|
)
|
|
577
584
|
_code_block("Resolve with explicit type:", "codedd fix resolve --issue-type vulns")
|
|
585
|
+
_code_block("Resolve without advancing the queue:", "codedd fix resolve --no-next")
|
|
578
586
|
|
|
579
587
|
console.print("[bold]Command Format:[/bold]")
|
|
580
588
|
console.print(" codedd fix resolve [OPTIONS]")
|
|
581
589
|
|
|
582
590
|
console.print("\n[bold]Options:[/bold]")
|
|
591
|
+
_table_item(
|
|
592
|
+
"--comment, -m TEXT",
|
|
593
|
+
"Record what changed before resolving. Removes the need for a separate "
|
|
594
|
+
"'codedd fix comment' call.",
|
|
595
|
+
2,
|
|
596
|
+
)
|
|
597
|
+
_table_item(
|
|
598
|
+
"--comment-file PATH",
|
|
599
|
+
"Read the comment from a file. Use for multi-line or quote-heavy text.",
|
|
600
|
+
2,
|
|
601
|
+
)
|
|
602
|
+
_table_item(
|
|
603
|
+
"--issue-uuid UUID",
|
|
604
|
+
"Safety check: abort unless this matches the last issue delivered by 'next'.",
|
|
605
|
+
2,
|
|
606
|
+
)
|
|
607
|
+
_table_item(
|
|
608
|
+
"--next / --no-next",
|
|
609
|
+
"Fetch and print the next issue after resolving (default: --next).",
|
|
610
|
+
2,
|
|
611
|
+
)
|
|
612
|
+
_table_item(
|
|
613
|
+
"--json",
|
|
614
|
+
"Machine-readable output including the next issue and the loop protocol.",
|
|
615
|
+
2,
|
|
616
|
+
)
|
|
583
617
|
_table_item(
|
|
584
618
|
"--issue-type {flags|vulns}",
|
|
585
619
|
"Explicitly specify session type (auto-detected if omitted). Shorthand: -t flags",
|
|
@@ -591,9 +625,9 @@ def show_ai_docs(ctx: typer.Context = None) -> None:
|
|
|
591
625
|
textwrap.dedent("""
|
|
592
626
|
- Sets is_resolved=true on current_issue
|
|
593
627
|
- Increments resolved_issues counter
|
|
594
|
-
-
|
|
595
|
-
-
|
|
596
|
-
|
|
628
|
+
- Advances queue_position and prints the next unresolved issue
|
|
629
|
+
- The advance uses a dedicated next-call, because the resolve response
|
|
630
|
+
can echo back the issue that was just closed
|
|
597
631
|
- For flags: forwards Issue Compass selection id and applies the same
|
|
598
632
|
saved-list filter when computing progress and the next issue (progress
|
|
599
633
|
stays scoped to the selection, e.g. 1/42 not 1/171)
|
|
@@ -602,7 +636,10 @@ def show_ai_docs(ctx: typer.Context = None) -> None:
|
|
|
602
636
|
- Confirmation of resolved issue UUID
|
|
603
637
|
- Next issue block (same rendering as 'fix {flags|vulns} next')
|
|
604
638
|
- Updated progress (resolved M/total, pending P)
|
|
605
|
-
-
|
|
639
|
+
- The loop protocol block, reprinted on every call
|
|
640
|
+
|
|
641
|
+
Exit codes: 0 = resolved and next issue delivered, 1 = error,
|
|
642
|
+
3 = resolved and the queue is now empty.
|
|
606
643
|
""").strip()
|
|
607
644
|
)
|
|
608
645
|
|
|
@@ -713,18 +750,21 @@ def show_ai_docs(ctx: typer.Context = None) -> None:
|
|
|
713
750
|
)
|
|
714
751
|
|
|
715
752
|
_subsection(
|
|
716
|
-
"Workflow 2: Remediate Security Flags (
|
|
717
|
-
"
|
|
753
|
+
"Workflow 2: Remediate Security Flags (the remediation loop)",
|
|
754
|
+
"One command per issue. Repeat until the queue reports QUEUE EMPTY.",
|
|
718
755
|
)
|
|
719
756
|
console.print(
|
|
720
757
|
textwrap.dedent("""
|
|
721
758
|
codedd fix fetch flags
|
|
722
|
-
codedd fix flags next
|
|
723
|
-
# ...
|
|
724
|
-
codedd fix comment "
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
759
|
+
codedd fix flags next --auto # Load the highest-priority flag
|
|
760
|
+
# ... apply the fix ...
|
|
761
|
+
codedd fix resolve --comment "parameterised the user lookup query"
|
|
762
|
+
# -> records the comment, resolves, and prints the NEXT issue
|
|
763
|
+
# ... apply the next fix, then run resolve again ...
|
|
764
|
+
|
|
765
|
+
# Repeat until the output shows QUEUE EMPTY (exit code 3).
|
|
766
|
+
# Every resolve reprints the loop protocol, so the contract stays in
|
|
767
|
+
# context even after many issues. Do not wait to be told to continue.
|
|
728
768
|
""").strip()
|
|
729
769
|
)
|
|
730
770
|
|
|
@@ -738,8 +778,7 @@ def show_ai_docs(ctx: typer.Context = None) -> None:
|
|
|
738
778
|
codedd fix vulns next --auto # Critical first
|
|
739
779
|
codedd fix vulns affected-files lodash # See which files import it
|
|
740
780
|
# ... developer updates package version ...
|
|
741
|
-
codedd fix comment "Updated lodash to 4.17.21"
|
|
742
|
-
codedd fix resolve # Move to next critical
|
|
781
|
+
codedd fix resolve --comment "Updated lodash to 4.17.21"
|
|
743
782
|
""").strip()
|
|
744
783
|
)
|
|
745
784
|
|
|
@@ -804,9 +843,8 @@ def show_ai_docs(ctx: typer.Context = None) -> None:
|
|
|
804
843
|
codedd fix fetch flags
|
|
805
844
|
codedd fix flags next --auto
|
|
806
845
|
# Review flag, determine it's a false positive
|
|
807
|
-
codedd fix flags invalidate
|
|
808
|
-
|
|
809
|
-
codedd fix flags next # Load next valid one
|
|
846
|
+
codedd fix flags invalidate --reason "value is a compile-time constant"
|
|
847
|
+
# -> marks invalid and prints the next issue (same shape as resolve)
|
|
810
848
|
""").strip()
|
|
811
849
|
)
|
|
812
850
|
|
|
@@ -843,6 +881,57 @@ def show_ai_docs(ctx: typer.Context = None) -> None:
|
|
|
843
881
|
""").strip()
|
|
844
882
|
)
|
|
845
883
|
|
|
884
|
+
_subsection(
|
|
885
|
+
"Workflow 10: Unattended loop (shell / CI)",
|
|
886
|
+
"Exit code 3 is the stop condition, so the loop needs no issue counting.",
|
|
887
|
+
)
|
|
888
|
+
console.print(
|
|
889
|
+
textwrap.dedent("""
|
|
890
|
+
# Bash
|
|
891
|
+
codedd fix flags next --auto --json > issue.json
|
|
892
|
+
while [ $? -eq 0 ]; do
|
|
893
|
+
# ... apply the fix described in issue.json ...
|
|
894
|
+
codedd fix resolve --comment-file note.txt --json > issue.json
|
|
895
|
+
done
|
|
896
|
+
# Loop ends when a command exits 3 (queue empty); exit 1 means a real error.
|
|
897
|
+
|
|
898
|
+
# PowerShell
|
|
899
|
+
codedd fix flags next --auto --json | Set-Content issue.json
|
|
900
|
+
while ($LASTEXITCODE -eq 0) {
|
|
901
|
+
# ... apply the fix ...
|
|
902
|
+
codedd fix resolve --comment-file note.txt --json | Set-Content issue.json
|
|
903
|
+
}
|
|
904
|
+
""").strip()
|
|
905
|
+
)
|
|
906
|
+
|
|
907
|
+
_subsection(
|
|
908
|
+
"The loop protocol block",
|
|
909
|
+
"Re-emitted by every issue-bearing command; also in --json as 'protocol'.",
|
|
910
|
+
)
|
|
911
|
+
console.print(
|
|
912
|
+
textwrap.dedent("""
|
|
913
|
+
A remediation queue can hold thousands of issues, far more than fits in
|
|
914
|
+
one context window. Rather than relying on the operator's opening
|
|
915
|
+
instruction surviving hundreds of file reads, every command that
|
|
916
|
+
delivers or advances an issue reprints the loop contract:
|
|
917
|
+
|
|
918
|
+
- loop ordered steps, each with the literal command to run
|
|
919
|
+
- pending_issues how many issues remain in the current scope
|
|
920
|
+
- queue_empty true once the scope is exhausted
|
|
921
|
+
- stop_condition the QUEUE EMPTY marker and exit code 3
|
|
922
|
+
- autonomy do not pause to ask whether to continue
|
|
923
|
+
- recovery 'codedd fix context' rehydrates a lost session
|
|
924
|
+
|
|
925
|
+
Agents should read the protocol block from the most recent command
|
|
926
|
+
output rather than from earlier conversation history.
|
|
927
|
+
|
|
928
|
+
Exit codes:
|
|
929
|
+
0 issue delivered / action succeeded
|
|
930
|
+
1 error (auth, network, validation, server rejection)
|
|
931
|
+
3 no unresolved issues left in this scope
|
|
932
|
+
""").strip()
|
|
933
|
+
)
|
|
934
|
+
|
|
846
935
|
# =========================================================================
|
|
847
936
|
# PART 6: DATA STRUCTURES AND RESPONSE FORMATS
|
|
848
937
|
# =========================================================================
|
|
@@ -1037,22 +1126,31 @@ def show_ai_docs(ctx: typer.Context = None) -> None:
|
|
|
1037
1126
|
console.print(" codedd fix fetch vulns [--sub-audit-uuid UUID | --sub-audit-index INT]")
|
|
1038
1127
|
|
|
1039
1128
|
console.print("\n[bold]Fix Workflow - Progress (Flags)[/bold]")
|
|
1040
|
-
console.print(" codedd fix flags next [--auto] [--sub-audit-uuid UUID]")
|
|
1041
|
-
console.print(
|
|
1129
|
+
console.print(" codedd fix flags next [--auto] [--sub-audit-uuid UUID] [--json]")
|
|
1130
|
+
console.print(' codedd fix flags invalidate [--reason "TEXT" | --reason-file PATH] [--json]')
|
|
1042
1131
|
|
|
1043
1132
|
console.print("\n[bold]Fix Workflow - Progress (Vulnerabilities)[/bold]")
|
|
1044
1133
|
console.print(
|
|
1045
|
-
" codedd fix vulns next [--auto] [--severity SEVERITY] [--used-only]
|
|
1134
|
+
" codedd fix vulns next [--auto] [--severity SEVERITY] [--used-only] "
|
|
1135
|
+
"[--sub-audit-uuid UUID] [--json]"
|
|
1046
1136
|
)
|
|
1047
|
-
console.print(" codedd fix vulns affected-files PACKAGE_NAME")
|
|
1137
|
+
console.print(" codedd fix vulns affected-files PACKAGE_NAME [--json]")
|
|
1048
1138
|
|
|
1049
1139
|
console.print("\n[bold]Fix Workflow - Common Operations[/bold]")
|
|
1050
|
-
console.print(
|
|
1051
|
-
|
|
1052
|
-
|
|
1140
|
+
console.print(
|
|
1141
|
+
' codedd fix resolve [--comment "TEXT" | --comment-file PATH] '
|
|
1142
|
+
"[--no-next] [--issue-type {flags|vulns}] [--json]"
|
|
1143
|
+
)
|
|
1144
|
+
console.print(' codedd fix comment "TEXT" | --comment-file PATH | - [--issue-type {flags|vulns}] [--json]')
|
|
1145
|
+
console.print(" codedd fix status [--json]")
|
|
1053
1146
|
console.print(" codedd fix context [--json]")
|
|
1054
1147
|
console.print(" codedd fix summarize")
|
|
1055
1148
|
|
|
1149
|
+
console.print("\n[bold]Exit Codes[/bold]")
|
|
1150
|
+
console.print(" 0 issue delivered / action succeeded")
|
|
1151
|
+
console.print(" 1 error")
|
|
1152
|
+
console.print(" 3 no unresolved issues left in this scope (QUEUE EMPTY)")
|
|
1153
|
+
|
|
1056
1154
|
console.print("\n[bold]Issue Compass Selections[/bold]")
|
|
1057
1155
|
console.print(" codedd fix selections list")
|
|
1058
1156
|
console.print(" codedd fix selections show <n>")
|
|
@@ -1195,7 +1195,11 @@ def _check_llm_keys(cfg: ConfigManager) -> bool:
|
|
|
1195
1195
|
print_error(
|
|
1196
1196
|
"No LLM API keys configured.\n"
|
|
1197
1197
|
" CodeDD uses LLMs (Anthropic, OpenAI, Gemini, or Grok) to run the source code audit.\n"
|
|
1198
|
-
" Add an API key with [bold cyan]codedd config set-key[/bold cyan]
|
|
1198
|
+
" Add an API key with [bold cyan]codedd config set-key[/bold cyan], "
|
|
1199
|
+
"or set an environment variable "
|
|
1200
|
+
"([bold]ANTHROPIC_API_KEY[/bold], [bold]OPENAI_API_KEY[/bold], "
|
|
1201
|
+
"[bold]GEMINI_API_KEY[/bold], [bold]XAI_API_KEY[/bold], "
|
|
1202
|
+
"or the [bold]CODEDD_*[/bold] equivalents).",
|
|
1199
1203
|
escape_content=False,
|
|
1200
1204
|
)
|
|
1201
1205
|
return False
|