hs auth.
View all commands
List all project-specific CLI commands.Create a new project
Create a project in a specified directory. You’ll be prompted to give the project a name, confirm the local location on your computer, and specify additional configuration details. A new folder will be created in the specified directory containing anhsproject.json file and an src folder where you’ll build out your project components.
Once you’ve created a project, you can run other project commands inside your project directory and HubSpot will automatically recognize your project.
Add a feature to a project
To add a new feature to an existing app, run the following command:- Press spacebar to select a feature.
- Press the a key to toggle all features.
- Press the i key to invert your current selection.
- Press the enter key to confirm your choices and proceed.
Upload to HubSpot
Upload the project to your HubSpot account and create a build. If the project hasn’t been created in the account yet, you’ll be asked whether you want to create it. If the project is configured to auto-deploy, this command will automatically deploy after the build is successful. By default, new projects are set to auto-deploy.
You can upload a project to a specific account in your
~/.hscli/config.yml file by adding --account=accountName to the command. For example, hs project upload --account=main. This can be useful when switching between uploading to a sandbox account and then uploading to the main account. For example, your workflow might look like:
- When developing your project in a sandbox, you upload changes with
hs project upload --account=sandbox. - Then when uploading the project to a main account, you upload the project with
hs project upload --account=main.
Download from HubSpot
Download the last uploaded version of a project to your local computer.Deploy to HubSpot
Manually deploy the most recent build if the project is not set to auto-deploy.List builds
List build history for a project.List projects
Display existing projects that have already been uploaded to your account.View logs for an installed app
Review and filter logs for one of your apps directly from the command line.View specific log entry for an installed app
Review the full details of a specific log entry for one of your installed apps. Details include request and response bodies, additional context, and error information.
Flags
Install app in an account using static auth
Install your app in a HubSpot account using a static auth token.Install dependencies
Install dependencies (either from HubSpot or a third-party library) for your project, or add a dependency to a project subcomponent.hs project install-deps dependency1 dependency2).
Update dependencies
Update dependencies (either from HubSpot or a third-party library) for your project, or update the specific dependencies for a project subcomponent.hs project update-deps dependency1 dependency2).
Migrate a public app
Migrate a public app to the projects framework. Use this command for non-project-based legacy public apps. Learn more in the migration overview.Migrate an existing project
Migrate an existing project to the new version of the projects framework. Use this command for apps that are already project-based but use an older version of the developer platform. Learn more in the app migration guide.Start a local development server
Start a local development server to view extension changes in the browser without needing to refresh. With the server running, saving changes to any JSX files when you’re developing an app card or settings page using UI components will cause the page to automatically refresh. This does not include changes made to the.json config files, which need to be manually uploaded using the hs project upload command instead.
Open project in HubSpot
Opens the project in HubSpot where you can view the project’s settings, build history, and more. By default, will attempt to open the project in the default account set in~/.hscli/config.yml. Specify an account by adding the --account=accountName flag.
Get project information
Display project and app metadata, including details for any components you’ve configured such as app cards or serverless functions.Watch for changes
Watches the project directory and uploads to HubSpot upon saving, including deleting files. Each upload will result in a new build with a new build ID. A successful build will deploy automatically if the project’s auto-deploy setting is turned on.---account=accountName. For example, hs project watch --account=main.
View logs
Get logs for a specific function within a project.Analyze and validate code
To validate the configuration of your project components like your app cards and settings pages, you can statically analyze your project using ESLint v9.devDependencies for each project component, and define each dependency and its minimum version.
This will create an ESLint configuration file for each project component, and warn about existing ESLint files that are deprecated (non-flat files created before ESLint v9).
Validate project
Verify that your project’sapp-hsmeta.json configuration file is valid and your project is ready to upload to your HubSpot account.
Delete a project
Delete a project from your HubSpot account. You will be prompted to confirm the deletion before proceeding. You can use the--force flag to bypass this confirmation.