# Developing with cob-cli
In a standard development workflow, you typically follow these steps:
- Implementing changes
- Conducting tests
- Deploying.
The cob-cli tool facilitates this process with the utilization of the following commands:
It's essential to note that both commands are effective only after initializing the server using the init
command. This initialization ensures a seamless progression through modification, testing, and deployment phases in your development cycle.

# Testing w/ cob-cli test
Now that the CoB server has been initialized and the chosen customization has been installed, we can begin testing via cob-cli test
. This deploys a local Webpack server accessible at https://localhost:8040.
UI changes in "recordm/customUI" are local only, while other modifications like IntegrationM scripts are copied to the server during testing and reverted when the local process stops.
Relevant flags:
cob-cli test [-d --dashboard <name>] [--localOnly] [--servername <servername>] [--verbose] [--environment <env_name>] [--help]
For example, if the developer was working on a customization in /recordm/customUI/js/customizations
named tickets.js
, it will be served locally by the webpack server and won't be copied into the remote server.
> cob-cli test
Start testingβ¦
Checking test conditions for learning.cultofbits.com
β Check connectivity and permissions
β Check there's no other 'cob-cli test' running locally
β find out branch-for-HEAD
β find out SHA for last-deploy on specified server
β git stash --include-untracked
β git checkout SHA for last-deploy
β Apply last enviroment specifics
β Check last-deploy == serverLive
β Undo last enviroment specifics
β git checkout branch-for-HEAD
β git stash pop
Checking changes...
No changes found. ---> !!! No changes found in files OUTSIDE /recordm/customUI !!!
NOTE: Press O to open default browser, CTRL+C or Q to stop the tests..
TIP
It is highly recommend that you take a look at the more detailed reference about the test command here (opens new window).
# Deploying modifications w/ cob-cli deploy
Once the developer is happy with the tested changes, he can deploy them into the server with cob-cli deploy
. This command is used as the final stage of a typical cob-cli
workflow.
If the developer's changes in ticket.js
are ready for production, once he runs the deploy command, it will perform its consistency checks. If these checks pass, the deploy will be executed.
> cob-cli deploy
Checking conditions to deploy master to learning.cultofbits.com...
β Check connectivity and permissions
β Check git status
β Check there's no 'cob-cli test' running on server
β find out branch-for-HEAD
β find out SHA for last-deploy on specified server
β git checkout SHA-for-last-deploy
β Apply last enviroment specifics
β Check last-deploy == serverLive
β Undo last enviroment specifics
β git checkout branch-for-HEAD
Checking changes...
Changes that will be done in learning.cultofbits.com:
change recordm/customUI/js/customizations/tickets.js
Continue? [y/N]
cob-cli
deploys warns the developer of new modifications before executing and deployment, and asks for confirmation. This permits the developer to double check the changes that are supposed to be deployed, to avoid unwanted modifications.
> yes
Deploying ...
β ¦ Register release in DEPLOYLOG.md
git push (branch: master)
β Register release in DEPLOYLOG.md
β git push (branch: master)
β Apply new enviroment specifics
β Deploy files to server's live directories
β Set last environment deployed
β Undo new enviroment specifics
Done!
WARNING
The test and deploy commands will run consistency checks to guarantee that no errors can occurr - such as to avoid overriding previous work. It is highly recommended that you check both of their detailed documentations, as well as the troubleshooting guide (opens new window).
# Installing Addons w/ cob-cli customize
cob-cli
supports the installation of addons which we also call customizations. cob-cli customize
offers an interactive menu for the installation of pre-existing addons. When running customize, the user is prompted with a list of available addons (customizations), which can be interactively chosen.
More details about the customize command here (opens new window).
> cob-cli customize
Customize...
? What customization do you want to apply? (Press <space> to select, <a> to toggle all, <i> to invert selection)
β―β― customize.backend.governance
β― customize.backend.vuepress
β― customize.dashboard.dash
β― customize.dashboard.html_page_base
β― customize.dashboard.vue_base
β― customize.frontend.common
β― customize.frontend.style.currency
(Move up and down to reveal more choices)
After choosing the customize.dashboard.dash
customization as an example:
git pull https://github.com/cob/customize.dashboard.dash.git
Applying customize.dashboard.dash customization ...
Copying template files for customize.dashboard.dash...
Done