Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).

## [1.1.142](https://github.com/SocketDev/socket-cli/releases/tag/v1.1.142) - 2026-07-10

### Added
- The `socket manifest` commands (`auto`, `gradle`, `kotlin`, `maven`, `scala`) now accept `--exclude-paths`, keeping excluded subprojects and their dependencies out of generated manifests.

### Fixed
- `--exclude-paths` is now fully honored across JVM, .NET, and Rust reachability analysis: excluded directories no longer contribute dependencies, code, or framework resources to scan results. Includes an update of the Coana CLI to v `15.8.7`.
- Invalid `--exclude-paths` glob patterns are rejected with a clear error instead of failing mid-scan.

## [1.1.141](https://github.com/SocketDev/socket-cli/releases/tag/v1.1.141) - 2026-07-10

### Changed
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "socket",
"version": "1.1.141",
"version": "1.1.142",
"description": "CLI for Socket.dev",
"homepage": "https://github.com/SocketDev/socket-cli",
"license": "MIT",
Expand Down Expand Up @@ -97,7 +97,7 @@
"@babel/preset-typescript": "7.27.1",
"@babel/runtime": "7.28.4",
"@biomejs/biome": "2.2.4",
"@coana-tech/cli": "15.8.6",
"@coana-tech/cli": "15.8.7",
"@cyclonedx/cdxgen": "12.1.2",
"@dotenvx/dotenvx": "1.49.0",
"@eslint/compat": "1.3.2",
Expand Down
10 changes: 5 additions & 5 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions src/commands/manifest/cmd-manifest-auto.mts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@ import { detectManifestActions } from './detect-manifest-actions.mts'
import { generateAutoManifest } from './generate_auto_manifest.mts'
import constants from '../../constants.mts'
import { commonFlags } from '../../flags.mts'
import { cmdFlagValueToArray } from '../../utils/cmd.mts'
import { getOutputKind } from '../../utils/get-output-kind.mts'
import { meowOrExit } from '../../utils/meow-with-subcommands.mts'
import { getFlagListOutput } from '../../utils/output-formatting.mts'
import { readOrDefaultSocketJson } from '../../utils/socket-json.mts'
import { assertValidExcludePaths } from '../scan/exclude-paths.mts'
import { excludePathsFlag } from '../scan/reachability-flags.mts'

