# HubSpot CLI
## Installation
1. Install Node.js.
2. Run:
* for Windows
`npm install -g @hubspot/csm-cli`
* for Unix
`sudo npm install -g @hubspot/csm-cli`
3. Run: `hs init` to connect the tools to your HubSpot account.
* First you’ll be guided to create a personal CMS access key to enable authenticated access to your account via the local development tools. You’ll be prompted to press "Enter" when you’re ready to open the Personal CMS Access Key page in your default browser. This page will allow you to view or generate your personal access key, if necessary. (Note: You’ll need to select at least the "Design Manager" permission in order to complete this tutorial.) Copy your access key and paste it in the terminal.
* Next, you’ll enter a name for the account. This name is only seen and used by you, For example, you might use "sandbox" if you're using a developer sandbox or "company.com" if you’re using a full customer account. This name will be used when running commands.
4. Once done, you'll see a success message confirming that a configuration file, hubspot.config.yml, has been created in your current directory.
5. To add credentials for additional portals, run `hs auth`.
## Project
1. Create a project
`hs create website-theme <theme-name>`
2. Upload a project to HubSpot
`hs [filemanager] upload --portal=<name> <local-folder-name> <hubspot-folder-name>`
3. Fetch a project
`hs fetch --portal=<name> <src> [dest] [--overwrite]`
4. Watch a local project and automatically upload changes
`hs watch --portal=<name> <src> <dest>`
5. For other parameters: https://developers.hubspot.com/docs/cms/developer-reference/local-development-cms-cli
For testing git, see https://github.com/anneilustre/sample-hubspot-project