open-index/open-npm huggingface dataset:
npm package: @hubspot/cli
Description: The official CLI for developing on HubSpot
Latest version: 8.4.0

# @hubspot/cli

[![Official Release](https://img.shields.io/npm/v/@hubspot/cli/latest?label=Official%20Release)](https://www.npmjs.com/package/@hubspot/cli) [![Latest Beta Version](https://img.shields.io/npm/v/@hubspot/cli/next?label=Latest%20Beta%20Version)](https://www.npmjs.com/package/@hubspot/cli?activeTab=versions)

A CLI for HubSpot developers to enable local development and automation. [Learn more about building on HubSpot](https://developers.hubspot.com).

## Getting started

For more information on using these tools, see [Local Development Tooling: Getting Started](https://developers.hubspot.com/docs/cms/guides/getting-started-with-local-development)

### Installation

```bash
npm install -g @hubspot/cli
```

### Configuring

Once the `@hubspot/cli` has been added to a project, a config file named [hubspot.config.yml](../../docs/HubspotConfigFile.md) will also be needed. It is recommended that the config file is kept in your `$HOME` directory.

```bash
cd ~
hs init
```

#### Auto Completion

You can set up command autocompletion by running

```bash
hs completion
```

and copying the output to either your `.bashrc` or `.zshrc`, and then sourcing that file `source ~/.bashrc` `source ~/.zshrc` or restarting your terminal.

## Commands

A full breakdown of the commands can be found on the [local development tools reference page](https://developers.hubspot.com/docs/cms/developer-reference/local-development-cli).

**Note:** When `@hubspot/cli` is installed local to a project, the commands need to be prefixed with either `yarn` if using `yarn` or `npx` if using `npm`.

## Authentication

There are two ways that the tools can authenticate with HubSpot.

### Personal Access Key (recommended)

1. Run `hs init` or `hs auth personalaccesskey` and follow the instructions

### OAuth2

1. [Create a developer app](https://developers.hubspot.com/docs/faq/how-do-i-create-an-app-in-hubspot)
2. Run `hs auth oauth2`
3. Select `OAuth2` and follow the steps

_**Note:** The Account ID used should be the Test Account ID (not the developer app ID). Client ID and Client Secret are from the developer app._

### Exit Codes

The CLI will exit with one of the following exit codes:

- `0`: A successful run
- `1`: There was a config problem or an internal error
- `2`: There are warnings or validation issues

## Changelog

The best way to stay up to date is to check out the [Github Releases](https://github.com/HubSpot/hubspot-cli/releases) and also follow our [developer changelog posts](https://developers.hubspot.com/changelog) for an easier to read breakdown of major changes.
npm package: @hubspot/create-cms-project
Description: Create HubSpot CMS projects
Latest version: 2.2.3

# create-cms-project

```shell
Usage: create-cms-project <cms-project-name> [options]

Options:
  -v, --version       output the version number
  -r, --repo [repo]   specify CMS boilerplate git repo to clone (default: "HubSpot/cms-theme-boilerplate")
  -s, --ssh           use SSH to clone CMS boilerplate git repo
  -i, --skip-install  skip installation of boilerplate deps
  -h, --help          output usage information
```
npm package: @hubspot/create-cms-theme
Description: HubSpot CMS React starter theme
Author: HubSpot
Latest version: 1.2.25

# Create HubSpot CMS Theme

The quickest way to get started using CMS React is by using `@hubspot/create-cms-theme`. This CLI tool will generate a starter theme for you to use as a starting point with all the configuration complete and a set of example building blocks to reference or build upon. Speeding up your ability to begin local development with the HubSpot CMS.

### Prerequisites
- Node.js (version 20 or higher)
- A HubSpot CMS Developer account (or access to a HubSpot portal with CMS access)
- NPM or Yarn package manager

### To get started, run the following command:

```bash
npx @hubspot/create-cms-theme@latest
```
After running the command, you will be prompted to answer a few questions to customize your starter theme.

#### Prompts:
```
? What is the name of your theme?
```
This will be the name that appears in the HubSpot CMS UI when selecting a theme and the name of your [Project](https://developers.hubspot.com/beta-docs/guides/crm/developer-projects/create-a-project) when accessing your build/deploy information.

```
? What directory do you want to create your theme in?
```
This is the parent directory that we will create your theme in. For example if the answer to `What is the name of your theme?` is `MyCmsReactTheme` and the answer to this question is `/your-theme-directory`, then the starter theme will be created in `/your-theme-directory/MyCmsReactTheme`.

```
? Do you want to use TypeScript?
```
This will determine if we setup your theme with TypeScript. If you select `No`, we will setup your theme with JavaScript.

#### Directory Structure
Upon completion, your theme will have this structure:
```
your-theme-directory/
├── src/
│   └── theme/
│       ├── assets/
│       ├── components/
│       │   └── modules/
│       ├── styles/
│       ├── templates/
│       ├── fields.json
│       ├── theme.json
│       └── package.json
├── package.json
├── hsproject.json
```

## Local Development
After creating your theme, you can begin local development by running:
   ```bash
   npm run start
   ```

## Additional Resources
- [CMS React Documentation](https://github.hubspot.com/cms-react/)
- [Join the HubSpot developer slack channel](https://developers.hubspot.com/beta-docs/getting-started/slack/developer-slack)
- [HubSpot CMS Developer Docs](https://developers.hubspot.com/docs/)
npm package: @hubspot/project-parsing-lib
Description: Parsing library for converting projects directory structures to their intermediate representation
Latest version: 0.13.0

# @hubspot/project-parsing-lib

A parsing library for converting HubSpot project directory structures to their intermediate representation (IR).

## Description

This library provides functionality to parse HubSpot project structures and convert them into an intermediate representation that can be uploaded to HubSpot. It walks through project directories, locates `.hsmeta.json` files, validates them, and generates the IR needed for project uploads.
npm package: @hubspot/serverless-dev-runtime
Description: A tool for testing HubSpot CMS serverless functions locally
Latest version: 7.0.7

# @hubspot/serverless-dev-runtime

A serverless function development runtime that can be used to test CMS serverless functions. This is intended for use with the [HubSpot CLI](https://developers.hubspot.com/docs/cms/developer-reference/local-development-cms-cli).

⚠️ **This is a BETA release that uses some HubSpot features that are not available to all customer accounts. Please refer to the HubSpot [Developer Beta Terms](https://legal.hubspot.com/developerbetaterms)** ⚠️

## Getting started

For more information on using these tools, see [Local Development Tooling: Getting Started](https://designers.hubspot.com/tutorials/getting-started-with-local-development).

### Usage

#### CLI Command (recommended)
Using the CLI to run serverless functions locally, requires installing [@hubspot/cli](https://www.npmjs.com/package/@hubspot/cms-cli). Once installed, to test your functions run…

```bash
hs functions test <folder.functions>
```

#### Importing

It also is possible to use the runtime inside your own tooling. To start the server, the `start` method can be imported from the `@hubspot/serverless-dev-runtime` package and run with settings like so...

```bash
const { start } = require('@hubspot/serverless-dev-runtime');

start({
  accountId: <portalId/accountId>,                                                  // default: 123456
  contact: <booleanValueToSpecifyIfContactDataShouldBePassedToServerlessFunction>,  // default: true
  path: <pathToLocalDotFunctionsFolder>,                                            // required
  port: <customPortToRunServerOn>                                                   // default: 5432
});
```

### Mocked Data
Some of the data that is passed to the serverless function context is mocked. Specifically the `contact` and `limits` properties. It is possible
to modify the mocked data by setting values for specific variables within a `.env` file within the `.functions` folder.

The variables used to modify the data are:

```
HUBSPOT_LIMITS_TIME_REMAINING       // default: 600000
HUBSPOT_LIMITS_EXECUTIONS_REMAINING // default: 60
HUBSPOT_CONTACT_VID                 // default: 123
HUBSPOT_CONTACT_IS_LOGGED_IN        // default: false
HUBSPOT_CONTACT_LIST_MEMBERSHIPS    // default: []
```

Usage example `.env`:

```
HUBSPOT_LIMITS_TIME_REMAINING=1000
HUBSPOT_LIMITS_EXECUTIONS_REMAINING=2
HUBSPOT_CONTACT_VID=456
HUBSPOT_CONTACT_IS_LOGGED_IN=true
HUBSPOT_CONTACT_LIST_MEMBERSHIPS="some, memberships"
```