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
Add Init() to the Manager interface and CapInit capability. Adds init
command definitions to 30 of 36 managers that support non-interactive
project initialization.
Managers without init: brew, cpanm, gem, maven, pip, sbt (global
installers or interactive-only init).
Copy file name to clipboardExpand all lines: README.md
+15-2Lines changed: 15 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: init, 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. A few global installers (brew, gem, cpanm) and managers with interactive-only init (maven, pip, sbt) do not have init support.
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,18 @@ 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 with the package manager's default manifest file. This is useful for creating temporary projects for dependency resolution or scaffolding new projects.
0 commit comments