You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 667e81c
Browse filesBrowse the repository at this point in the historyBrowse files
@@ -798,12 +799,12 @@ The Cycode CLI application offers several types of scans so that you can choose
798
799
|`--maven-settings-file`| For Maven only, allows using a custom [settings.xml](https://maven.apache.org/settings.html) file when scanning for dependencies |
|`-b, --base-ref TEXT`| Git ref (commit, branch, or tag) to diff against; defaults to `HEAD`, matching the pre-commit hook behavior |
1094
+
|`--include-unstaged`| Also scan unstaged changes to tracked files, not just what is staged; off by default |
1095
+
|`--path PATH`| Optional path(s) to scope the diff scan to; repeatable; defaults to the entire working directory |
1096
+
1097
+
#### Local Diff Scanning (IDE Integrations)
1098
+
1099
+
`--base-ref` and `--include-unstaged` turn `pre-commit` into a general-purpose **local diff scan**: comparing any commit (default `HEAD`) against your current working directory — including edits that aren't staged yet. This is intended for IDE plugins and other tools that need continuous, real-time feedback as you work, rather than the git hook flow. Combined with `--include-unstaged`, `--path` lets an IDE scope the scan to just the file currently open in the editor.
1100
+
1101
+
> [!NOTE]
1102
+
> Local diff scanning (via these flags) is not available for IaC scans.
1103
+
1104
+
**Scan everything currently changed (staged + unstaged) against the last commit:**
1105
+
```bash
1106
+
cycode scan pre-commit --include-unstaged
1107
+
```
1108
+
1109
+
**Scan changes against a specific commit or branch:**
1110
+
```bash
1111
+
cycode scan pre-commit --include-unstaged --base-ref main
1112
+
```
1113
+
1114
+
**Scan only a specific file (e.g., the file currently open in your IDE):**
A pre-push scan automatically identifies any issues before you push changes to the remote repository. This hook runs on the client side and scans only the commits that are about to be pushed, making it efficient for catching issues before they reach the remote repository.
0 commit comments