# v0.80 Plugin Installation+Registry {%hackmd theme-dark %} As part of v0.80, we are considering moving a lot of Nu's functionality into plugins. This has some advantages, but one big disadvantage is that we lose Nu's ability to be deployed as a single executable. Copying 1 executable to a server is much simpler than copying multiple files and running `register`. If we move most of Nu's functionality into plugins, we should consider streamlining the current process of acquiring+registering plugins. ## Installation UX As discussed [here](https://github.com/nushell/nushell.github.io/pull/656#issuecomment-1304642002), it would be nice to have a command (`install plugin`?) that handles downloading and registering plugins. For example: ```bash install plugin --all # install all official plugins install plugin --list # show all official plugins install plugin excel # install the official Excel plugin ``` A nice-to-have: when a user tries to run a command that is present in an uninstalled plugin, Nu could suggest installing the plugin. ## Plugin Registry (Nu Plugin Manager?) MVP To implement something like `install plugin`, we will need to host plugin DLLs somewhere. Let's call it NPM for now. A minimal viable product could be something like: 1. Plugins are built in CI as part of Nu's release pipeline, then uploaded to an S3 bucket 2. A server-side process monitors for new files in the bucket, and then: 1. Checks the OS+architecture of the DLL and moves it to the correct location 2. Updates a JSON file containing a list of available plugins For example: 1. CI builds v0.81 of the dataframe plugin for Windows x64 2. CI uploads `nu_dataframe_plugin_v0.81.dll` to a known S3 bucket 3. A serverless function notices the new file, and then: 1. Checks the DLL's OS+architecture with `goblin` 2. Copies the DLL to a location acessible at https://npm.nushell.sh/dataframe/0.81/win-x64/nu_dataframe_plugin.dll 3. Updates https://npm.nushell.sh/all.json to include the new DLL 4. A user runs `install plugin dataframe` on Windows x64 1. `install plugin` downloads https://npm.nushell.sh/all.json and finds the URL for the latest version of the `dataframe` plugin 2. `install plugin` downloads `nu_dataframe_plugin.dll` to a known location 3. `install plugin` registers the plugin in `plugin.nu` ## Open Questions - Will users be comfortable with `install plugin` downloading+running executable code? - Downloading plugins may be blocked in some corporate environments - Linux distros tend to want to compile everything from scratch; should we support that? - Are we capable of committing enough time+energy to run a package manager? - I've never run something like this for the public; I worry about the maintenance burden and unknown unknowns - We should reach out to someone who has worked on a package manager before (like Kat) and get their thoughts - How should we handle versioning? - How do plugin versions map to Nu versions? - When a user upgrades/replaces their Nu exe, do we automatically upgrade their plugins? - We can automate plugin builds for Linux+macOS+Windows; what's the install story like for other platforms (like BSD?) - Should we attempt to streamline installation of third-party plugins? - Perhaps something like `install plugin --url https://files.reillywood.com/my_nu_plugin.dll`? - Are we missing any security considerations? - As long as we're careful about access to the S3 bucket, I don't *think* this is meaningfully less secure than our current plugin model