Skip to content

Commit 3d151d5

Browse files
committed
Cleanup docs and help text
1 parent 752c635 commit 3d151d5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+143
-163
lines changed

README.md

Lines changed: 37 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
[![Socket Badge](https://socket.dev/api/badge/npm/package/socket)](https://socket.dev/npm/package/socket)
44
[![Follow @SocketSecurity](https://img.shields.io/twitter/follow/SocketSecurity?style=social)](https://twitter.com/SocketSecurity)
55

6-
> CLI tool for [Socket.dev]
6+
CLI for [Socket.dev] security analysis
77

88
## Usage
99

@@ -14,97 +14,78 @@ socket --help
1414

1515
## Commands
1616

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
2018

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
2420

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
2722

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
3224

3325
## Aliases
3426

3527
All aliases support the flags and arguments of the commands they alias.
3628

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)
3830

3931
## Flags
4032

4133
### Output flags
4234

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
4537

4638
### Other flags
4739

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
5446

5547
## Configuration files
5648

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.
6151

6252
## Environment variables
6353

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
7865

7966
## Contributing
8067

81-
### Setup
82-
83-
To run locally execute the following commands:
68+
Run locally:
8469

8570
```
8671
npm install
8772
npm run build
8873
npm exec socket
8974
```
9075

91-
### Environment variables for development
76+
### Development environment variables
9277

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
10183

10284
## See also
10385

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)
10889

10990
[Socket.dev]: https://socket.dev/
11091

src/commands/analytics/cmd-analytics.test.mts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ describe('socket analytics', async () => {
3535
3636
Options
3737
--file Path to store result, only valid with --json/--markdown
38-
--json Output result as json
39-
--markdown Output result as markdown
38+
--json Output as JSON
39+
--markdown Output as Markdown
4040
4141
Examples
4242
$ socket analytics org 7

src/commands/audit-log/cmd-audit-log.test.mts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ describe('socket audit-log', async () => {
4545
Options
4646
--interactive Allow for interactive elements, asking for input.
4747
Use --no-interactive to prevent any input questions, defaulting them to cancel/no.
48-
--json Output result as json
49-
--markdown Output result as markdown
48+
--json Output as JSON
49+
--markdown Output as Markdown
5050
--org Force override the organization slug, overrides the default org from config
5151
--page Result page to fetch
5252
--per-page Results per page - default is 30

src/commands/ci/cmd-ci.mts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ import type {
1313

1414
const config: CliCommandConfig = {
1515
commandName: 'ci',
16-
description: 'Shorthand for `socket scan create --report --no-interactive`',
16+
description:
17+
'Alias for `socket scan create --report` (creates report and exits with error if unhealthy)',
1718
hidden: false,
1819
flags: {
1920
...commonFlags,

src/commands/ci/cmd-ci.test.mts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ describe('socket ci', async () => {
1717
const { code, stderr, stdout } = await spawnSocketCli(binCliPath, cmd)
1818
expect(stdout).toMatchInlineSnapshot(
1919
`
20-
"Shorthand for \`socket scan create --report --no-interactive\`
20+
"Alias for \`socket scan create --report\` (creates report and exits with error if unhealthy)
2121
2222
Usage
2323
$ socket ci [options]

src/commands/cli.test.mts

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,10 @@ describe('socket root command', async () => {
3030
socket login Setup Socket CLI with an API token and defaults
3131
socket scan create Create a new Socket scan and report
3232
socket npm/lodash@4.17.21 Request the Socket score of a package
33-
socket ci Shorthand for \`socket scan create --report --no-interactive\`
33+
socket fix Fix CVEs in dependencies
34+
socket optimize Optimize dependencies with @socketregistry overrides
35+
socket cdxgen Run cdxgen for SBOM generation
36+
socket ci Alias for \`socket scan create --report\` (creates report and exits with error if unhealthy)
3437
3538
Socket API
3639
analytics Look up analytics data
@@ -42,11 +45,9 @@ describe('socket root command', async () => {
4245
threat-feed [Beta] View the threat-feed
4346
4447
Local tools
45-
fix Update dependencies with "fixable" Socket alerts
4648
manifest Generate a dependency manifest for certain ecosystems
47-
npm Run npm with the Socket wrapper
48-
npx Run npx with the Socket wrapper
49-
optimize Optimize dependencies with @socketregistry overrides
49+
npm Wraps npm with Socket security scanning
50+
npx Wraps npx with Socket security scanning
5051
raw-npm Run npm without the Socket wrapper
5152
raw-npx Run npx without the Socket wrapper
5253
@@ -63,9 +64,9 @@ describe('socket root command', async () => {
6364
6465
--compact-header Use compact single-line header format (auto-enabled in CI)
6566
--config Override the local config with this JSON
66-
--dry-run Do input validation for a command and exit 0 when input is ok
67-
--help Print this help
68-
--help-full Print full help including environment variables
67+
--dry-run Run without uploading
68+
--help Show help
69+
--help-full Show full help including environment variables
6970
--no-banner Hide the Socket banner
7071
--no-spinner Hide the console spinner
7172
--version Print the app version

src/commands/config/cmd-config-auto.test.mts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ describe('socket config auto', async () => {
2323
$ socket config auto [options] KEY
2424
2525
Options
26-
--json Output result as json
27-
--markdown Output result as markdown
26+
--json Output as JSON
27+
--markdown Output as Markdown
2828
2929
Attempt to automatically discover the correct value for a given config KEY.
3030

src/commands/config/cmd-config-get.test.mts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ describe('socket config get', async () => {
2727
config then the value will come from that override.
2828
2929
Options
30-
--json Output result as json
31-
--markdown Output result as markdown
30+
--json Output as JSON
31+
--markdown Output as Markdown
3232
3333
KEY is an enum. Valid keys:
3434

src/commands/config/cmd-config-list.test.mts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ describe('socket config get', async () => {
2626
2727
Options
2828
--full Show full tokens in plaintext (unsafe)
29-
--json Output result as json
30-
--markdown Output result as markdown
29+
--json Output as JSON
30+
--markdown Output as Markdown
3131
3232
Examples
3333
$ socket config list"

src/commands/config/cmd-config-set.test.mts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ describe('socket config get', async () => {
2525
$ socket config set [options] <KEY> <VALUE>
2626
2727
Options
28-
--json Output result as json
29-
--markdown Output result as markdown
28+
--json Output as JSON
29+
--markdown Output as Markdown
3030
3131
This is a crude way of updating the local configuration for this CLI tool.
3232

0 commit comments

Comments
 (0)