Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
7424b57
ci(release): add Windows target and cross-platform packaging
kevincodex1 Jun 30, 2026
b452af6
feat(release): vendor npm wrapper and auto-publish to npm
kevincodex1 Jun 30, 2026
aead0f5
feat(release): auto-bump Homebrew tap on release
kevincodex1 Jun 30, 2026
2df3ffc
feat(release): Windows installer and web auto-sync on release
kevincodex1 Jun 30, 2026
a96d21d
docs(readme): document npm, Homebrew, and Windows install methods
kevincodex1 Jun 30, 2026
2e365d1
ci(release): build only CLI binaries on Windows
kevincodex1 Jun 30, 2026
8092c9d
fix(release): reconcile release-please manifest with v0.3.9 and bump …
kevincodex1 Jun 30, 2026
775545f
ci(release): set explicit minimal permissions on homebrew-bump and we…
kevincodex1 Jun 30, 2026
b0403c8
fix(release): harden installers and workflow per review
kevincodex1 Jun 30, 2026
762b5ad
fix(installer): require core CLI binaries on Windows
kevincodex1 Jun 30, 2026
36829d6
ci(release): make Windows non-blocking and stop persisting cross-repo…
kevincodex1 Jun 30, 2026
016e4c0
fix(release): gate web-sync on binaries and detect native arch in ins…
kevincodex1 Jun 30, 2026
30a175a
ci(release): make npm publish idempotent across reruns
kevincodex1 Jun 30, 2026
7bed605
fix(release): harden web-sync and tap commit per review
kevincodex1 Jun 30, 2026
475a018
ci(release): guard npm-publish before doing any work
kevincodex1 Jun 30, 2026
40ca937
fix(release): robust web PR error handling and Windows installer hard…
kevincodex1 Jun 30, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
399 changes: 384 additions & 15 deletions .github/workflows/release.yml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.3.8"
".": "0.3.9"
}
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,18 @@ docker compose down

## Install the CLI

Use the installer once releases are available for your platform:

```bash
# npm (macOS / Linux)
npm install -g @gitlawb/gl

# Homebrew (macOS / Linux)
brew install gitlawb/tap/gl

# curl (macOS / Linux)
curl -fsSL https://gitlawb.com/install.sh | sh

# PowerShell (Windows)
irm https://gitlawb.com/install.ps1 | iex
```

