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 contribution 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:globalIn 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 iNext, link the desired package in your project:
# For example, to link the @copilotkit/react-core package:
pnpm link --global @copilotkit/react-coreYou 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:globalAnd then in your project:
pnpm installThat'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.
