codegate scan [target] runs the multi-layer analysis pipeline against a target and reports findings. Layers 1 and 2 are offline-first and deterministic. Layer 3 deep scan is opt-in with --deep.
Layers 1 and 2 never make network calls. The scan target is inspected locally against the static knowledge base. Layer 3 (
--deep) is the only mode that may fetch remote metadata or invoke a local AI agent.Scan targets
The[target] argument accepts:
- Directory — scans all discovered AI tool config files under the directory (default:
.) - File — scans a single config file directly
- URL — clones or fetches the remote resource and scans the result; use
--skillto select a single skill from a multi-skill index repo
Flags
boolean
default:"false"
Enable Layer 3 dynamic analysis. Discovers eligible external resources and local instruction files, prompts for per-resource consent, and optionally invokes a local AI meta-agent (Claude Code, Codex CLI, or OpenCode) for deeper inspection. No network calls are made without explicit consent.
boolean
default:"false"
Enter remediation mode after the scan completes. Guides you through available fixes interactively. Backups are written to
.codegate-backup/ before any file is modified.boolean
default:"false"
Automatically apply fixes for unambiguous critical findings without interactive prompts. Use with
--dry-run to preview what would change.boolean
default:"false"
Show proposed remediation changes without writing anything to disk.
boolean
default:"false"
Generate patch-style output for proposed fixes, suitable for review workflows.
boolean
default:"false"
Disable the TUI dashboard and interactive prompts. Use this flag in CI or when piping output.
string
default:"terminal"
Output format. Valid values:
terminal, json, sarif, markdown, html.sarif output is designed for GitHub Code Scanning and other security tooling.string
Write the report to a file path instead of stdout.
boolean
default:"false"
Show extended output in
terminal format. Has no effect on other output formats.string
Path to a specific global config file. Overrides the default
~/.codegate/config.json location.boolean
default:"false"
Skip interactive confirmations, including deep scan consent prompts and remediation consent. In non-interactive or CI environments, deep scan actions are skipped unless
--force is provided.boolean
default:"false"
Force-include user/home AI tool config paths for this run. Useful when the config file has
scan_user_scope: false but you want a one-off full scan.string
Collection scope mode. Valid values:
default, project, user, explicit, all. The flag is repeatable to combine modes.string
Restrict collection to specific artifact kinds. Valid values:
workflows, actions, dependabot. The flag is repeatable.boolean
default:"false"
Treat parse failures in collected inputs as high-severity findings instead of warnings.
string
default:"regular"
Audit sensitivity level. Valid values:
regular, pedantic, auditor.string
default:"offline"
Runtime mode for optional online audits. Valid values:
offline, online, online-no-audits.boolean
default:"false"
Enable the CI/CD audit pack for GitHub Actions workflows, actions, and Dependabot inputs. Checks include unpinned action references, high-risk triggers, overly broad permissions, template expression injection, and known vulnerable action references (online mode only).
string
Select one skill directory when scanning a skills-index repo URL that contains multiple skills.
boolean
default:"false"
Clear the persisted scan-state baseline file (
~/.codegate/scan-state.json) and exit immediately. Use this to reset rug-pull detection history.