You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+17-2Lines changed: 17 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ A Go library that wraps package manager CLIs behind a common interface. Part of
4
4
5
5
## What it does
6
6
7
-
Translates generic operations (install, add, remove, list, outdated, update, vendor, resolve) 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 (init, install, add, remove, list, outdated, update, vendor, resolve) 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.
Most managers support: install, add, remove, list, outdated, update, resolve. Some also support vendor and path. Some managers (maven, gradle, sbt, lein) have limited CLI support for add/remove operations.
86
+
Most managers support: install, add, remove, list, outdated, update, resolve. Some also support init, vendor and path. Some managers (maven, gradle, sbt, lein) have limited CLI support for add/remove operations.
87
87
88
88
## Installation
89
89
@@ -211,6 +211,7 @@ Built-in policies include AllowAllPolicy, DenyAllPolicy, and PackageBlocklistPol
211
211
212
212
| Operation | Description |
213
213
|-----------|-------------|
214
+
|`init`| Initialize a new project with manifest file |
214
215
|`install`| Install dependencies from lockfile |
215
216
|`add`| Add a new dependency |
216
217
|`remove`| Remove a dependency |
@@ -229,6 +230,20 @@ Built-in policies include AllowAllPolicy, DenyAllPolicy, and PackageBlocklistPol
229
230
|`frozen`| Fail if lockfile would change (CI mode) |
230
231
|`json`| Output in JSON format (where supported) |
231
232
233
+
### Initializing projects
234
+
235
+
The `init` operation creates a new project manifest in the current directory. This is useful for creating temporary projects for dependency resolution or scaffolding new projects.
// Creates package.json (npm), Gemfile (bundler), Cargo.toml (cargo), etc.
241
+
```
242
+
243
+
Only managers that can scaffold in-place are supported. Managers whose `new` command always creates a child directory (mix, lein, helm, stack, pub, rebar3) or whose `init` command bootstraps global state rather than a project (opam) are excluded.
0 commit comments