Skip to content

Commit c511a4d

Browse files
committed
docs: explain org dependency inventory
1 parent 977981f commit c511a4d

2 files changed

Lines changed: 67 additions & 0 deletions

File tree

‎README.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,8 @@ Supports version 2 format with `projectIgnorePaths` for excluding files from rep
141141

142142
### See also
143143

144+
- [Organization dependency inventory guide](docs/organization-dependencies.md)
145+
144146
- [Socket API Reference](https://docs.socket.dev/reference)
145147
- [Socket GitHub App](https://github.com/apps/socket-security)
146148
- [`@socketsecurity/sdk`](https://github.com/SocketDev/socket-sdk-js)

‎docs/organization-dependencies.md‎

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# Organization dependency inventory
2+
3+
`socket organization dependencies` lists dependency records already known to
4+
the authenticated organization. It does not scan the current directory. This
5+
command does not accept a package name or an organization slug.
6+
7+
## Access
8+
9+
Run `socket login` to save a Socket API token, or set the supported
10+
`SOCKET_CLI_API_TOKEN` environment variable. The inventory available to the
11+
command depends on the credential you use. The command requires API access.
12+
13+
## List dependencies
14+
15+
Run the command without options to request the first 50 dependency artifacts:
16+
17+
```sh
18+
socket organization dependencies
19+
```
20+
21+
Use `--limit` to set the number of dependency artifacts requested. The default
22+
is 50. Use `--offset` to skip that many dependency artifacts; the default is 0.
23+
For example, request results in batches of 20:
24+
25+
```sh
26+
socket organization dependencies --limit 20 --offset 0
27+
socket organization dependencies --limit 20 --offset 20
28+
socket organization dependencies --limit 20 --offset 40
29+
```
30+
31+
Check the output's “Is there more data after this?” value. Continue with the
32+
next offset until it says `no`. The limit applies to dependency artifacts. An
33+
artifact can have more than one repository link, so the displayed row count
34+
can be greater than the limit. Each invocation makes one request; the command
35+
does not paginate automatically.
36+
37+
## Choose an output format
38+
39+
The default output and `--markdown` display a text table with ecosystem,
40+
namespace, name, version, repository, branch, and direct dependency columns.
41+
The output also shows the requested offset and limit and whether more data is
42+
available.
43+
44+
Use `--json` to write the result envelope to a file:
45+
46+
```sh
47+
socket organization dependencies --json > dependencies.json
48+
```
49+
50+
On success, the JSON envelope contains `ok` and `data`. Read dependency rows
51+
from `data.rows`; `data` also includes `end`, `limit`, and `offset`. The
52+
`--json` and `--markdown` options cannot be used together.
53+
54+
## Help and dry run
55+
56+
Use `--help` to see the available options:
57+
58+
```sh
59+
socket organization dependencies --help
60+
```
61+
62+
A dry run does not retrieve inventory. It only reports what the command would
63+
request. On the 2.x prerelease, dry run requires authentication and reports the
64+
selected limit and offset. On 1.x, it exits before making a request and prints
65+
a generic dry-run message.

0 commit comments

Comments
 (0)