Or build from source:
Expand Down
124 changes: 124 additions & 0 deletions install.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
<#
.SYNOPSIS
gitlawb installer for Windows - downloads pre-built binaries from GitHub Releases.
.EXAMPLE
irm https://gitlawb.com/install.ps1 | iex
.EXAMPLE
& ([scriptblock]::Create((irm https://gitlawb.com/install.ps1))) -Version v0.3.9
#>
[CmdletBinding()]
param(
[string]$Version = "latest"
)

$ErrorActionPreference = "Stop"

# Windows PowerShell 5.1 may default to TLS 1.0; GitHub requires TLS 1.2+.
[Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12

$Repo = if ($env:GITLAWB_RELEASE_REPO) { $env:GITLAWB_RELEASE_REPO } else { "Gitlawb/node" }
$InstallDir = if ($env:GITLAWB_INSTALL_DIR) { $env:GITLAWB_INSTALL_DIR } else { "$env:LOCALAPPDATA\Programs\gitlawb" }

$arch = if ($env:PROCESSOR_ARCHITEW6432) {
$env:PROCESSOR_ARCHITEW6432
} else {
$env:PROCESSOR_ARCHITECTURE
}
if ($arch -ne "AMD64") {
throw "Unsupported architecture: $arch. Only x64 Windows binaries are published. Use WSL for arm64."
}
$target = "x86_64-pc-windows-msvc"

if ($Version -eq "latest") {
Write-Host "Fetching latest release version..."
$rel = Invoke-RestMethod -Uri "https://api.github.com/repos/$Repo/releases/latest" -UseBasicParsing -Headers @{ "User-Agent" = "gitlawb-installer" }
$tag = $rel.tag_name
} elseif ($Version.StartsWith("v")) {
$tag = $Version
} else {
$tag = "v$Version"
}
$ver = $tag.TrimStart("v")

$archive = "gitlawb-node-$ver-$target.zip"
$url = "https://github.com/$Repo/releases/download/$tag/$archive"

Write-Host "Installing gitlawb $tag for windows/x64"
Write-Host " Archive: $archive"
Write-Host " Into: $InstallDir"

$tmp = Join-Path ([System.IO.Path]::GetTempPath()) ("gitlawb-" + [System.Guid]::NewGuid().ToString("N"))
New-Item -ItemType Directory -Path $tmp | Out-Null
try {
$zipPath = Join-Path $tmp $archive
Write-Host "Downloading..."
Invoke-WebRequest -Uri $url -OutFile $zipPath -UseBasicParsing -Headers @{ "User-Agent" = "gitlawb-installer" }

# Verify checksum. Every published asset has a matching .sha256, so fail closed
# if it cannot be fetched rather than installing an unverified binary.
$sumPath = "$zipPath.sha256"
Invoke-WebRequest -Uri "$url.sha256" -OutFile $sumPath -UseBasicParsing -Headers @{ "User-Agent" = "gitlawb-installer" }
$expected = ((Get-Content $sumPath -Raw).Trim() -split '\s+')[0].ToLower()
$actual = (Get-FileHash $zipPath -Algorithm SHA256).Hash.ToLower()
if ($expected -ne $actual) {
throw "checksum mismatch! expected $expected got $actual"
}
Write-Host " checksum OK"

Write-Host "Extracting..."
$extract = Join-Path $tmp "extract"
Expand-Archive -Path $zipPath -DestinationPath $extract -Force
$pkgDir = Get-ChildItem -Path $extract -Directory | Select-Object -First 1

New-Item -ItemType Directory -Path $InstallDir -Force | Out-Null
# The Windows archive always ships the two CLI binaries; the daemon is optional.
$requiredBins = @("gl.exe", "git-remote-gitlawb.exe")
$optionalBins = @("gitlawb-node.exe")
$missing = $requiredBins | Where-Object {
-not (Test-Path (Join-Path $pkgDir.FullName $_))
}
if ($missing.Count -gt 0) {
throw "archive is missing required binaries: $($missing -join ', ')"
}

$installed = @()
foreach ($bin in $requiredBins + $optionalBins) {
$src = Join-Path $pkgDir.FullName $bin
if (Test-Path $src) {
Copy-Item -Path $src -Destination (Join-Path $InstallDir $bin) -Force
$installed += $bin
}
}
Comment thread
coderabbitai[bot] marked this conversation as resolved.

# Drop binaries no longer shipped (e.g. an optional one removed in a new release)
# so an upgrade in place never leaves a stale, mixed-version install behind.
foreach ($bin in $requiredBins + $optionalBins) {
if ($installed -notcontains $bin) {
$dst = Join-Path $InstallDir $bin
if (Test-Path $dst) { Remove-Item -Path $dst -Force }
}
}

Write-Host ""
Write-Host "Installed gitlawb $tag"
foreach ($bin in $installed) { Write-Host " $bin -> $InstallDir\$bin" }
}
finally {
Remove-Item -Recurse -Force $tmp -ErrorAction SilentlyContinue
}

# Add to the user PATH if missing.
$userPath = [Environment]::GetEnvironmentVariable("Path", "User")
if (($userPath -split ';') -notcontains $InstallDir) {
$newPath = if ([string]::IsNullOrEmpty($userPath)) { $InstallDir } else { "$userPath;$InstallDir" }
[Environment]::SetEnvironmentVariable("Path", $newPath, "User")
Write-Host ""
Write-Host "Added $InstallDir to your PATH. Restart your terminal, then run:"
} else {
Write-Host ""
Write-Host "Run:"
}
Write-Host " gl doctor"
Write-Host " gl quickstart"
Write-Host ""
Write-Host "Docs: https://docs.gitlawb.com"
15 changes: 15 additions & 0 deletions npm/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
node_modules/

# Platform binaries — laid in by the release workflow at publish time, not committed.
packages/gl-darwin-arm64/gl
packages/gl-darwin-arm64/git-remote-gitlawb
packages/gl-darwin-x64/gl
packages/gl-darwin-x64/git-remote-gitlawb
packages/gl-linux-arm64/gl
packages/gl-linux-arm64/git-remote-gitlawb
packages/gl-linux-x64/gl
packages/gl-linux-x64/git-remote-gitlawb

# Wrapper bin placeholders are overwritten by postinstall.
packages/gl/bin/gl
packages/gl/bin/git-remote-gitlawb
37 changes: 37 additions & 0 deletions npm/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# npm distribution for the gitlawb CLI

This directory packages the `gl` and `git-remote-gitlawb` binaries as the
[`@gitlawb/gl`](https://www.npmjs.com/package/@gitlawb/gl) npm package.

It uses the **optionalDependencies platform-package** pattern (the same one
esbuild/swc/turbo use): the wrapper `@gitlawb/gl` declares four per-platform
packages as `optionalDependencies`, each gated by `os`/`cpu`. npm installs only
the one matching the host, and the wrapper's `postinstall` (`install.js`) copies
the binary out of it into `bin/`. No binaries are downloaded at install time.

```text
packages/
gl/ @gitlawb/gl wrapper (postinstall, bin shims)
gl-darwin-arm64/ @gitlawb/gl-darwin-arm64 aarch64-apple-darwin
gl-darwin-x64/ @gitlawb/gl-darwin-x64 x86_64-apple-darwin
gl-linux-arm64/ @gitlawb/gl-linux-arm64 aarch64-unknown-linux-musl
gl-linux-x64/ @gitlawb/gl-linux-x64 x86_64-unknown-linux-musl
```

## Publishing

Publishing is **automated** by `.github/workflows/release.yml` (the `npm-publish`
job) on every release-please release. That job:

1. Downloads the four unix release tarballs from the `Gitlawb/node` GitHub release.
2. Lays `gl` + `git-remote-gitlawb` into each platform package.
3. Rewrites every `package.json` `version` (and the wrapper's
`optionalDependencies` pins) to the release version.
4. Publishes the four platform packages first, then the wrapper, with
`npm publish --provenance --access public`.

The committed `version` fields here are placeholders; the workflow is the single
source of truth and always uses the release tag. There is no manual publish step.

Windows is intentionally not published to npm — the wrapper points Windows users
at the curl/PowerShell installer instead.
21 changes: 21 additions & 0 deletions npm/packages/gl-darwin-arm64/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"name": "@gitlawb/gl-darwin-arm64",
"version": "0.3.9",
"description": "Gitlawb CLI binary for macOS Apple Silicon (arm64)",
"license": "MIT",
"os": ["darwin"],
"cpu": ["arm64"],
"publishConfig": {
"access": "public",
"registry": "https://registry.npmjs.org/"
},
"repository": {
"type": "git",
"url": "https://github.com/Gitlawb/node",
"directory": "npm/packages/gl-darwin-arm64"
},
"files": [
"gl",
"git-remote-gitlawb"
]
}
21 changes: 21 additions & 0 deletions npm/packages/gl-darwin-x64/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"name": "@gitlawb/gl-darwin-x64",
"version": "0.3.9",
"description": "Gitlawb CLI binary for macOS Intel (x64)",
"license": "MIT",
"os": ["darwin"],
"cpu": ["x64"],
"publishConfig": {
"access": "public",
"registry": "https://registry.npmjs.org/"
},
"repository": {
"type": "git",
"url": "https://github.com/Gitlawb/node",
"directory": "npm/packages/gl-darwin-x64"
},
"files": [
"gl",
"git-remote-gitlawb"
]
}
21 changes: 21 additions & 0 deletions npm/packages/gl-linux-arm64/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"name": "@gitlawb/gl-linux-arm64",
"version": "0.3.9",
"description": "Gitlawb CLI binary for Linux arm64",
"license": "MIT",
"os": ["linux"],
"cpu": ["arm64"],
"publishConfig": {
"access": "public",
"registry": "https://registry.npmjs.org/"
},
"repository": {
"type": "git",
"url": "https://github.com/Gitlawb/node",
"directory": "npm/packages/gl-linux-arm64"
},
"files": [
"gl",
"git-remote-gitlawb"
]
}
21 changes: 21 additions & 0 deletions npm/packages/gl-linux-x64/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"name": "@gitlawb/gl-linux-x64",
"version": "0.3.9",
"description": "Gitlawb CLI binary for Linux x64",
"license": "MIT",
"os": ["linux"],
"cpu": ["x64"],
"publishConfig": {
"access": "public",
"registry": "https://registry.npmjs.org/"
},
"repository": {
"type": "git",
"url": "https://github.com/Gitlawb/node",
"directory": "npm/packages/gl-linux-x64"
},
"files": [
"gl",
"git-remote-gitlawb"
]
}
67 changes: 67 additions & 0 deletions npm/packages/gl/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# @gitlawb/gl

The [gitlawb](https://gitlawb.com) CLI — decentralized git for AI agents and developers.

## Install

```bash
# macOS / Linux / WSL
npm install -g @gitlawb/gl
```

Also works with yarn, pnpm, and bun:

```bash
# macOS / Linux / WSL
yarn global add @gitlawb/gl
pnpm add -g @gitlawb/gl
bun add -g @gitlawb/gl
```
Comment thread
coderabbitai[bot] marked this conversation as resolved.

Native Windows is not supported via npm — use the PowerShell installer below.

### Other install methods

```bash
# Homebrew
brew install gitlawb/tap/gl

# curl (macOS / Linux)
curl -sSf https://gitlawb.com/install.sh | sh

# PowerShell (Windows)
irm https://gitlawb.com/install.ps1 | iex
```

## Quick start

```bash
gl identity new
gl register
gl doctor
gl repo create my-project --description "My first gitlawb repo"
git remote add gitlawb gitlawb://my-project
git push gitlawb main
```

## What's included

- **`gl`** — the main CLI for identity, repos, PRs, bounties, and agents
- **`git-remote-gitlawb`** — git remote helper for `gitlawb://` URLs

## Supported platforms

| Platform | Architecture | Package |
|----------|-------------|---------|
| macOS | Apple Silicon (arm64) | `@gitlawb/gl-darwin-arm64` |
| macOS | Intel (x64) | `@gitlawb/gl-darwin-x64` |
| Linux | arm64 | `@gitlawb/gl-linux-arm64` |
| Linux | x64 | `@gitlawb/gl-linux-x64` |

Windows is supported via the PowerShell installer or WSL.

## Links

- Docs: https://docs.gitlawb.com
- Site: https://gitlawb.com
- Source: https://github.com/Gitlawb/node
Empty file added npm/packages/gl/bin/.gitkeep
Empty file.
Loading
Loading