|
| 1 | +# CodeAnt findings CLI |
| 2 | + |
| 3 | +`codeant findings` is the unified, read-only entry point for findings visible in the CodeAnt app. It reuses the same authenticated backend endpoints and authorization checks as the UI. |
| 4 | + |
| 5 | +```bash |
| 6 | +codeant login |
| 7 | +codeant scans orgs |
| 8 | +codeant findings --help |
| 9 | +``` |
| 10 | + |
| 11 | +When one login has multiple connections, pass the exact `--org` and `--service` values returned by `codeant scans orgs`. A self-hosted provider base URL is discovered from the selected connection; use `--provider-base-url` only as an explicit override. |
| 12 | + |
| 13 | +## Coverage |
| 14 | + |
| 15 | +| App data | CLI command | Scope | |
| 16 | +|---|---|---| |
| 17 | +| Repository list | `codeant findings repos` | organization | |
| 18 | +| SAST, SCA, IaC, Secrets, SBOM | `codeant findings repo` | repository + scan/branch | |
| 19 | +| Anti-patterns, dead code, docstrings, complex functions | `codeant findings repo` | repository + scan/branch | |
| 20 | +| Prioritized SAST/SCA/IaC/Secrets/Infrastructure/AI Exploitation | `codeant findings list/get` | organization Hotlist | |
| 21 | +| Anti-patterns across repositories | `codeant findings antipatterns` | selected repos or organization | |
| 22 | +| AWS/Azure/GCP CSPM, VM, and container findings | `codeant findings cloud history/list/get` | organization + cloud resource scope | |
| 23 | +| Pentest engagements, issues, reports | `codeant findings pentest history/issues/report` | organization + engagement | |
| 24 | + |
| 25 | +The existing `codeant scans repos`, `codeant scans results`, and `codeant hotlist list/get` commands remain supported. The unified commands are aliases or thin authenticated clients, so existing scripts do not need to migrate. |
| 26 | + |
| 27 | +## Repository list and repo-level findings |
| 28 | + |
| 29 | +```bash |
| 30 | +# List connected repositories |
| 31 | +codeant findings repos --org CodeAnt-AI |
| 32 | + |
| 33 | +# Latest scan, all supported finding types |
| 34 | +codeant findings repo --repo CodeAnt-AI/example --types all |
| 35 | + |
| 36 | +# Selected categories and severities |
| 37 | +codeant findings repo \ |
| 38 | + --repo CodeAnt-AI/example \ |
| 39 | + --branch main \ |
| 40 | + --types sast,sca,iac,anti_patterns \ |
| 41 | + --severity critical,high |
| 42 | + |
| 43 | +# A specific scan, formatted for another tool |
| 44 | +codeant findings repo \ |
| 45 | + --repo CodeAnt-AI/example \ |
| 46 | + --scan 0123456789abcdef \ |
| 47 | + --types sast,secrets \ |
| 48 | + --format sarif \ |
| 49 | + --output codeant.sarif |
| 50 | +``` |
| 51 | + |
| 52 | +Supported repo types are `sast`, `sca`, `secrets`, `iac`, `dead_code`, `sbom`, `anti_patterns`, `docstring`, and `complex_functions`. Use `--types all` for all of them. Formats are `json`, `sarif`, `csv`, `md`, and `table`; JSON is the default. |
| 53 | + |
| 54 | +Use `--filter-dismissed` to exclude dismissed findings and `--no-false-positives` to exclude false positives. `--path`, `--check`, `--limit`, and `--offset` support agent-friendly filtering and pagination. |
| 55 | + |
| 56 | +## Organization Hotlist findings |
| 57 | + |
| 58 | +`findings list/get` exposes the same stable IDs, prioritization, filters, and cursor pagination as the app Hotlist. |
| 59 | + |
| 60 | +```bash |
| 61 | +codeant findings list --org CodeAnt-AI --service github --severity critical,high |
| 62 | +codeant findings list --type SCA,IaC --location CodeAnt-AI/example --all |
| 63 | +codeant findings get 0123456789abcdef0123456789abcdef --org CodeAnt-AI --service github |
| 64 | +``` |
| 65 | + |
| 66 | +Hotlist types are `SAST`, `SCA`, `Secrets`, `IaC`, `Infrastructure`, and `AI Exploitation`. The last two cover prioritized cloud-security and pentest findings. Use the dedicated cloud and pentest commands below when complete scan/engagement data is required. |
| 67 | + |
| 68 | +## Organization anti-patterns |
| 69 | + |
| 70 | +```bash |
| 71 | +# Every repository in the selected organization |
| 72 | +codeant findings antipatterns --org CodeAnt-AI --service github |
| 73 | + |
| 74 | +# Only selected repositories |
| 75 | +codeant findings antipatterns \ |
| 76 | + --org CodeAnt-AI --service github \ |
| 77 | + --repos CodeAnt-AI/api,CodeAnt-AI/web |
| 78 | +``` |
| 79 | + |
| 80 | +When `--repos` is omitted, the CLI first lists the organization's repositories and sends all of them to the same aggregate anti-pattern endpoint used by the Quality Report UI. |
| 81 | + |
| 82 | +## Cloud security findings |
| 83 | + |
| 84 | +Cloud findings are organization/account scoped rather than repository scoped. |
| 85 | + |
| 86 | +```bash |
| 87 | +# History across AWS, Azure, and GCP |
| 88 | +codeant findings cloud history --org CodeAnt-AI --service github |
| 89 | + |
| 90 | +# Latest scan per provider |
| 91 | +codeant findings cloud history --provider all --latest |
| 92 | + |
| 93 | +# VM and container vulnerability scan histories |
| 94 | +codeant findings cloud history --provider all --kind vm |
| 95 | +codeant findings cloud history --provider all --kind container |
| 96 | + |
| 97 | +# AWS findings and one full detail record |
| 98 | +codeant findings cloud list --provider aws --scan-id <scan-id> --account-id <account-id> |
| 99 | +codeant findings cloud get --provider aws --scan-id <scan-id> --uid <finding-uid> --cloud-service iam |
| 100 | + |
| 101 | +# VM and container vulnerabilities use the same list/detail flow |
| 102 | +codeant findings cloud list --provider aws --kind vm --scan-id <scan-id> |
| 103 | +codeant findings cloud get --provider gcp --kind container --scan-id <scan-id> --uid <finding-uid> |
| 104 | + |
| 105 | +# Azure requires the tenant ID |
| 106 | +codeant findings cloud list \ |
| 107 | + --provider azure --tenant-id <tenant-id> --scan-id <scan-id> \ |
| 108 | + --severity high --subscription-id <subscription-id> |
| 109 | + |
| 110 | +# GCP requires the project ID |
| 111 | +codeant findings cloud list \ |
| 112 | + --provider gcp --project-id <project-id> --scan-id <scan-id> \ |
| 113 | + --framework cis |
| 114 | +``` |
| 115 | + |
| 116 | +`--kind` defaults to `cspm`; use `vm` or `container` for the other Cloud Security result views. CSPM `cloud list` supports `--cloud-service`, `--severity`, `--status`, `--framework`, and `--min-days-unused`. AWS additionally supports `--exploit-attempted-only`; Azure additionally supports `--subscription-id`. CSPM responses include `findings` and `dismissed_findings`; VM/container responses preserve their UI result payload unchanged. |
| 117 | + |
| 118 | +## Pentest findings |
| 119 | + |
| 120 | +```bash |
| 121 | +# Discover engagement IDs |
| 122 | +codeant findings pentest history --org CodeAnt-AI --service github |
| 123 | + |
| 124 | +# All available open issues for an engagement |
| 125 | +codeant findings pentest issues --report-id <report-id> |
| 126 | + |
| 127 | +# Full customer report |
| 128 | +codeant findings pentest report --report-id <report-id> |
| 129 | + |
| 130 | +# Test-environment variant |
| 131 | +codeant findings pentest issues --report-id <report-id> --variant test |
| 132 | +codeant findings pentest report --report-id <report-id> --variant test |
| 133 | +``` |
| 134 | + |
| 135 | +`--variant prod` is the default. Pentest entitlements and critical/high redaction are enforced by the backend exactly as they are in the UI; the CLI does not bypass locked content. |
| 136 | + |
| 137 | +## Agent/MCP tools |
| 138 | + |
| 139 | +Agents can use these read-only MCP tools: |
| 140 | + |
| 141 | +| Tool | Purpose | |
| 142 | +|---|---| |
| 143 | +| `codeant_scans_repos` | List repositories. | |
| 144 | +| `codeant_scans_results` | Fetch repo-level SAST/SCA/IaC/Secrets/quality findings. | |
| 145 | +| `codeant_hotlist_list`, `codeant_hotlist_get` | Query prioritized org-wide findings and stable IDs. | |
| 146 | +| `codeant_findings_antipatterns` | Fetch selected or all-repo anti-pattern findings. | |
| 147 | +| `codeant_cloud_scan_history` | Discover AWS/Azure/GCP scan IDs and scopes. | |
| 148 | +| `codeant_cloud_findings_list`, `codeant_cloud_finding_get` | List cloud findings and retrieve full detail. | |
| 149 | +| `codeant_pentest_history`, `codeant_pentest_issues`, `codeant_pentest_report` | Discover and inspect pentest engagements. | |
| 150 | + |
| 151 | +All these tools are available in the default read-only MCP mode. A typical agent flow is discovery (`orgs` -> `repos`, cloud history, or pentest history), list/filter findings, then retrieve one detailed finding or report. |
| 152 | + |
| 153 | +## Errors and access |
| 154 | + |
| 155 | +| Error | Resolution | |
| 156 | +|---|---| |
| 157 | +| No or multiple matching organizations | Run `codeant scans orgs`; pass exact `--org` and `--service`. | |
| 158 | +| Access denied (403) | Run `codeant logout`, then `codeant login`. Older CLI keys must be refreshed once. | |
| 159 | +| Missing Azure/GCP scope | Pass `--tenant-id` for Azure or `--project-id` for GCP. | |
| 160 | +| Report or scan not found | Use the corresponding history command and verify the selected tenant/provider. | |
| 161 | +| Redacted pentest fields | Unlock the engagement in the app; CLI access follows the same entitlement. | |
| 162 | + |
| 163 | +For current authentication, finding coverage, and agent guidance, see the [CodeAnt findings documentation](https://docs.codeant.ai/cli/findings). |
0 commit comments