|
7 | 7 |
|
8 | 8 | Read the full documentation at [freightapp.co](https://freightapp.co). |
9 | 9 |
|
10 | | -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. |
| 10 | +Freight streamlines Git workflows by rewiring every Git hook in your repository to a single **Conductor** binary. All |
| 11 | +logic is defined in a declarative **Railcar** manifest (`railcar.json`), ensuring your hooks are portable, fast, and |
| 12 | +easy to manage. |
11 | 13 |
|
12 | 14 | ## Why Freight? |
13 | 15 |
|
14 | 16 | ### 🚀 Zero Runtime Dependencies |
15 | | -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. |
| 17 | + |
| 18 | +Unlike Husky (which requires Node.js) or pre-commit (which requires Python), Freight is a single, static Go binary. Your |
| 19 | +developers don't need to install a specific runtime just to run Git hooks. |
16 | 20 |
|
17 | 21 | ### 📦 Unified Configuration |
18 | | -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. |
| 22 | + |
| 23 | +Manage every hook—from `pre-commit` to `post-merge`—in one `railcar.json` manifest. No more messy `.git/hooks` directory |
| 24 | +filled with ad-hoc scripts. |
19 | 25 |
|
20 | 26 | ### 🛠️ Built for Portability |
| 27 | + |
21 | 28 | Freight's 'Conductor/Railcar' architecture ensures that your hooks work identically across Windows, macOS, and Linux. |
22 | 29 |
|
23 | 30 | ### 🥊 Freight vs. Husky |
24 | | -| Feature | Freight | Husky | |
25 | | -|---------|---------|-------| |
26 | | -| **Runtime** | None (Static Binary) | Node.js | |
27 | | -| **Setup** | `freight init` | `npm install` | |
28 | | -| **Config** | Single JSON file | Multiple files/package.json | |
29 | | -| **Portability** | High (Binary included) | Moderate (Requires Node) | |
| 31 | + |
| 32 | +| Feature | Freight | Husky | |
| 33 | +|-----------------|------------------------|-----------------------------| |
| 34 | +| **Runtime** | None (Static Binary) | Node.js | |
| 35 | +| **Setup** | `freight init` | `npm install` | |
| 36 | +| **Config** | Single JSON file | Multiple files/package.json | |
| 37 | +| **Portability** | High (Binary included) | Moderate (Requires Node) | |
30 | 38 |
|
31 | 39 | --- |
32 | 40 |
|
33 | 41 | ## Quick Start |
34 | 42 |
|
35 | 43 | ### 1. Install |
| 44 | + |
36 | 45 | - **Homebrew (macOS):** `brew install --cask devbytes-cloud/tap/freight` |
37 | | -- **Precompiled Binaries:** `[GitHub Releases](https://github.com/devbytes-cloud/freight/releases)` |
| 46 | +- **Precompiled Binaries:** [GitHub Releases](https://github.com/devbytes-cloud/freight/releases) |
38 | 47 |
|
39 | 48 | ### 2. Setup |
| 49 | + |
40 | 50 | Run the following command in your Git repository: |
| 51 | + |
41 | 52 | ```bash |
42 | 53 | freight init |
43 | 54 | ``` |
| 55 | + |
44 | 56 | This installs the **Conductor** binary and creates a starter **Railcar** manifest (`railcar.json`). |
45 | 57 |
|
| 58 | +By default, Freight installs all supported Git hooks. You can use the `--allow` (or `-a`) flag to specify only the hooks |
| 59 | +you want: |
| 60 | + |
| 61 | +```bash |
| 62 | +freight init --allow pre-commit,commit-msg |
| 63 | +``` |
| 64 | + |
| 65 | +Valid hooks are: `pre-commit`, `prepare-commit-msg`, `commit-msg`, `post-commit`, and `post-checkout`. |
| 66 | + |
46 | 67 | ### 3. Verify |
| 68 | + |
47 | 69 | Add a script to your `railcar.json` and watch it run on your next commit! |
48 | 70 |
|
49 | 71 | --- |
50 | 72 |
|
51 | 73 | ## Architecture: Conductor & Railcar |
52 | 74 |
|
53 | 75 | Freight operates on a simple, powerful metaphor: |
54 | | -- **The Conductor:** A tiny, high-performance binary placed at your repo root. It is the single entry point for all Git hooks. |
| 76 | + |
| 77 | +- **The Conductor:** A tiny, high-performance binary placed at your repo root. It is the single entry point for all Git |
| 78 | + hooks. |
55 | 79 | - **The Railcar:** A `railcar.json` manifest that defines exactly what the Conductor should execute for each hook. |
56 | 80 |
|
57 | 81 | When a Git hook fires, the Conductor extracts the logic from the Railcar and executes it with precision. |
|
0 commit comments