@socketsecurity/cli 0.10.1 → 0.11.1
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/README.md +22 -22
- package/bin/npm +2 -0
- package/bin/npx +2 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +3419 -0
- package/dist/errors.d.ts +7 -0
- package/dist/link.d.ts +2 -0
- package/dist/link.js +45 -0
- package/dist/npm-cli.d.ts +2 -0
- package/dist/npm-cli.js +84 -0
- package/dist/npm-injection.d.ts +1 -0
- package/dist/npm-injection.js +913 -0
- package/dist/npm-injection2.d.ts +25 -0
- package/dist/npm-injection2.js +899 -0
- package/dist/npx-cli.d.ts +2 -0
- package/dist/npx-cli.js +60 -0
- package/dist/path-resolve.d.ts +12 -0
- package/dist/path-resolve.js +139 -0
- package/dist/sdk.d.ts +27 -0
- package/dist/sdk.js +224 -0
- package/dist/settings.d.ts +9 -0
- package/dist/type-helpers.d.ts +3 -0
- package/dist/vendor.js +25421 -0
- package/package.json +105 -52
- package/{lib/shadow/translations.json → translations.json} +20 -20
- package/cli.js +0 -72
- package/lib/commands/audit-log/index.js +0 -162
- package/lib/commands/cdxgen/index.js +0 -211
- package/lib/commands/dependencies/index.js +0 -150
- package/lib/commands/index.js +0 -14
- package/lib/commands/info/index.js +0 -287
- package/lib/commands/login/index.js +0 -170
- package/lib/commands/logout/index.js +0 -35
- package/lib/commands/npm/index.js +0 -27
- package/lib/commands/npx/index.js +0 -22
- package/lib/commands/raw-npm/index.js +0 -59
- package/lib/commands/raw-npx/index.js +0 -59
- package/lib/commands/report/create.js +0 -251
- package/lib/commands/report/index.js +0 -24
- package/lib/commands/report/view.js +0 -176
- package/lib/commands/repos/create.js +0 -166
- package/lib/commands/repos/delete.js +0 -93
- package/lib/commands/repos/index.js +0 -30
- package/lib/commands/repos/list.js +0 -170
- package/lib/commands/repos/update.js +0 -166
- package/lib/commands/repos/view.js +0 -128
- package/lib/commands/scan/create.js +0 -245
- package/lib/commands/scan/delete.js +0 -112
- package/lib/commands/scan/index.js +0 -30
- package/lib/commands/scan/list.js +0 -192
- package/lib/commands/scan/metadata.js +0 -113
- package/lib/commands/scan/stream.js +0 -115
- package/lib/commands/wrapper/index.js +0 -199
- package/lib/flags/command.js +0 -14
- package/lib/flags/index.js +0 -3
- package/lib/flags/output.js +0 -16
- package/lib/flags/validation.js +0 -14
- package/lib/shadow/bin/npm +0 -2
- package/lib/shadow/bin/npx +0 -2
- package/lib/shadow/link.cjs +0 -50
- package/lib/shadow/npm-cli.cjs +0 -27
- package/lib/shadow/npm-injection.cjs +0 -649
- package/lib/shadow/npx-cli.cjs +0 -27
- package/lib/shadow/package.json +0 -3
- package/lib/shadow/tty-server.cjs +0 -222
- package/lib/shadow/update-notifier.mjs +0 -3
- package/lib/utils/api-helpers.js +0 -42
- package/lib/utils/chalk-markdown.js +0 -125
- package/lib/utils/errors.js +0 -14
- package/lib/utils/flags.js +0 -27
- package/lib/utils/format-issues.js +0 -99
- package/lib/utils/formatting.js +0 -47
- package/lib/utils/issue-rules.cjs +0 -180
- package/lib/utils/meow-with-subcommands.js +0 -87
- package/lib/utils/misc.js +0 -61
- package/lib/utils/path-resolve.js +0 -204
- package/lib/utils/sdk.js +0 -99
- package/lib/utils/settings.js +0 -69
- package/lib/utils/type-helpers.cjs +0 -13
- package/lib/utils/update-notifier.js +0 -18
package/README.md
CHANGED
|
@@ -23,9 +23,9 @@ socket wrapper --enable
|
|
|
23
23
|
|
|
24
24
|
## Commands
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
- `socket info <package@version>` - looks up issues for a package
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
- `socket report create <path(s)-to-folder-or-file>` - creates a report on [socket.dev](https://socket.dev/)
|
|
29
29
|
|
|
30
30
|
Uploads the specified `package.json` and lock files for JavaScript, Python, and Go dependency manifests.
|
|
31
31
|
If any folder is specified, the ones found in there recursively are uploaded.
|
|
@@ -34,40 +34,40 @@ socket wrapper --enable
|
|
|
34
34
|
|
|
35
35
|
Ignores any file specified in your project's `.gitignore`, the `projectIgnorePaths` in your project's [`socket.yml`](https://docs.socket.dev/docs/socket-yml) and on top of that has a sensible set of [default ignores](https://www.npmjs.com/package/ignore-by-default)
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
- `socket report view <report-id>` - looks up issues and scores from a report
|
|
38
38
|
|
|
39
|
-
|
|
39
|
+
- `socket wrapper --enable` and `socket wrapper --disable` - Enables and disables the Socket 'safe-npm' wrapper.
|
|
40
40
|
|
|
41
|
-
|
|
41
|
+
- `socket raw-npm` and `socket raw-npx` - Temporarily disables the Socket 'safe-npm' wrapper.
|
|
42
42
|
|
|
43
43
|
## Aliases
|
|
44
44
|
|
|
45
45
|
All aliases supports flags and arguments of the commands they alias.
|
|
46
46
|
|
|
47
|
-
|
|
47
|
+
- `socket ci` - alias for `socket report create --view --strict` which creates a report and quits with an exit code if the result is unhealthy. Use like eg. `socket ci .` for a report for the current folder
|
|
48
48
|
|
|
49
49
|
## Flags
|
|
50
50
|
|
|
51
51
|
### Command specific flags
|
|
52
52
|
|
|
53
|
-
|
|
53
|
+
- `--view` - when set on `socket report create` the command will immediately do a `socket report view` style view of the created report, waiting for the server to complete it
|
|
54
54
|
|
|
55
55
|
### Output flags
|
|
56
56
|
|
|
57
|
-
|
|
58
|
-
|
|
57
|
+
- `--json` - outputs result as json which you can then pipe into [`jq`](https://stedolan.github.io/jq/) and other tools
|
|
58
|
+
- `--markdown` - outputs result as markdown which you can then copy into an issue, PR or even chat
|
|
59
59
|
|
|
60
60
|
## Strictness flags
|
|
61
61
|
|
|
62
|
-
|
|
63
|
-
|
|
62
|
+
- `--all` - by default only `high` and `critical` issues are included, by setting this flag all issues will be included
|
|
63
|
+
- `--strict` - when set, exits with an error code if report result is deemed unhealthy
|
|
64
64
|
|
|
65
65
|
### Other flags
|
|
66
66
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
67
|
+
- `--dry-run` - like all CLI tools that perform an action should have, we have a dry run flag. Eg. `socket report create` supports running the command without actually uploading anything
|
|
68
|
+
- `--debug` - outputs additional debug output. Great for debugging, geeks and us who develop. Hopefully you will never _need_ it, but it can still be fun, right?
|
|
69
|
+
- `--help` - prints the help for the current command. All CLI tools should have this flag
|
|
70
|
+
- `--version` - prints the version of the tool. All CLI tools should have this flag
|
|
71
71
|
|
|
72
72
|
## Configuration files
|
|
73
73
|
|
|
@@ -75,21 +75,21 @@ The CLI reads and uses data from a [`socket.yml` file](https://docs.socket.dev/d
|
|
|
75
75
|
|
|
76
76
|
## Environment variables
|
|
77
77
|
|
|
78
|
-
|
|
78
|
+
- `SOCKET_SECURITY_API_KEY` - if set, this will be used as the API-key
|
|
79
79
|
|
|
80
80
|
## Contributing
|
|
81
81
|
|
|
82
82
|
### Environment variables for development
|
|
83
83
|
|
|
84
|
-
|
|
85
|
-
|
|
84
|
+
- `SOCKET_SECURITY_API_BASE_URL` - if set, this will be the base for all API-calls. Defaults to `https://api.socket.dev/v0/`
|
|
85
|
+
- `SOCKET_SECURITY_API_PROXY` - if set to something like [`http://127.0.0.1:9090`](https://docs.proxyman.io/troubleshooting/couldnt-see-any-requests-from-3rd-party-network-libraries), then all request will be proxied through that proxy
|
|
86
86
|
|
|
87
87
|
## Similar projects
|
|
88
88
|
|
|
89
|
-
|
|
89
|
+
- [`@socketsecurity/sdk`](https://github.com/SocketDev/socket-sdk-js) - the SDK used in this CLI
|
|
90
90
|
|
|
91
91
|
## See also
|
|
92
92
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
93
|
+
- [Announcement blog post](https://socket.dev/blog/announcing-socket-cli-preview)
|
|
94
|
+
- [Socket API Reference](https://docs.socket.dev/reference) - the API used in this CLI
|
|
95
|
+
- [Socket GitHub App](https://github.com/apps/socket-security) - the plug-and-play GitHub App
|
package/bin/npm
ADDED
package/bin/npx
ADDED
package/dist/cli.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts","../src/utils/formatting.ts","../src/utils/meow-with-subcommands.ts","../src/commands/cdxgen.ts","../src/flags.ts","../src/utils/api-helpers.ts","../src/utils/misc.ts","../src/utils/format-issues.ts","../src/commands/info.ts","../src/commands/login.ts","../src/commands/logout.ts","../src/commands/npm.ts","../src/commands/npx.ts","../src/commands/organization.ts","../src/commands/raw-npm.ts","../src/commands/raw-npx.ts","../src/commands/report/view.ts","../src/commands/report/create.ts","../src/commands/report/index.ts","../src/commands/wrapper.ts","../src/commands/scan/create.ts","../src/commands/scan/delete.ts","../src/commands/scan/list.ts","../src/commands/scan/metadata.ts","../src/commands/scan/stream.ts","../src/commands/scan/index.ts","../src/commands/audit-log.ts","../src/commands/repos/create.ts","../src/commands/repos/delete.ts","../src/commands/repos/list.ts","../src/commands/repos/update.ts","../src/commands/repos/view.ts","../src/commands/repos/index.ts","../src/commands/dependencies.ts","../src/commands/index.ts"],"names":[],"mappings":""}
|