gabb-cli 0.7.6

Fast local code indexing CLI for TypeScript, Rust, and Kotlin projects
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
# Release Process

This document describes how to release gabb-cli for different platforms.

## Overview

gabb-cli uses GitHub Actions to automatically build binaries when a version tag is pushed. The release workflow produces:

- **macOS**: x86_64, aarch64, and universal binaries
- **Linux**: x86_64 binary (glibc)
- **Windows**: Not yet automated (see [Windows section]#windows)

## Prerequisites

- Push access to the repository
- For Homebrew: access to the `gabb-software/homebrew-tap` repository

## Creating a Release

### 1. Update Version

Edit `Cargo.toml` and update the version:

```toml
[package]
version = "0.2.0"  # Update this
```

### 2. Update Changelog (Optional)

If you maintain a CHANGELOG.md, update it with the new version's changes.

### 3. Commit and Tag

```bash
git add Cargo.toml Cargo.lock
git commit -m "chore: bump version to 0.2.0"
git tag v0.2.0
git push origin main --tags
```

### 4. Wait for GitHub Actions

The release workflow will:
1. Build binaries for all platforms
2. Create a universal macOS binary
3. Generate SHA256 checksums
4. Create a GitHub release with all artifacts

Monitor progress at: `https://github.com/gabb-software/gabb-cli/actions`

### 5. Verify Release

Once complete, verify the release at:
`https://github.com/gabb-software/gabb-cli/releases/tag/v0.2.0`

Expected artifacts:
- `gabb-cli-x86_64-apple-darwin.tar.gz`
- `gabb-cli-aarch64-apple-darwin.tar.gz`
- `gabb-cli-universal-apple-darwin.tar.gz`
- `gabb-cli-x86_64-unknown-linux-gnu.tar.gz`
- `SHA256SUMS.txt`

---

## macOS (Homebrew)

### First-Time Setup

1. Create the tap repository on GitHub: `gabb-software/homebrew-tap`

2. Clone it locally:
   ```bash
   git clone https://github.com/gabb-software/homebrew-tap.git
   cd homebrew-tap
   mkdir Formula
   ```

3. Copy the initial formula:
   ```bash
   cp /path/to/gabb-cli/homebrew/gabb-cli.rb Formula/
   ```

### Updating the Formula

After each release:

1. Generate the updated formula with correct SHA256 hashes:
   ```bash
   cd /path/to/gabb-cli
   ./homebrew/update-formula.sh v0.2.0
   ```

2. Copy the output to the tap repository:
   ```bash
   ./homebrew/update-formula.sh v0.2.0 > /path/to/homebrew-tap/Formula/gabb-cli.rb
   ```

3. Commit and push:
   ```bash
   cd /path/to/homebrew-tap
   git add Formula/gabb-cli.rb
   git commit -m "Update gabb-cli to 0.2.0"
   git push origin main
   ```

### User Installation

Users install with:
```bash
brew tap gabb-software/tap
brew install gabb-cli

# Upgrade existing installation
brew update && brew upgrade gabb-cli
```

### Testing the Formula

```bash
# Test installation from tap
brew install --verbose gabb-software/tap/gabb-cli

# Test local formula file
brew install --build-from-source ./Formula/gabb-cli.rb
```

---

## Linux

### Package Formats

Currently, Linux releases are distributed as tarballs. Future options include:

| Format | Distribution | Status |
|--------|--------------|--------|
| `.tar.gz` | Generic | ✅ Available |
| `.deb` | Debian/Ubuntu | 🔜 Planned |
| `.rpm` | Fedora/RHEL | 🔜 Planned |
| AUR | Arch Linux | 🔜 Planned |
| Nix | NixOS | 🔜 Planned |

### Manual Installation (Current)

```bash
# Download latest release
VERSION="0.2.0"
curl -LO "https://github.com/gabb-software/gabb-cli/releases/download/v${VERSION}/gabb-cli-x86_64-unknown-linux-gnu.tar.gz"

# Verify checksum
curl -LO "https://github.com/gabb-software/gabb-cli/releases/download/v${VERSION}/SHA256SUMS.txt"
sha256sum -c SHA256SUMS.txt --ignore-missing

# Extract and install
tar -xzf gabb-cli-x86_64-unknown-linux-gnu.tar.gz
sudo mv gabb-cli /usr/local/bin/
```

### Installation Script (Recommended)

Create an install script for users:

```bash
#!/bin/bash
set -e

VERSION="${1:-latest}"
INSTALL_DIR="${2:-/usr/local/bin}"

if [ "$VERSION" = "latest" ]; then
    VERSION=$(curl -s https://api.github.com/repos/gabb-software/gabb-cli/releases/latest | grep tag_name | cut -d'"' -f4)
fi

echo "Installing gabb-cli ${VERSION}..."

ARCH=$(uname -m)
case "$ARCH" in
    x86_64) TARGET="x86_64-unknown-linux-gnu" ;;
    aarch64) TARGET="aarch64-unknown-linux-gnu" ;;
    *) echo "Unsupported architecture: $ARCH"; exit 1 ;;
esac

curl -LO "https://github.com/gabb-software/gabb-cli/releases/download/${VERSION}/gabb-cli-${TARGET}.tar.gz"
tar -xzf "gabb-cli-${TARGET}.tar.gz"
sudo mv gabb-cli "$INSTALL_DIR/"
rm "gabb-cli-${TARGET}.tar.gz"

echo "Installed gabb-cli to ${INSTALL_DIR}/gabb-cli"
gabb-cli --version
```

### Adding Debian/Ubuntu Packages (Future)

To add `.deb` package support:

1. Add `cargo-deb` to the release workflow:
   ```yaml
   - name: Build deb package
     run: |
       cargo install cargo-deb
       cargo deb
   ```

2. Add `[package.metadata.deb]` section to `Cargo.toml`:
   ```toml
   [package.metadata.deb]
   maintainer = "Your Name <your@email.com>"
   copyright = "2025, Gabb Software"
   depends = "$auto"
   section = "utility"
   priority = "optional"
   assets = [
       ["target/release/gabb-cli", "usr/bin/", "755"],
   ]
   ```

### Adding RPM Packages (Future)

To add `.rpm` package support:

1. Add `cargo-generate-rpm` to the release workflow
2. Add `[package.metadata.rpm]` section to `Cargo.toml`

### Adding to AUR (Future)

Create a PKGBUILD file for Arch Linux:

```bash
# Maintainer: Your Name <your@email.com>
pkgname=gabb-cli
pkgver=0.2.0
pkgrel=1
pkgdesc="Fast local code indexing CLI"
arch=('x86_64')
url="https://github.com/gabb-software/gabb-cli"
license=('MIT')
depends=('gcc-libs')
makedepends=('rust' 'cargo')
source=("$pkgname-$pkgver.tar.gz::https://github.com/gabb-software/gabb-cli/archive/v$pkgver.tar.gz")
sha256sums=('SKIP')

build() {
    cd "$pkgname-$pkgver"
    cargo build --release --locked
}

package() {
    cd "$pkgname-$pkgver"
    install -Dm755 "target/release/gabb-cli" "$pkgdir/usr/bin/gabb-cli"
    install -Dm644 "LICENSE" "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}
```

---

## Windows

### Current Status

Windows builds are not yet automated. Users can build from source or use WSL.

### Building from Source

```powershell
# Install Rust from https://rustup.rs
# Then:
git clone https://github.com/gabb-software/gabb-cli.git
cd gabb-cli
cargo build --release

# Binary will be at: target\release\gabb-cli.exe
```

### Adding Windows to Release Workflow (Future)

To add Windows support, update `.github/workflows/release.yml`:

```yaml
jobs:
  build:
    strategy:
      matrix:
        include:
          # ... existing targets ...
          - target: x86_64-pc-windows-msvc
            os: windows-latest

    steps:
      # ... existing steps ...

      - name: Package (Windows)
        if: matrix.os == 'windows-latest'
        shell: pwsh
        run: |
          cd target/${{ matrix.target }}/release
          7z a ../../../gabb-cli-${{ matrix.target }}.zip gabb-cli.exe
```

### Chocolatey Package (Future)

To distribute via Chocolatey:

1. Create a `choco/` directory with:
   - `gabb-cli.nuspec` - Package metadata
   - `tools/chocolateyinstall.ps1` - Install script

2. Example nuspec:
   ```xml
   <?xml version="1.0" encoding="utf-8"?>
   <package xmlns="http://schemas.microsoft.com/packaging/2015/06/nuspec.xsd">
     <metadata>
       <id>gabb-cli</id>
       <version>0.2.0</version>
       <title>gabb-cli</title>
       <authors>Gabb Software</authors>
       <projectUrl>https://github.com/gabb-software/gabb-cli</projectUrl>
       <licenseUrl>https://github.com/gabb-software/gabb-cli/blob/main/LICENSE</licenseUrl>
       <description>Fast local code indexing CLI</description>
       <tags>cli code-indexing development</tags>
     </metadata>
     <files>
       <file src="tools\**" target="tools" />
     </files>
   </package>
   ```

### WinGet Package (Future)

To distribute via Windows Package Manager:

1. Fork `microsoft/winget-pkgs`
2. Add manifest at `manifests/g/GabbSoftware/gabb-cli/0.2.0/`
3. Submit PR to winget-pkgs

---

## Cargo (crates.io)

### Publishing to crates.io

```bash
# Login (first time only)
cargo login

# Publish
cargo publish
```

### Prerequisites for crates.io

1. Ensure all dependencies are on crates.io
2. Add required metadata to `Cargo.toml`:
   ```toml
   [package]
   license = "MIT"
   description = "..."
   repository = "..."
   ```

### Installation via Cargo

Users can install with:
```bash
cargo install gabb-cli
```

---

## Release Checklist

```markdown
## Release v0.X.0

- [ ] Update version in `Cargo.toml`
- [ ] Update CHANGELOG.md (if maintained)
- [ ] Run full test suite: `cargo test`
- [ ] Run clippy: `cargo clippy --all-targets`
- [ ] Commit version bump
- [ ] Create and push tag: `git tag v0.X.0 && git push origin --tags`
- [ ] Wait for GitHub Actions to complete
- [ ] Verify release artifacts on GitHub
- [ ] Update Homebrew formula in homebrew-tap
- [ ] Test installation: `brew upgrade gabb-cli`
- [ ] Announce release (if applicable)
```

---

## Troubleshooting

### Release workflow failed

1. Check the Actions tab for error details
2. Common issues:
   - Rust compilation errors
   - Missing targets (run `rustup target add <target>`)
   - Rate limiting on artifact uploads

### Homebrew formula errors

```bash
# Debug formula issues
brew install --verbose --debug gabb-software/tap/gabb-cli

# Check formula syntax
brew audit --strict Formula/gabb-cli.rb
```

### Binary doesn't run on older macOS

The default build targets the runner's macOS version. To support older versions:

```yaml
env:
  MACOSX_DEPLOYMENT_TARGET: "10.14"
```

### Linux binary has glibc issues

The default Linux build uses glibc. For maximum compatibility, consider musl:

```yaml
- target: x86_64-unknown-linux-musl
  os: ubuntu-latest
```

This produces a statically-linked binary that works on any Linux distribution.