A command-line interface for interacting with the Hubify API.
The Hubify CLI simplifies the process of environment setup and subsequent management of hub scripts deployed on hubify.com.
curl http://npmjs.org/install.sh | sh
Installing Hubify CLI
[sudo] npm install -g hubify
Create a working directory where your scripts will live:
$ mkdir my_username && cd my_username
$ hubify init
This command will prompt you for your Hubify username and API key. Your API key can be found on the edit profile page once logged in over at hubify.com.
This will download both the necessary and available libraries for your script once deployed.
The current feature set is quite limited. Only automated deployments are supported which means you will need to copy/paste existing scripts from hubify.com to your local environment. Creating new hubs must also be done from the hubify website.
By convention scripts should be named
<slug>.js where slug
is the slugified version of your hub's name. For example if your
hub's name is My 1st Hub then your script name should be
my-1st-hub.js. This generally means replacing spaces and
special charachters with dashes. If you're unsure of what your
hub's slug name is you should take a look at your hub's endpoint.
The slug will be the portion after the last "/" and before the format
".json" (e.g. http://hubify.com/username/hub/my-1st-hub.json)
Once you've copied your hub down into your local work directory you can deploy by running:
$ hubify deploy my-1st-hub
A word of warning: The change will take effect immediately. In case you need to rollback, a backup of the previous script is created with the .bak extension in your working directory. This can be deployed using the
-fswitch to specify an alternate file to use instead of the default. For example:
$ hubify deploy -f my-1st-hub.js.bak my-1st-hub