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
Copy file name to clipboardExpand all lines: docs/cli-reference.md
+28-6Lines changed: 28 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -53,18 +53,26 @@ Pre-configured workflow files are in [`../workflows/`](../workflows/).
53
53
54
54
> **Note:** If you're looking to associate a scan with a named Socket workspace (e.g. because your repo is identified as `org/repo`), see the [`--workspace` flag](#repository) instead. The `--workspace-name` flag described in this section is an unrelated monorepo feature.
55
55
56
-
The Socket CLI supports scanning specific workspaces within monorepo structures while preserving git context from the repository root. This is useful for organizations that maintain multiple applications or services in a single repository.
56
+
The Socket CLI supports scanning selected directories within a monorepo while preserving git context from the repository root. Scan scope is controlled by `--target-path` and `--sub-path`; CI workflow path filters and the CLI's changed-file detection do not narrow the manifests uploaded after a scan starts.
57
57
58
58
### Key Features
59
59
60
-
-**Multiple Sub-paths**: Specify multiple `--sub-path`options to scan different directories within your monorepo
61
-
-**Combined Workspace**: All sub-paths are scanned together as a single workspace in Socket
60
+
-**Target path**: Supplies repository/Git context and is the discovery root when no `--sub-path`is present
61
+
-**Multiple Sub-paths**: Restrict discovery to those directories, but combine every repeated `--sub-path` into one upload and one server-side dependency graph
62
62
-**Git Context Preserved**: Repository metadata (commits, branches, etc.) comes from the main target-path
63
-
-**Workspace Naming**: Use `--workspace-name` to differentiate scans from different parts of your monorepo
63
+
-**Workspace Naming**: Use a stable, unique `--workspace-name` for each independently scanned logical workspace; it suffixes the repository slug and therefore gives that workspace its own repository head/baseline
64
+
65
+
`--workspace` is different: it sends Socket organization workspace context with the full-scan API request. It does not narrow client-side filesystem discovery, split the upload into independent scans, or change the repository suffix. Backend policy/routing for that workspace remains server-owned.
66
+
67
+
> **Performance consequence:** If the goal is smaller independently resolvable graphs, run one CLI invocation per logical workspace, with a distinct `--workspace-name`. Adding several unrelated directories to one command with repeated `--sub-path` flags still asks the backend to resolve one combined graph.
68
+
69
+
Normal scan logs include the effective repository and Socket workspace context,
70
+
repository-relative discovery roots, aggregate manifest count, and selected baseline.
71
+
Individual manifest paths remain opt-in through `--save-submitted-files-list`.
64
72
65
73
### Usage Examples
66
74
67
-
**Scan multiple frontend and backend workspaces:**
75
+
**Scan several directories that belong to one logical application:**
68
76
```bash
69
77
socketcli --target-path /path/to/monorepo \
70
78
--sub-path frontend \
@@ -89,6 +97,19 @@ This will:
89
97
- Create a repository in Socket named like `my-repo-mobile-web`
90
98
- Preserve git context (commits, branch info) from the repository root
91
99
100
+
**Create independent frontend and backend scans:**
101
+
```bash
102
+
socketcli --target-path /path/to/monorepo \
103
+
--sub-path frontend \
104
+
--workspace-name frontend
105
+
106
+
socketcli --target-path /path/to/monorepo \
107
+
--sub-path backend \
108
+
--workspace-name backend
109
+
```
110
+
111
+
These are two full-scan uploads, two server-side graphs, and two repository head/baseline sequences. In CI they can run as separate matrix jobs. See [GitHub Actions: scan changed monorepo workspaces independently](ci-cd.md#github-actions-scan-changed-monorepo-workspaces-independently).
112
+
92
113
**Generate GitLab Security Dashboard report:**
93
114
```bash
94
115
socketcli --enable-gitlab-security \
@@ -138,6 +159,7 @@ This will simultaneously generate:
138
159
139
160
- Both `--sub-path` and `--workspace-name` must be specified together
140
161
-`--sub-path` can be used multiple times to include multiple directories
162
+
- Repeated `--sub-path` values are combined into one scan; they do not create independent workspace scans
141
163
- All specified sub-paths must exist within the target-path
142
164
143
165
## Usage
@@ -373,7 +395,7 @@ The launcher can be tuned via the `SOCKET_CLI_COANA_LAUNCHER` environment variab
373
395
|`--strict-blocking`| False | False | Fail on ANY security policy violations (blocking severity), not just new ones. Only works in diff mode. See [Strict Blocking Mode](#strict-blocking-mode) for details. |
374
396
|`--enable-diff`| False | False | Enable diff mode even when using `--integration api` (forces diff mode without SCM integration) |
375
397
|`--scm`| False | api | Source control management type|
376
-
|`--timeout`| False || Timeout in seconds for API requests |
398
+
|`--timeout`| False |1200| Timeout in seconds foreach API request. This is not a total CLI runtime limit and does not limit local discovery, Git, or reachability analysis.|
0 commit comments