Skip to content

Commit be04e96

Browse files
committed
docs: explain org dependency inventory
1 parent 1dfdd04 commit be04e96

2 files changed

Lines changed: 68 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: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
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 API
22+
accepts values from 1 to 100. The default is 50. Use `--offset` to skip that
23+
many dependency artifacts; the default is 0.
24+
For example, request results in batches of 20:
25+
26+
```sh
27+
socket organization dependencies --limit 20 --offset 0
28+
socket organization dependencies --limit 20 --offset 20
29+
socket organization dependencies --limit 20 --offset 40
30+
```
31+
32+
Check the output's “Is there more data after this?” value. Continue with the
33+
next offset until it says `no`. The limit applies to dependency artifacts. An
34+
artifact can have more than one repository link, so the displayed row count
35+
can be greater than the limit. Each invocation makes one request; the command
36+
does not paginate automatically.
37+
38+
## Choose an output format
39+
40+
The default output and `--markdown` display a text table with ecosystem,
41+
namespace, name, version, repository, branch, and direct dependency columns.
42+
The output also shows the requested offset and limit and whether more data is
43+
available.
44+
45+
Use `--json` to write the result envelope to a file:
46+
47+
```sh
48+
socket organization dependencies --json > dependencies.json
49+
```
50+
51+
On success, the JSON envelope contains `ok` and `data`. Read dependency rows
52+
from `data.rows`; `data` also includes `end`, `limit`, and `offset`. The
53+
`--json` and `--markdown` options cannot be used together.
54+
55+
## Help and dry run
56+
57+
Use `--help` to see the available options:
58+
59+
```sh
60+
socket organization dependencies --help
61+
```
62+
63+
A dry run does not retrieve inventory. It only reports what the command would
64+
request. On the 2.x prerelease, dry run requires authentication and reports the
65+
selected limit and offset. On 1.x, it exits before making a request and prints
66+
a generic dry-run message.

0 commit comments

Comments
 (0)