HubSpot CMS CLI user experience improvements
The CMS CLI has been updated, adding a lot of new user experience improvements. Better secret management, command completion, browser shortcuts, interact with the developer file system in new ways and more!
What’s happening?
We're introducing many new CLI (Command Line Interface) features and an under the hood change that will lead to even more useful features down the road. The CLI documentation has been updated to reflect these updates.
New ways to work with the developer file system
Previously you had to open the design manager to view the location of files in the developer file system. We now have a way to list the files and directories without fetching them to your local environment. This can be a great way to make sure you're watching or uploading to the intended directory, or ensuring you're fetching the correct one down.
Now in beta - move files in the developer file system directly from the command line.
User experience updates for Serverless functions
Got a lot of serverless functions? There's a new command to list the functions and useful information about them.
Trying to debug a function but have a lot of detailed logs? You can now limit how many logs the command outputs using the new --limits=<number>
argument.
The CMS CLI’s hs secrets add
and hs secrets update
serverless commands have been updated so you are no longer submitting the API key with the commands causing it to be logged in your terminal’s history. Instead, running the commands now prompt the user for the secret and visually obfuscate the value using asterisk characters as illustrated below:
While this update does not break any existing secrets that you have added, this does change the way in which secrets are added or updated through the CLI and therefore may modify your development workflow in order to use this new command.
Browser shortcuts
As a developer, there are a lot of parts of the HubSpot app that you interact with frequently. Whether it's HubDB, navigation settings, redirects, website pages, website settings, content staging or the design manager. Using the CLI you can now open any of those resources and more into your browser directly from the command line using hs open
. Use hs open --list
to get a full list of available shortcuts and their aliases.
When is this happening?
This update is live as of today. You will need to update your CLI Tools by using the npm install -g @hubspot/cms-cli@latest
command to take advantage of these features.