How To

Install packages in a workspace

Each time you start a workspace, it will use the docker images from the latest successful build of the branch's pipeline. This means that anything your dockerfile (or nixpacks config) installs will automatically be ready to use. This document explains how to install new packages in a running workspace wile adding them for the first time (or if you keep them out of package.json/requirements.txt/Gemfile/etc on purpose)

To install a 3rd party package in a workspace you will need to use the Coherence CLI or cocli.

Open a new terminal in the workspace and and type cocli exec <name of service> then press enter.

For example:

cocli exec backend

If you are not sure which services are available, type cocli services then press enter. The CLI will return all of the services available.

Installing the package

The CLI will drop you into the container allowing you to install your package.

For example, if you wanted to install a package from NPM:

npm install date-fns

Exiting the container

Once have successfully installed your package, press ctrl + d or type exit to exit the container.

Previous
Customize VSCode workspaces