Skip to content

Repository files navigation

Freight 🚂

Go VersionLicense

The professional, zero-dependency Git hook manager for modern teams.

Read the full documentation at freightapp.co.

Freight streamlines Git workflows by rewiring every Git hook in your repository to a single Conductor binary. All logic is defined in a declarative Railcar manifest (railcar.json), ensuring your hooks are portable, fast, and easy to manage.

Why Freight?

🚀 Zero Runtime Dependencies

Unlike Husky (which requires Node.js) or pre-commit (which requires Python), Freight is a single, static Go binary. Your developers don't need to install a specific runtime just to run Git hooks.

📦 Unified Configuration

Manage every hook—from pre-commit to post-merge—in one railcar.json manifest. No more messy .git/hooks directory filled with ad-hoc scripts.

🛠️ Built for Portability

Freight's 'Conductor/Railcar' architecture ensures that your hooks work identically across Windows, macOS, and Linux.

🥊 Freight vs. Husky

FeatureFreightHusky
RuntimeNone (Static Binary)Node.js
Setupfreight initnpm install
ConfigSingle JSON fileMultiple files/package.json
PortabilityHigh (Binary included)Moderate (Requires Node)

Quick Start

1. Install

  • Homebrew (macOS):brew install --cask devbytes-cloud/tap/freight
  • One-liner Install (Linux/macOS):curl -fsSL https://raw.githubusercontent.com/devbytes-cloud/freight/main/curl.sh | bash
    • Custom INSTALL_DIR (optional):INSTALL_DIR=~/.local/bin curl -fsSL ... | bash
  • Precompiled Binaries:GitHub Releases

2. Setup

Run the following command in your Git repository:

freight init

This installs the Conductor binary and creates a starter Railcar manifest (railcar.json).

By default, Freight installs all supported Git hooks. You can use the --allow (or -a) flag to specify only the hooks you want:

freight init --allow pre-commit,commit-msg

Valid hooks are: pre-commit, prepare-commit-msg, commit-msg, post-commit, and post-checkout.

3. Verify

Add a script to your railcar.json and watch it run on your next commit!


Architecture: Conductor & Railcar

Freight operates on a simple, powerful metaphor:

  • The Conductor: A tiny, high-performance binary placed at your repo root. It is the single entry point for all Git hooks.
  • The Railcar: A railcar.json manifest that defines exactly what the Conductor should execute for each hook.

When a Git hook fires, the Conductor extracts the logic from the Railcar and executes it with precision.


Documentation

For full documentation, recipes, and advanced configuration, visit freightapp.co.

License

MIT. See LICENSE for full text.

About

No description, website, or topics provided.

Resources

Stars

6 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages