Skip to content

Commit 441cc97

Browse files
authored
Add vendor operation to README (#7)
The vendor command was added in #5 but the README wasn't updated to document it.
1 parent 2f87105 commit 441cc97

1 file changed

Lines changed: 14 additions & 2 deletions

File tree

README.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ A Go library that wraps package manager CLIs behind a common interface. Part of
44

55
## What it does
66

7-
Translates generic operations (install, add, remove, list, outdated, update) into the correct CLI commands for each package manager. Define what you want to do once, and the library figures out the right command for npm, bundler, cargo, go, or any other supported manager.
7+
Translates generic operations (install, add, remove, list, outdated, update, vendor) into the correct CLI commands for each package manager. Define what you want to do once, and the library figures out the right command for npm, bundler, cargo, go, or any other supported manager.
88

99
```go
1010
translator := managers.NewTranslator()
@@ -82,7 +82,7 @@ cmd, _ = translator.BuildCommand("bundler", "add", managers.CommandInput{
8282
| helm | helm | Chart.lock |
8383
| brew | homebrew | - |
8484

85-
Most managers support: install, add, remove, list, outdated, update. Some managers (maven, gradle, sbt, lein) have limited CLI support for add/remove operations.
85+
Most managers support: install, add, remove, list, outdated, update. Some also support vendor and path. Some managers (maven, gradle, sbt, lein) have limited CLI support for add/remove operations.
8686

8787
## Installation
8888

@@ -217,6 +217,7 @@ Built-in policies include AllowAllPolicy, DenyAllPolicy, and PackageBlocklistPol
217217
| `outdated` | Show packages with available updates |
218218
| `update` | Update dependencies |
219219
| `path` | Get filesystem path to installed package |
220+
| `vendor` | Copy dependencies into the project directory |
220221

221222
### Common flags
222223

@@ -240,6 +241,17 @@ The library handles extracting clean paths from various output formats (JSON, li
240241

241242
**Managers with path support:** npm, pnpm, yarn, bun, bundler, gem, pip, uv, poetry, conda, gomod, cargo, composer, brew, deno, nimble, opam, luarocks, conan, mix, shards, rebar3
242243

244+
### Vendoring dependencies
245+
246+
The `vendor` operation copies dependencies into the project directory for offline builds or source inspection:
247+
248+
```go
249+
manager, _ := managers.Detect("/path/to/project")
250+
result, _ := manager.Vendor(ctx)
251+
```
252+
253+
**Managers with vendor support:** gomod, cargo, bundler, pip, rebar3
254+
243255
### Escape hatch
244256

245257
For manager-specific flags not covered by the common interface, use `Extra`:

0 commit comments

Comments
 (0)