Today I installed the HubSpot CMS CLI successfully! Here are the steps I took:
npm install @hubspot/cli.
mkdir local-cms-dev.
This created my folder called "local-cms-dev". Then I navigated to this folder using cd local-cms-dev.
init
flow. The command on the docs is stated as hs init
but this actually threw an error for me. Error: command not found: hs
. npx hs init
instead. Tried that and it worked!The config file "/Users/rramchandra/local-cms-dev/hubspot.config.yml" was created using your personal access key for account Piccadilly.
npx hs fetch basic
. That worked: Completed fetch of folder "basic" to "/Users/rramchandra/local-cms-dev" from the Design Manager.
"local-cms-dev".
Opening the file "cli.html"
, I added a new HubL rich text area. I just wanted to make a simple change locally, upload it to the design manager, and see the change there too.npx hs upload basic basic
to upload the file to the Design Manager.Uploaded file "/Users/rramchandra/local-cms-dev/basic/cli.html" to "basic/cli.html" [SUCCESS] Uploading files to "basic" in the Design Manager is complete.watch
command: npx hs watch basic basic.
Response: Watcher is ready and watching /Users/rramchandra/local-cms-dev/basic
. Any changes detected will be automatically uploaded and overwrite the current version in the developer file system.
I added a third rich text module into my file, saved it, and immediately saw: Uploaded file /Users/rramchandra/local-cms-dev/basic/cli.html to basic/cli.html
in the terminal.
It took some trial and error on the command line to get this right but it was pretty thrilling to see the changes reflecting in the Design Manager. Overall the process was straightforward enough for a CLI beginner user like me to follow.
I think it could be clarified on the docs, though, that you'd run a command with the npx
prefix if you install it locally. I also expected the changes to appear in theDesign Manager right away, but it needed a refresh.