# Creating a new local package

This page provides instructions on how to create a new local package to share code between applications in a Caplin Trader workspace.

## Requirements

Packages for Caplin Trader 5 applications are created within the context of a Caplin Trader development workspace. For more information on creating a development workspace, see Creating a new workspace.

## Creating a new local package

You create a local package by using Caplin CLI’s `create-package` command:

`$caplin-cli create-package <package-name>` To create a new local package called my-package, for example, follow the steps below: 1. From the root directory of your CT5 development workspace, run the command below to create a local package called my-package: `$ caplin-cli create-package my-package`

Your new local package has the following structure:

2. Change directory to `<workspace>/packages/my-package`, and run the command below to download the new package’s dependencies:

## Updating a local package in an application

Each time you update the source code for your local package under your workspace’s `packages` directory, you will need to update your application’s copy of the local package.

Run the command below from your application’s root directory to update its copy of the local package:

`$yarn upgrade <package-name>` If your local package is in active development, running `yarn upgrade` each time you change your package’s code can quickly become tedious. To save time, you can use the `yarn link` command to symlink your application’s copy of the package to the local package. Follow the steps below: 1. In the local package’s directory, run `yarn link`: ``````$ cd ~/dev/ct5-workspace/package/my-package
$yarn link yarn link v1.10.1 success Registered "my-package". info You can now run `yarn link "my-package"` in the projects where you want to use this package and it will be used instead. Done in 0.04s.`````` 2. Run the command below from the root directory of your application: ``````$ cd ~/dev/ct5-workspace/apps/my-app