import type {
CliCommandConfig,
Expand All @@ -23,6 +26,7 @@ const config: CliCommandConfig = {
hidden: false,
flags: {
...commonFlags,
...excludePathsFlag,
verbose: {
type: 'boolean',
default: false,
Expand Down Expand Up @@ -117,9 +121,13 @@ async function run(
return
}

const excludePaths = cmdFlagValueToArray(cli.flags['excludePaths'])
assertValidExcludePaths(excludePaths)

await generateAutoManifest({
detected,
cwd,
excludePaths,
outputKind,
verbose,
})
Expand Down
1 change: 1 addition & 0 deletions src/commands/manifest/cmd-manifest-auto.test.mts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ describe('socket manifest auto', async () => {
$ socket manifest auto [options] [CWD=.]

Options
--exclude-paths List of glob patterns to exclude from the scan, including SCA/SBOM manifest discovery and (when --reach is enabled) full application reachability analysis. Patterns are anchored micromatch globs matched relative to the Socket scan root, which is the command working directory (\`--cwd\` if set), not the reachability target: \`tests\` matches only \`<cwd>/tests\`; use \`**/tests\` to match at any depth. Negation patterns (\`!path\`) are not supported. Accepts a comma-separated value or multiple flags.
--verbose Enable debug output (only for auto itself; sub-steps need to have it pre-configured), may help when running into errors

Tries to figure out what language your target repo uses. If it finds a
Expand Down
9 changes: 9 additions & 0 deletions src/commands/manifest/cmd-manifest-gradle.mts
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,13 @@ import { resolveBuildToolBin } from './scripts/build-tool.mts'
import constants, { REQUIREMENTS_TXT, SOCKET_JSON } from '../../constants.mts'
import { commonFlags } from '../../flags.mts'
import { checkCommandInput } from '../../utils/check-input.mts'
import { cmdFlagValueToArray } from '../../utils/cmd.mts'
import { getOutputKind } from '../../utils/get-output-kind.mts'
import { meowOrExit } from '../../utils/meow-with-subcommands.mts'
import { getFlagListOutput } from '../../utils/output-formatting.mts'
import { readOrDefaultSocketJson } from '../../utils/socket-json.mts'
import { assertValidExcludePaths } from '../scan/exclude-paths.mts'
import { excludePathsFlag } from '../scan/reachability-flags.mts'

import type {
CliCommandConfig,
Expand Down Expand Up @@ -52,6 +55,7 @@ const config: CliCommandConfig = {
description:
'When generating facts: comma-separated glob patterns; Gradle configurations matching any pattern are skipped (applied after --include-configs)',
},
...excludePathsFlag,
ignoreUnresolved: {
type: 'boolean',
description:
Expand Down Expand Up @@ -286,11 +290,15 @@ async function run(

const parsedGradleOpts = parseBuildToolOpts(String(gradleOpts || ''))

const excludePaths = cmdFlagValueToArray(cli.flags['excludePaths'])
assertValidExcludePaths(excludePaths)

if (facts) {
await convertGradleToFacts({
bin: String(bin),
cwd,
excludeConfigs: String(excludeConfigs || ''),
excludePaths,
Comment thread
jfblaa marked this conversation as resolved.
gradleOpts: parsedGradleOpts,
ignoreUnresolved: Boolean(ignoreUnresolved),
includeConfigs: String(includeConfigs || ''),
Expand All @@ -302,6 +310,7 @@ async function run(
await convertGradleToMaven({
bin: String(bin),
cwd,
excludePaths,
gradleOpts: parsedGradleOpts,
verbose: Boolean(verbose),
})
Expand Down
1 change: 1 addition & 0 deletions src/commands/manifest/cmd-manifest-gradle.test.mts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ describe('socket manifest gradle', async () => {
Options
--bin Location of the gradle binary to use, default: ./gradlew if present, else gradle on PATH
--exclude-configs When generating facts: comma-separated glob patterns; Gradle configurations matching any pattern are skipped (applied after --include-configs)
--exclude-paths List of glob patterns to exclude from the scan, including SCA/SBOM manifest discovery and (when --reach is enabled) full application reachability analysis. Patterns are anchored micromatch globs matched relative to the Socket scan root, which is the command working directory (\`--cwd\` if set), not the reachability target: \`tests\` matches only \`<cwd>/tests\`; use \`**/tests\` to match at any depth. Negation patterns (\`!path\`) are not supported. Accepts a comma-separated value or multiple flags.
--facts Emit a Socket facts JSON file (\`.socket.facts.json\`) describing the resolved dependency graph. This is the default; pass \`--pom\` to generate \`pom.xml\` files instead
--gradle-opts Additional options to pass on to ./gradlew, see \`./gradlew --help\`
--ignore-unresolved When generating facts: warn on unresolved dependencies instead of failing the run (unresolved deps are not emitted to the facts file)
Expand Down
9 changes: 9 additions & 0 deletions src/commands/manifest/cmd-manifest-kotlin.mts
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,13 @@ import { resolveBuildToolBin } from './scripts/build-tool.mts'
import constants, { REQUIREMENTS_TXT, SOCKET_JSON } from '../../constants.mts'
import { commonFlags } from '../../flags.mts'
import { checkCommandInput } from '../../utils/check-input.mts'
import { cmdFlagValueToArray } from '../../utils/cmd.mts'
import { getOutputKind } from '../../utils/get-output-kind.mts'
import { meowOrExit } from '../../utils/meow-with-subcommands.mts'
import { getFlagListOutput } from '../../utils/output-formatting.mts'
import { readOrDefaultSocketJson } from '../../utils/socket-json.mts'
import { assertValidExcludePaths } from '../scan/exclude-paths.mts'
import { excludePathsFlag } from '../scan/reachability-flags.mts'

import type {
CliCommandConfig,
Expand Down Expand Up @@ -57,6 +60,7 @@ const config: CliCommandConfig = {
description:
'When generating facts: comma-separated glob patterns; Gradle configurations matching any pattern are skipped (applied after --include-configs)',
},
...excludePathsFlag,
ignoreUnresolved: {
type: 'boolean',
description:
Expand Down Expand Up @@ -289,11 +293,15 @@ async function run(

const parsedGradleOpts = parseBuildToolOpts(String(gradleOpts || ''))

const excludePaths = cmdFlagValueToArray(cli.flags['excludePaths'])
assertValidExcludePaths(excludePaths)

if (facts) {
await convertGradleToFacts({
bin: String(bin),
cwd,
excludeConfigs: String(excludeConfigs || ''),
excludePaths,
gradleOpts: parsedGradleOpts,
ignoreUnresolved: Boolean(ignoreUnresolved),
includeConfigs: String(includeConfigs || ''),
Expand All @@ -305,6 +313,7 @@ async function run(
await convertGradleToMaven({
bin: String(bin),
cwd,
excludePaths,
gradleOpts: parsedGradleOpts,
verbose: Boolean(verbose),
})
Expand Down
1 change: 1 addition & 0 deletions src/commands/manifest/cmd-manifest-kotlin.test.mts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ describe('socket manifest kotlin', async () => {
Options
--bin Location of the gradle binary to use, default: ./gradlew if present, else gradle on PATH
--exclude-configs When generating facts: comma-separated glob patterns; Gradle configurations matching any pattern are skipped (applied after --include-configs)
--exclude-paths List of glob patterns to exclude from the scan, including SCA/SBOM manifest discovery and (when --reach is enabled) full application reachability analysis. Patterns are anchored micromatch globs matched relative to the Socket scan root, which is the command working directory (\`--cwd\` if set), not the reachability target: \`tests\` matches only \`<cwd>/tests\`; use \`**/tests\` to match at any depth. Negation patterns (\`!path\`) are not supported. Accepts a comma-separated value or multiple flags.
--facts Emit a Socket facts JSON file (\`.socket.facts.json\`) describing the resolved dependency graph. This is the default; pass \`--pom\` to generate \`pom.xml\` files instead
--gradle-opts Additional options to pass on to ./gradlew, see \`./gradlew --help\`
--ignore-unresolved When generating facts: warn on unresolved dependencies instead of failing the run (unresolved deps are not emitted to the facts file)
Expand Down
8 changes: 8 additions & 0 deletions src/commands/manifest/cmd-manifest-maven.mts
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,13 @@ import { resolveBuildToolBin } from './scripts/build-tool.mts'
import constants, { SOCKET_JSON } from '../../constants.mts'
import { commonFlags } from '../../flags.mts'
import { checkCommandInput } from '../../utils/check-input.mts'
import { cmdFlagValueToArray } from '../../utils/cmd.mts'
import { getOutputKind } from '../../utils/get-output-kind.mts'
import { meowOrExit } from '../../utils/meow-with-subcommands.mts'
import { getFlagListOutput } from '../../utils/output-formatting.mts'
import { readOrDefaultSocketJson } from '../../utils/socket-json.mts'
import { assertValidExcludePaths } from '../scan/exclude-paths.mts'
import { excludePathsFlag } from '../scan/reachability-flags.mts'

import type {
CliCommandConfig,
Expand Down Expand Up @@ -41,6 +44,7 @@ const config: CliCommandConfig = {
description:
'Comma-separated glob patterns; Maven scopes matching any pattern are skipped (applied after --include-configs)',
},
...excludePathsFlag,
ignoreUnresolved: {
type: 'boolean',
description:
Expand Down Expand Up @@ -224,10 +228,14 @@ async function run(

const parsedMavenOpts = parseBuildToolOpts(String(mavenOpts || ''))

const excludePaths = cmdFlagValueToArray(cli.flags['excludePaths'])
assertValidExcludePaths(excludePaths)

await convertMavenToFacts({
bin: String(bin),
cwd,
excludeConfigs: String(excludeConfigs || ''),
excludePaths,
ignoreUnresolved: Boolean(ignoreUnresolved),
includeConfigs: String(includeConfigs || ''),
mavenOpts: parsedMavenOpts,
Expand Down
1 change: 1 addition & 0 deletions src/commands/manifest/cmd-manifest-maven.test.mts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ describe('socket manifest maven', async () => {
Options
--bin Location of the maven binary to use, default: ./mvnw if present, else mvn on PATH
--exclude-configs Comma-separated glob patterns; Maven scopes matching any pattern are skipped (applied after --include-configs)
--exclude-paths List of glob patterns to exclude from the scan, including SCA/SBOM manifest discovery and (when --reach is enabled) full application reachability analysis. Patterns are anchored micromatch globs matched relative to the Socket scan root, which is the command working directory (\`--cwd\` if set), not the reachability target: \`tests\` matches only \`<cwd>/tests\`; use \`**/tests\` to match at any depth. Negation patterns (\`!path\`) are not supported. Accepts a comma-separated value or multiple flags.
--ignore-unresolved Warn on unresolved dependencies instead of failing the run (unresolved deps are not emitted to the facts file)
--include-configs Comma-separated glob patterns matched against Maven dependency scopes (case-sensitive; \`*\`, \`?\`, and \`[...]\` wildcards). Only scopes matching at least one pattern are resolved. e.g. \`compile,runtime\`. Default: every scope
--maven-opts Additional options to pass on to maven, e.g. \`-P <profile> -s <settings.xml>\`
Expand Down
8 changes: 8 additions & 0 deletions src/commands/manifest/cmd-manifest-scala.mts
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,13 @@ import { parseBuildToolOpts } from './parse-build-tool-opts.mts'
import constants, { REQUIREMENTS_TXT, SOCKET_JSON } from '../../constants.mts'
import { commonFlags } from '../../flags.mts'
import { checkCommandInput } from '../../utils/check-input.mts'
import { cmdFlagValueToArray } from '../../utils/cmd.mts'
import { getOutputKind } from '../../utils/get-output-kind.mts'
import { meowOrExit } from '../../utils/meow-with-subcommands.mts'
import { getFlagListOutput } from '../../utils/output-formatting.mts'
import { readOrDefaultSocketJson } from '../../utils/socket-json.mts'
import { assertValidExcludePaths } from '../scan/exclude-paths.mts'
import { excludePathsFlag } from '../scan/reachability-flags.mts'

import type {
CliCommandConfig,
Expand Down Expand Up @@ -50,6 +53,7 @@ const config: CliCommandConfig = {
description:
'When generating facts: comma-separated glob patterns; sbt configurations matching any pattern are skipped (applied after --include-configs)',
},
...excludePathsFlag,
ignoreUnresolved: {
type: 'boolean',
description:
Expand Down Expand Up @@ -340,11 +344,15 @@ async function run(

const parsedSbtOpts = parseBuildToolOpts(String(sbtOpts || ''))

const excludePaths = cmdFlagValueToArray(cli.flags['excludePaths'])
assertValidExcludePaths(excludePaths)

if (facts) {
await convertSbtToFacts({
bin: String(bin),
cwd,
excludeConfigs: String(excludeConfigs || ''),
excludePaths,
ignoreUnresolved: Boolean(ignoreUnresolved),
includeConfigs: String(includeConfigs || ''),
sbtOpts: parsedSbtOpts,
Expand Down
1 change: 1 addition & 0 deletions src/commands/manifest/cmd-manifest-scala.test.mts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ describe('socket manifest scala', async () => {
Options
--bin Location of sbt binary to use
--exclude-configs When generating facts: comma-separated glob patterns; sbt configurations matching any pattern are skipped (applied after --include-configs)
--exclude-paths List of glob patterns to exclude from the scan, including SCA/SBOM manifest discovery and (when --reach is enabled) full application reachability analysis. Patterns are anchored micromatch globs matched relative to the Socket scan root, which is the command working directory (\`--cwd\` if set), not the reachability target: \`tests\` matches only \`<cwd>/tests\`; use \`**/tests\` to match at any depth. Negation patterns (\`!path\`) are not supported. Accepts a comma-separated value or multiple flags.
--facts Emit a Socket facts JSON file (\`.socket.facts.json\`) describing the resolved dependency graph. This is the default; pass \`--pom\` to generate \`pom.xml\` files instead
--ignore-unresolved When generating facts: warn on unresolved dependencies instead of failing the run (unresolved deps are not emitted to the facts file)
--include-configs When generating facts: comma-separated glob patterns matched against sbt configuration names (case-sensitive; \`*\`, \`?\`, and \`[...]\` wildcards). Only configurations matching at least one pattern are resolved. e.g. \`compile,test\`. Default: compile,optional,provided,runtime,test
Expand Down
3 changes: 3 additions & 0 deletions src/commands/manifest/convert-gradle-to-facts.mts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export async function convertGradleToFacts({
bin,
cwd,
excludeConfigs,
excludePaths,
gradleOpts,
ignoreUnresolved,
includeConfigs,
Expand All @@ -17,6 +18,7 @@ export async function convertGradleToFacts({
bin: string
cwd: string
excludeConfigs: string
excludePaths?: string[] | undefined
gradleOpts: string[]
ignoreUnresolved: boolean
includeConfigs: string
Expand All @@ -30,6 +32,7 @@ export async function convertGradleToFacts({
cwd,
ecosystem: 'gradle',
excludeConfigs,
excludePaths,
ignoreUnresolved,
includeConfigs,
sidecarAcc,
Expand Down
3 changes: 3 additions & 0 deletions src/commands/manifest/convert-maven-to-facts.mts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export async function convertMavenToFacts({
bin,
cwd,
excludeConfigs,
excludePaths,
ignoreUnresolved,
includeConfigs,
mavenOpts,
Expand All @@ -17,6 +18,7 @@ export async function convertMavenToFacts({
bin: string
cwd: string
excludeConfigs: string
excludePaths?: string[] | undefined
ignoreUnresolved: boolean
includeConfigs: string
mavenOpts: string[]
Expand All @@ -30,6 +32,7 @@ export async function convertMavenToFacts({
cwd,
ecosystem: 'maven',
excludeConfigs,
excludePaths,
ignoreUnresolved,
includeConfigs,
sidecarAcc,
Expand Down
3 changes: 3 additions & 0 deletions src/commands/manifest/convert-sbt-to-facts.mts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export async function convertSbtToFacts({
bin,
cwd,
excludeConfigs,
excludePaths,
ignoreUnresolved,
includeConfigs,
sbtOpts,
Expand All @@ -19,6 +20,7 @@ export async function convertSbtToFacts({
bin: string
cwd: string
excludeConfigs: string
excludePaths?: string[] | undefined
ignoreUnresolved: boolean
includeConfigs: string
sbtOpts: string[]
Expand All @@ -32,6 +34,7 @@ export async function convertSbtToFacts({
cwd,
ecosystem: 'sbt',
excludeConfigs,
excludePaths,
ignoreUnresolved,
includeConfigs,
sidecarAcc,
Expand Down
Loading
Loading