Code Contributions
Advanced: Package Linking

Advanced: Package Linking

In this guide, we’ll teach you how to link the CopilotKit packages to your own project to test your changes. This way, you can run turbo run dev in the CopilotKit monorepo, and see changes in your own project immediately.

Global Package Linking With pnpm

We will use pnpm’s global linking feature to link the CopilotKit packages to your own project.

In The CopilotKit Monorepo

Assuming you followed all steps in the How To Contribute guide, you should have everything set up properly and ready to go.

Navigate to the CopilotKit monorepo and run the following command to link the packages globally:

turbo run link:global

In Your Project

In your project, ensure you have pnpm configured. This will not prevent you from using npm or yarn as well. But for the purpose of global linking, you must use pnpm.

cd your-project
pnpm i

Next, link the desired package in your project:

# For example, to link the @copilotkit/react-core package:
pnpm link --global @copilotkit/react-core

You can run this for all packages, or just the ones you need. Your changes will now be synced.

Unlinking

Once you are done, you can undo the global linking by running the following command in the CopilotKit monorepo:

turbo run unlink:global

And then in your project:

pnpm install

That’s it, everything is now back to normal!

Need help?

If you need help with anything, please don’t hesitate to reach out to us on Discord. We have a dedicated #contributing channel.


© Tawkit, Inc. All rights reserved.