@socketsecurity/cli-with-sentry 1.1.22 → 1.1.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -4,6 +4,18 @@ All notable changes to this project will be documented in this file.
4
4
 
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
6
6
 
7
+ ## [1.1.23](https://github.com/SocketDev/socket-cli/releases/tag/v1.1.23) - 2025-09-22
8
+
9
+ ### Changed
10
+ - Enhanced `--no-apply-fixes` flag naming for improved clarity (previously `--dont-apply-fixes`)
11
+ - Streamlined documentation and help text for better user experience
12
+ - Improved `pnpm dlx` operations by removing unnecessary `--ignore-scripts` flag
13
+
14
+ ### Fixed
15
+ - Resolved JSON example formatting in usage documentation
16
+ - Enhanced test reliability for cdxgen on Windows platforms
17
+ - Improved error handling in optimize command for pnpm environments
18
+
7
19
  ## [1.1.22](https://github.com/SocketDev/socket-cli/releases/tag/v1.1.22) - 2025-09-20
8
20
 
9
21
  ### Changed
package/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  [![Socket Badge](https://socket.dev/api/badge/npm/package/socket)](https://socket.dev/npm/package/socket)
4
4
  [![Follow @SocketSecurity](https://img.shields.io/twitter/follow/SocketSecurity?style=social)](https://twitter.com/SocketSecurity)
5
5
 
6
- > CLI tool for [Socket.dev]
6
+ CLI for [Socket.dev] security analysis
7
7
 
8
8
  ## Usage
9
9
 
@@ -14,73 +14,58 @@ socket --help
14
14
 
15
15
  ## Commands
16
16
 
17
- - `socket npm [args...]` and `socket npx [args...]` - Wraps `npm` and `npx` to
18
- integrate [Socket.dev] and preempt installation of alerted packages using the
19
- builtin resolution of `npm` to precisely determine package installations
17
+ - `socket npm [args...]` and `socket npx [args...]` - Wraps npm/npx with Socket security scanning
20
18
 
21
- - `socket optimize` - Optimize dependencies with
22
- [`@socketregistry`](https://github.com/SocketDev/socket-registry) overrides
23
- _(👀 [our blog post](https://socket.dev/blog/introducing-socket-optimize))_
19
+ - `socket fix` - Fix CVEs in dependencies
24
20
 
25
- - `--pin` - Pin overrides to their latest version
26
- - `--prod` - Add overrides for only production dependencies
21
+ - `socket optimize` - Optimize dependencies with [`@socketregistry`](https://github.com/SocketDev/socket-registry) overrides
27
22
 
28
- - `socket cdxgen [command]` - Call out to
29
- [cdxgen](https://cyclonedx.github.io/cdxgen/#/?id=getting-started). See
30
- [their documentation](https://cyclonedx.github.io/cdxgen/#/CLI?id=getting-help)
31
- for commands.
23
+ - `socket cdxgen [command]` - Run [cdxgen](https://cyclonedx.github.io/cdxgen/#/?id=getting-started) for SBOM generation
32
24
 
33
25
  ## Aliases
34
26
 
35
27
  All aliases support the flags and arguments of the commands they alias.
36
28
 
37
- - `socket ci` - alias for `socket scan create --report` which creates a report for the current directory and quits with an exit code if the result is unhealthy
29
+ - `socket ci` - Alias for `socket scan create --report` (creates report and exits with error if unhealthy)
38
30
 
39
31
  ## Flags
40
32
 
41
33
  ### Output flags
42
34
 
43
- - `--json` - Outputs result as JSON which can be piped into [`jq`](https://stedolan.github.io/jq/) and other tools
44
- - `--markdown` - Outputs result as Markdown which can be copied into issues, pull requests, or chats
35
+ - `--json` - Output as JSON
36
+ - `--markdown` - Output as Markdown
45
37
 
46
38
  ### Other flags
47
39
 
48
- - `--dry-run` - Run a command without uploading anything
49
- - `--debug` - Output additional debug
50
- - `--help` - Prints help documentation
51
- - `--max-old-space-size` - Set Node's V8 [`--max-old-space-size`](https://nodejs.org/api/cli.html#--max-old-space-sizesize-in-mib) option
52
- - `--max-semi-space-size` - Set Node's V8 [`--max-semi-space-size`](https://nodejs.org/api/cli.html#--max-semi-space-sizesize-in-mib) option
53
- - `--version` - Prints the Socket CLI version
40
+ - `--dry-run` - Run without uploading
41
+ - `--debug` - Show debug output
42
+ - `--help` - Show help
43
+ - `--max-old-space-size` - Set Node.js memory limit
44
+ - `--max-semi-space-size` - Set Node.js heap size
45
+ - `--version` - Show version
54
46
 
55
47
  ## Configuration files
56
48
 
57
- Socket CLI reads and uses data from a
58
- [`socket.yml` file](https://docs.socket.dev/docs/socket-yml) in the folder you
59
- run it in. It supports the version 2 of the `socket.yml` file format and makes
60
- use of the `projectIgnorePaths` to excludes files when creating a report.
49
+ Socket CLI reads [`socket.yml`](https://docs.socket.dev/docs/socket-yml) configuration files.
50
+ Supports version 2 format with `projectIgnorePaths` for excluding files from reports.
61
51
 
62
52
  ## Environment variables
63
53
 
64
- - `SOCKET_CLI_API_TOKEN` - Set the Socket API token
65
- - `SOCKET_CLI_CONFIG` - A JSON stringified Socket configuration object
66
- - `SOCKET_CLI_GITHUB_API_URL` - Change the base URL for GitHub REST API calls
67
- - `SOCKET_CLI_GIT_USER_EMAIL` - The git config `user.email` used by Socket CLI<br>
68
- *Defaults:* `github-actions[bot]@users.noreply.github.com`<br>
69
- - `SOCKET_CLI_GIT_USER_NAME` - The git config `user.name` used by Socket CLI<br>
70
- *Defaults:* `github-actions[bot]`<br>
71
- - `SOCKET_CLI_GITHUB_TOKEN` - A classic or fine-grained [GitHub personal access token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens) with the "repo" scope or read/write permissions set for "Contents" and "Pull Request"<br>
72
- *Aliases:* `GITHUB_TOKEN`<br>
73
- - `SOCKET_CLI_NO_API_TOKEN` - Make the default API token `undefined`
74
- - `SOCKET_CLI_NPM_PATH` - The absolute location of the npm directory
75
- - `SOCKET_CLI_ORG_SLUG` - Specify the Socket organization slug<br><br>
76
- - `SOCKET_CLI_ACCEPT_RISKS` - Accept risks of a Socket wrapped npm/npx run
77
- - `SOCKET_CLI_VIEW_ALL_RISKS` - View all risks of a Socket wrapped npm/npx run
54
+ - `SOCKET_CLI_API_TOKEN` - Socket API token
55
+ - `SOCKET_CLI_CONFIG` - JSON configuration object
56
+ - `SOCKET_CLI_GITHUB_API_URL` - GitHub API base URL
57
+ - `SOCKET_CLI_GIT_USER_EMAIL` - Git user email (default: `github-actions[bot]@users.noreply.github.com`)
58
+ - `SOCKET_CLI_GIT_USER_NAME` - Git user name (default: `github-actions[bot]`)
59
+ - `SOCKET_CLI_GITHUB_TOKEN` - GitHub token with repo access (alias: `GITHUB_TOKEN`)
60
+ - `SOCKET_CLI_NO_API_TOKEN` - Disable default API token
61
+ - `SOCKET_CLI_NPM_PATH` - Path to npm directory
62
+ - `SOCKET_CLI_ORG_SLUG` - Socket organization slug
63
+ - `SOCKET_CLI_ACCEPT_RISKS` - Accept npm/npx risks
64
+ - `SOCKET_CLI_VIEW_ALL_RISKS` - Show all npm/npx risks
78
65
 
79
66
  ## Contributing
80
67
 
81
- ### Setup
82
-
83
- To run locally execute the following commands:
68
+ Run locally:
84
69
 
85
70
  ```
86
71
  npm install
@@ -88,23 +73,19 @@ npm run build
88
73
  npm exec socket
89
74
  ```
90
75
 
91
- ### Environment variables for development
76
+ ### Development environment variables
92
77
 
93
- - `SOCKET_CLI_API_BASE_URL` - Change the base URL for Socket API calls<br>
94
- *Defaults:* The "apiBaseUrl" value of socket/settings local app data if present, else `https://api.socket.dev/v0/`<br>
95
- - `SOCKET_CLI_API_PROXY` - Set the proxy Socket API requests are routed through, e.g. if set to<br>
96
- [`http://127.0.0.1:9090`](https://docs.proxyman.io/troubleshooting/couldnt-see-any-requests-from-3rd-party-network-libraries), then all request are passed through that proxy<br>
97
- *Aliases:* `HTTPS_PROXY`, `https_proxy`, `HTTP_PROXY`, and `http_proxy`<br>
98
- - `SOCKET_CLI_API_TIMEOUT` - Set the timeout in milliseconds for Socket API requests
99
- - `SOCKET_CLI_DEBUG` - Enable debug logging in Socket CLI
100
- - `DEBUG` - Enable debug logging based on the [`debug`](https://socket.dev/npm/package/debug) package
78
+ - `SOCKET_CLI_API_BASE_URL` - API base URL (default: `https://api.socket.dev/v0/`)
79
+ - `SOCKET_CLI_API_PROXY` - Proxy for API requests (aliases: `HTTPS_PROXY`, `https_proxy`, `HTTP_PROXY`, `http_proxy`)
80
+ - `SOCKET_CLI_API_TIMEOUT` - API request timeout in milliseconds
81
+ - `SOCKET_CLI_DEBUG` - Enable debug logging
82
+ - `DEBUG` - Enable [`debug`](https://socket.dev/npm/package/debug) package logging
101
83
 
102
84
  ## See also
103
85
 
104
- - [Announcement blog post](https://socket.dev/blog/announcing-socket-cli-preview)
105
- - [Socket API Reference](https://docs.socket.dev/reference) - The API used by Socket CLI
106
- - [Socket GitHub App](https://github.com/apps/socket-security) - The plug-and-play GitHub App
107
- - [`@socketsecurity/sdk`](https://github.com/SocketDev/socket-sdk-js) - The SDK used by Socket CLI
86
+ - [Socket API Reference](https://docs.socket.dev/reference)
87
+ - [Socket GitHub App](https://github.com/apps/socket-security)
88
+ - [`@socketsecurity/sdk`](https://github.com/SocketDev/socket-sdk-js)
108
89
 
109
90
  [Socket.dev]: https://socket.dev/
110
91
 
package/dist/cli.js CHANGED
@@ -2378,7 +2378,7 @@ async function handleCi(autoManifest) {
2378
2378
 
2379
2379
  const config$k = {
2380
2380
  commandName: 'ci',
2381
- description: 'Shorthand for `socket scan create --report --no-interactive`',
2381
+ description: 'Alias for `socket scan create --report` (creates report and exits with error if unhealthy)',
2382
2382
  hidden: false,
2383
2383
  flags: {
2384
2384
  ...flags.commonFlags,
@@ -3544,9 +3544,9 @@ async function getFixEnv() {
3544
3544
 
3545
3545
  async function coanaFix(fixConfig) {
3546
3546
  const {
3547
+ applyFixes,
3547
3548
  autopilot,
3548
3549
  cwd,
3549
- dontApplyFixes,
3550
3550
  ghsas,
3551
3551
  glob,
3552
3552
  limit,
@@ -3594,7 +3594,7 @@ async function coanaFix(fixConfig) {
3594
3594
  const shouldOpenPrs = fixEnv.isCi && fixEnv.repoInfo;
3595
3595
  if (!shouldOpenPrs) {
3596
3596
  // Inform user about local mode when fixes will be applied.
3597
- if (!dontApplyFixes && ghsas.length) {
3597
+ if (applyFixes && ghsas.length) {
3598
3598
  const envCheck = checkCiEnvVars();
3599
3599
  if (envCheck.present.length) {
3600
3600
  // Some CI vars are set but not all - show what's missing.
@@ -3616,7 +3616,7 @@ async function coanaFix(fixConfig) {
3616
3616
  }
3617
3617
  };
3618
3618
  }
3619
- const fixCResult = await utils.spawnCoanaDlx(['compute-fixes-and-upgrade-purls', cwd, '--manifests-tar-hash', tarHash, '--apply-fixes-to', ...(isAll ? ['all'] : ghsas), ...(fixConfig.rangeStyle ? ['--range-style', fixConfig.rangeStyle] : []), ...(glob ? ['--glob', glob] : []), ...(dontApplyFixes ? [constants.FLAG_DRY_RUN] : []), ...(outputFile ? ['--output-file', outputFile] : []), ...fixConfig.unknownFlags], fixConfig.orgSlug, {
3619
+ const fixCResult = await utils.spawnCoanaDlx(['compute-fixes-and-upgrade-purls', cwd, '--manifests-tar-hash', tarHash, '--apply-fixes-to', ...(isAll ? ['all'] : ghsas), ...(fixConfig.rangeStyle ? ['--range-style', fixConfig.rangeStyle] : []), ...(glob ? ['--glob', glob] : []), ...(!applyFixes ? [constants.FLAG_DRY_RUN] : []), ...(outputFile ? ['--output-file', outputFile] : []), ...fixConfig.unknownFlags], fixConfig.orgSlug, {
3620
3620
  cwd,
3621
3621
  spinner,
3622
3622
  stdio: 'inherit'
@@ -3903,9 +3903,9 @@ async function convertIdsToGhsas(ids) {
3903
3903
  return validGhsas;
3904
3904
  }
3905
3905
  async function handleFix({
3906
+ applyFixes,
3906
3907
  autopilot,
3907
3908
  cwd,
3908
- dontApplyFixes,
3909
3909
  ghsas,
3910
3910
  glob,
3911
3911
  limit,
@@ -3926,7 +3926,7 @@ async function handleFix({
3926
3926
  glob,
3927
3927
  limit,
3928
3928
  minSatisfying,
3929
- dontApplyFixes,
3929
+ applyFixes,
3930
3930
  outputFile,
3931
3931
  outputKind,
3932
3932
  prCheck,
@@ -3935,7 +3935,7 @@ async function handleFix({
3935
3935
  });
3936
3936
  await outputFixResult(await coanaFix({
3937
3937
  autopilot,
3938
- dontApplyFixes,
3938
+ applyFixes,
3939
3939
  cwd,
3940
3940
  // Convert mixed CVE/GHSA/PURL inputs to GHSA IDs only
3941
3941
  ghsas: await convertIdsToGhsas(ghsas),
@@ -3951,7 +3951,7 @@ async function handleFix({
3951
3951
 
3952
3952
  const CMD_NAME$t = 'fix';
3953
3953
  const DEFAULT_LIMIT = 10;
3954
- const description$z = 'Update dependencies with "fixable" Socket alerts';
3954
+ const description$z = 'Fix CVEs in dependencies';
3955
3955
  const hidden$s = false;
3956
3956
  const cmdFix = {
3957
3957
  description: description$z,
@@ -3964,11 +3964,13 @@ const generalFlags$2 = {
3964
3964
  default: false,
3965
3965
  description: `Enable auto-merge for pull requests that Socket opens.\nSee ${vendor.terminalLinkExports('GitHub documentation', 'https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/configuring-pull-request-merges/managing-auto-merge-for-pull-requests-in-your-repository')} for managing auto-merge for pull requests in your repository.`
3966
3966
  },
3967
- dontApplyFixes: {
3967
+ applyFixes: {
3968
3968
  aliases: ['onlyCompute'],
3969
3969
  type: 'boolean',
3970
- default: false,
3971
- description: 'Compute fixes only, do not apply them. Logs what upgrades would be applied. If combined with --output-file, the output file will contain the upgrades that would be applied.'
3970
+ default: true,
3971
+ description: 'Compute fixes only, do not apply them. Logs what upgrades would be applied. If combined with --output-file, the output file will contain the upgrades that would be applied.',
3972
+ // Hidden to allow custom documenting of the negated `--no-apply-fixes` variant.
3973
+ hidden: true
3972
3974
  },
3973
3975
  id: {
3974
3976
  type: 'string',
@@ -4076,7 +4078,14 @@ async function run$K(argv, importMeta, {
4076
4078
  ${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$t}`)}
4077
4079
 
4078
4080
  Options
4079
- ${utils.getFlagListOutput(config.flags)}
4081
+ ${utils.getFlagListOutput({
4082
+ ...config.flags,
4083
+ // Explicitly document the negated --no-apply-fixes variant.
4084
+ noApplyFixes: {
4085
+ ...config.flags['applyFixes'],
4086
+ hidden: false
4087
+ }
4088
+ })}
4080
4089
 
4081
4090
  Environment Variables (for CI/PR mode)
4082
4091
  CI Set to enable CI mode
@@ -4099,8 +4108,8 @@ async function run$K(argv, importMeta, {
4099
4108
  allowUnknownFlags: false
4100
4109
  });
4101
4110
  const {
4111
+ applyFixes,
4102
4112
  autopilot,
4103
- dontApplyFixes,
4104
4113
  glob,
4105
4114
  json,
4106
4115
  limit,
@@ -4150,7 +4159,7 @@ async function run$K(argv, importMeta, {
4150
4159
  const ghsas = arrays.arrayUnique([...utils.cmdFlagValueToArray(cli.flags['id']), ...utils.cmdFlagValueToArray(cli.flags['ghsa']), ...utils.cmdFlagValueToArray(cli.flags['purl'])]);
4151
4160
  await handleFix({
4152
4161
  autopilot,
4153
- dontApplyFixes,
4162
+ applyFixes,
4154
4163
  cwd,
4155
4164
  ghsas,
4156
4165
  glob,
@@ -4988,7 +4997,7 @@ const yargsConfig = {
4988
4997
  };
4989
4998
  const config$e = {
4990
4999
  commandName: 'cdxgen',
4991
- description: 'Create an SBOM with CycloneDX generator (cdxgen)',
5000
+ description: 'Run cdxgen for SBOM generation',
4992
5001
  hidden: false,
4993
5002
  // Stub out flags and help.
4994
5003
  // TODO: Convert yargs to meow.
@@ -6336,7 +6345,7 @@ async function run$y(argv, importMeta, {
6336
6345
 
6337
6346
  const require$5 = require$$5.createRequire((typeof document === 'undefined' ? require$$0.pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('cli.js', document.baseURI).href)));
6338
6347
  const CMD_NAME$r = constants.NPM;
6339
- const description$w = 'Run npm with the Socket wrapper';
6348
+ const description$w = 'Wraps npm with Socket security scanning';
6340
6349
  const hidden$q = false;
6341
6350
  const cmdNpm = {
6342
6351
  description: description$w,
@@ -6414,7 +6423,7 @@ async function run$x(argv, importMeta, context) {
6414
6423
 
6415
6424
  const require$4 = require$$5.createRequire((typeof document === 'undefined' ? require$$0.pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('cli.js', document.baseURI).href)));
6416
6425
  const CMD_NAME$q = constants.NPX;
6417
- const description$v = 'Run npx with the Socket wrapper';
6426
+ const description$v = 'Wraps npx with Socket security scanning';
6418
6427
  const hidden$p = false;
6419
6428
  const cmdNpx = {
6420
6429
  description: description$v,
@@ -7486,12 +7495,12 @@ async function run$u(argv, importMeta, {
7486
7495
  pin: {
7487
7496
  type: 'boolean',
7488
7497
  default: false,
7489
- description: 'Pin overrides to their latest version'
7498
+ description: 'Pin overrides to latest version'
7490
7499
  },
7491
7500
  prod: {
7492
7501
  type: 'boolean',
7493
7502
  default: false,
7494
- description: 'Only add overrides for production dependencies'
7503
+ description: 'Add overrides for production dependencies only'
7495
7504
  }
7496
7505
  },
7497
7506
  help: (command, config) => `
@@ -9527,7 +9536,7 @@ async function run$m(argv, importMeta, {
9527
9536
 
9528
9537
  const require$3 = require$$5.createRequire((typeof document === 'undefined' ? require$$0.pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('cli.js', document.baseURI).href)));
9529
9538
  const CMD_NAME$g = constants.PNPM;
9530
- const description$j = 'Run pnpm with the Socket wrapper';
9539
+ const description$j = 'Wraps pnpm with Socket security scanning';
9531
9540
  const hidden$g = true;
9532
9541
  const cmdPnpm = {
9533
9542
  description: description$j,
@@ -14688,7 +14697,7 @@ async function run$1(argv, importMeta, {
14688
14697
 
14689
14698
  const require$1 = require$$5.createRequire((typeof document === 'undefined' ? require$$0.pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('cli.js', document.baseURI).href)));
14690
14699
  const CMD_NAME = constants.YARN;
14691
- const description = 'Run yarn with the Socket wrapper';
14700
+ const description = 'Wraps yarn with Socket security scanning';
14692
14701
  const hidden = true;
14693
14702
  const cmdYarn = {
14694
14703
  description,
@@ -14945,5 +14954,5 @@ void (async () => {
14945
14954
  await utils.captureException(e);
14946
14955
  }
14947
14956
  })();
14948
- //# debugId=4aa44248-7031-4a9e-8cad-1c9fbaa730ef
14957
+ //# debugId=7d7feb5c-caaa-4477-9563-76861e408418
14949
14958
  //# sourceMappingURL=cli.js.map