Prerequisites
Before using the HubSpot CLI, ensure you have:- Node.js v22.0.0 or newer installed
- HubSpot CMS CLI installed globally
- Access to a HubSpot account with CMS Hub
Authentication
Authenticate with HubSpot
Run the authentication command to connect your local environment to HubSpot:This will prompt you to:
- Enter your HubSpot account ID
- Authorize via browser
- Name your authentication profile
Uploading Theme Files
Upload your compiled theme to HubSpot manually.Build your theme first
Always build before uploading:This compiles Tailwind CSS, bundles JavaScript, and creates a production-ready build.
Watching for Changes
During development, use watch mode to automatically sync changes to HubSpot.The
npm start command uses npm-run-all --parallel watch:* to run all watch tasks simultaneously.Fetching from HubSpot
Download theme files from your HubSpot portal to your local environment.Common CLI Commands
Direct HubSpot CLI Usage
Beyond the npm scripts, you can use HubSpot CLI commands directly:Troubleshooting
Authentication issues:- Ensure you’re watching the correct directory (
./theme) - Check that the remote path exists (
/FreshJuiceDEV) - Restart the watch process
Next Steps
Building for Production
Learn how to create production-ready builds
Version Management
Manage theme versions with automated scripts