Blog

Eric Peterson

December 21, 2017

Spread the word


Share your thoughts

A short one but a good one today. Let's see how we can automate tasks with [CommandBox Githooks.](https://www.forgebox.io/view/commandbox-githooks)

CommandBox Githooks

What are Githooks?

Githooks run on different git actions, like pre-commit and post-checkout. They allow you to hook in to git's lifecycle to execute tasks. Some examples of these tasks are enforcing a commit message format in pre-commit or installing dependencies in post-checkout. This is more useful than it may sound — I know I often forget to install new dependencies when checking out a branch. Automating that step helps me spend less time debugging in the wrong direction.

Running Githooks with CommandBox

CommandBox Githooks lets you use CommandBox, CFML, and your box.json to manage these githooks for your project. You configure it in three steps.

  1. Install commandbox-githooks for CommandBox. This step only needs to be done once per CommandBox installation.
  2. Configure CommandBox Githooks for your repository by running githooks install. This will set up CommandBox to handle the githooks.

    Note: This needs to be done on each user's local repository as githooks are not synced.

  3. Add a githooks struct to your box.json. The keys of this struct are the camel-case names of the githooks (post-checkout => postCheckout). The value is either a single command or an array of commands to run for the githook.

Let's show you what this actually looks like:

Wrap up

CommandBox Githooks can save you mental energy and time debugging by helping you automate githook tasks with CommandBox and CFML. Try it out today!

Add Your Comment

(1)

Dec 21, 2017 08:09:32 UTC

by John Farrar

This is one of the greatest integration points for CFML developers. Remember if you think hooks are missing they are likely hooks that should be run from your origin repository, a.k.a. BitBucket or some other server.

Recent Entries

BoxLang v1.8.0 : Revolutionary HTTP Client, SOAP Integration, and Production-Grade Stability

BoxLang v1.8.0 : Revolutionary HTTP Client, SOAP Integration, and Production-Grade Stability

The BoxLang team is excited to announce BoxLang 1.8.0, a massive release that revolutionizes HTTP capabilities, introduces comprehensive SOAP/WSDL integration, and delivers over 100 critical bug fixes for production-grade stability. This release focuses on modern web application development with fluent APIs, streaming support, persistent connection management, and extensive CFML compatibility improvements.

Luis Majano
Luis Majano
December 05, 2025
Ortus & BoxLang November Recap 2025

Ortus & BoxLang November Recap 2025

November 2025 was a big month at Ortus. BoxLang 1.7.0 arrived with real-time streaming, distributed caching, and faster compiler internals. ColdBox gained a cleaner debugging experience with full Whoops support, while CBWIRE 5 launched with stronger security, smarter lifecycles, and easier uploads.

Victor Campos
Victor Campos
December 02, 2025
Thanksgiving Week Extended + Cyber Monday Deals Are Live!

Thanksgiving Week Extended + Cyber Monday Deals Are Live!

Because you asked; we’re extending the Thanksgiving Week offer and officially launching our Cyber Monday BoxLang Deals today!

To support everyone who wants to understand whether they’re running on legacy CFML or modern-ready code, and whether BoxLang is the right fit; we’ve decided to extend the dates and increase the number of companies we can support.

Maria Jose Herrera
Maria Jose Herrera
December 01, 2025