Add a plugin
A plugin adds commands to buddy. Installing the package is not enough: buddy loads only the plugins listed under
plugins in its config. This guide adds @repobuddy/typescript, which adds buddy ts.
-
Find plugins on npm (optional).
Terminal window pnpm exec buddy plugins searchThe search matches the
repobuddykeyword, so some results are not plugins. A plugin exports anactivatefunction. -
Install
repobuddyand the plugin in the project.Terminal window pnpm add -D repobuddy @repobuddy/typescript -
Create
.repobuddy.jsonin the project root.{"plugins": ["@repobuddy/typescript"]}Or add a
repobuddykey topackage.json:{"repobuddy": {"plugins": ["@repobuddy/typescript"]}}See Config file for every file name
buddyreads. -
Run
buddyfrom the project directory or below it.buddyresolves each plugin from the current directory.
Verify
Section titled “Verify”-
Print the loaded config.
Terminal window pnpm exec buddy --show-configconfig: /home/me/my-app/.repobuddy.json{"plugins": ["@repobuddy/typescript"]} -
Check that the command list includes
ts.Terminal window pnpm exec buddy --helpCommands:plugins, test-scripts, check-deps (check-dependencies), ts -
Check the plugin’s commands.
Terminal window pnpm exec buddy ts --helpUsage: repobuddy ts <command>Commands:build, copy-cjs-package-json (cpj)
Troubleshooting
Section titled “Troubleshooting”A plugin that is listed but not installed prints warnings, and its commands are missing:
Unable to load plugin from not-installed-plugin. Please let the plugin author knows about it.cwd: /home/me/my-apperror: Cannot find package 'not-installed-plugin' imported from .../repobuddy/esm/bin.jsnot a valid plugin not-installed-pluginInstall the package, or remove it from plugins. The same not a valid plugin warning appears for a package that
does not export activate.