Skip to content

pluggy install

Add a dependency, refresh the lockfile, or both.

Usage

pluggy install [options] [plugin]
pluggy i [options] [plugin]

Two modes:

  • pluggy install with no argument resolves every declared dep against pluggy.lock. It re-resolves anything that drifted and skips the rest.
  • pluggy install <identifier> adds or updates one dep in the target workspace’s project.json and folds it into the lockfile.

Flags

FlagDefaultNotes
--forceoffRe-resolve every dep even when the lockfile is fresh.
--betaoffInclude Modrinth pre-release versions.
--workspace <name>noneTarget a specific workspace.
--workspacesoffAct across every workspace (only valid at the root).

--workspaces and <plugin> are mutually exclusive. You can’t add one dep to every workspace at once. Pick --workspace <name> instead.

Dependency identifier grammar

FormExample
Modrinth slugworldedit
Modrinth slug + versionworldedit@7.3.15
Local file./libs/my-lib.jar (or any path ending in .jar)
Maven coordinatemaven:net.kyori:adventure-api@4.17.0
Workspace siblingworkspace:api

Full grammar: Dependencies.

Scope rules

The “target workspace” depends on where you run the command and which flags are set.

Location--workspace--workspacesTargets
Inside workspace XunsetunsetX
Repo root, no workspaces declaredn/an/aroot
Repo root, workspaces declaredunsetunsetevery workspace
Repo root, workspaces declaredAunsetA
Repo root, workspaces declaredunsetyesevery workspace (explicit)

With a specific <plugin>, installing at a multi-workspace root without --workspace fails:

error: install: at the workspace root, pass --workspace <name> to pick a target for "<plugin>"

What it writes

Single-identifier install (pluggy install <plugin>):

  • Rewrites the target workspace’s project.json, adding the dep in long form with the resolved concrete version.
  • Rewrites pluggy.lock at the repo root, adding or updating the entry.

Bulk install (pluggy install):

  • Resolves every declared dep across the target scope.
  • Skips entries whose lockfile rows match declared (source, version).
  • Drops orphaned lockfile entries (locked but no longer declared anywhere).
  • Rewrites pluggy.lock.

Bulk install never rewrites project.json. It’s a reconcile, not an add.

Conflict handling

Workspaces can declare the same dep as long as their (source, version) pairs match. When two workspaces pin different versions, install fails:

error: install: conflicting declarations of "adventure-api" across workspaces:
maven:net.kyori:adventure-api@4.17.0 vs maven:net.kyori:adventure-api@4.18.0

Fix this in project.json before install will touch the lockfile.

Human output

$ pluggy install worldedit
✓ Installed worldedit into my_plugin (1 resolved)
$ pluggy install
✓ Installed 3 dependencies
$ pluggy install # (lockfile was already fresh)
lockfile is fresh; nothing to install.

JSON output

{
"status": "success",
"installed": ["worldedit"],
"skipped": []
}

Error cases

TriggerMessage pattern
Unknown slugModrinth API request failed for slug "<slug>": 404 Not Found ...
Unknown Maven coordMaven: could not resolve "<g>:<a>:<v>" from any configured registry. Tried: ...
Missing registries for a Maven depMaven: no registries configured for "<g>:<a>:<v>". Declare a Maven registry in project.json:registries.
Missing local filefile source not found or unreadable: "<path>" (resolved to "<abs>"): ENOENT: ...
Workspace without <name>workspace not found: "<name>". known workspaces: ...
Ambiguous root scopeinstall: at the workspace root, pass --workspace <name> to pick a target for "<plugin>"

See also