Skip to content

feat: add dprint install command - #1339

Merged
dsherret merged 4 commits into
mainfrom
feat-install-command
Oct 11, 2026
Merged

dsherret merged 4 commits into
mainfrom
feat-install-command

Conversation

@dsherret

Copy link
Copy Markdown
Member

Adds dprint install (and the equivalent dprint config install) for downloading and setting up plugins ahead of time instead of on first use.

  • dprint install installs the plugins in the configuration file. The config file is found the same way as for dprint add (including the global config fallback and DPRINT_CONFIG_DISCOVERY).
  • dprint install -g installs the plugins in the global configuration file.
  • dprint install <plugin>... acts like dprint add <plugin>... (same flags) and then installs everything in the configuration file.
  • dprint install --recursive also installs the plugins of the configuration files in descendant directories.

This is groundwork for eventually no longer automatically installing process plugins in the language server.

Notes

  • Without --recursive the plugins are only resolved (downloaded, verified, compiled/extracted into the cache) and never started, so process plugins aren't spawned.
  • --recursive reuses the same resolution as dprint fmt to find descendant config files, so it skips config files in gitignored or excluded directories and stops at the first config that fails to resolve.
  • --plugins is rejected for this sub command, since it would override the plugins being installed.
  • The flags that only apply when adding (--checksum, --no-version, --package-json, --minimum-dependency-age) require a plugin to be provided.

Known gaps for the LSP follow-up

  • A main config with "inherit": true doesn't inherit in the CLI (only descendant configs do), while the LSP always inherits from the ancestor config, so dprint install in such a directory doesn't install the inherited plugins.
  • The LSP uses the nearest config of the opened file regardless of excludes/gitignore, which --recursive skips.
  • The plugin cache key includes the rustc version of the build, so a dprint upgrade orphans cached process plugins and dprint install would need to be run again.

@dsherret
dsherret merged commit 42c5437 into main Oct 11, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant