Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,13 @@ When a rule is violated, `archgate check` reports the file, line, and which ADR

```bash
# macOS / Linux
curl -fsSL https://raw.githubusercontent.com/archgate/cli/main/install.sh | sh
curl -fsSL https://cli.archgate.dev/install-unix | sh

# Windows (PowerShell)
irm https://raw.githubusercontent.com/archgate/cli/main/install.ps1 | iex
irm https://cli.archgate.dev/install-windows | iex

# Windows (Git Bash / MSYS2)
curl -fsSL https://cli.archgate.dev/install-unix | sh
```

**Via npm** (or any Node.js package manager):
Expand Down Expand Up @@ -77,7 +80,7 @@ npx archgate check # run via package manager

```bash
# 1. Install
curl -fsSL https://raw.githubusercontent.com/archgate/cli/main/install.sh | sh # or: npm install -g archgate
curl -fsSL https://cli.archgate.dev/install-unix | sh # or: npm install -g archgate

# 2. Initialize governance in your project
cd my-project
Expand Down
3 changes: 3 additions & 0 deletions docs/public/_redirects
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Install script redirects
/install-unix https://raw.githubusercontent.com/archgate/cli/main/install.sh 302
/install-windows https://raw.githubusercontent.com/archgate/cli/main/install.ps1 302
13 changes: 9 additions & 4 deletions docs/public/llms-full.txt
Original file line number Diff line number Diff line change
Expand Up @@ -122,14 +122,19 @@ The fastest way to install Archgate — no Node.js or package manager required:

```bash
# macOS / Linux
curl -fsSL https://raw.githubusercontent.com/archgate/cli/main/install.sh | sh
curl -fsSL https://cli.archgate.dev/install-unix | sh

# Windows (PowerShell)
irm https://raw.githubusercontent.com/archgate/cli/main/install.ps1 | iex
irm https://cli.archgate.dev/install-windows | iex

# Windows (Git Bash / MSYS2)
curl -fsSL https://cli.archgate.dev/install-unix | sh
```

This downloads a pre-built binary for your platform and installs it to `~/.archgate/bin/`. The installer detects your shell profiles and offers to add the directory to your PATH.

On Windows, the PowerShell installer also detects Git Bash shell profiles (`.bashrc`, `.bash_profile`, `.profile`) and offers to configure PATH there as well.

You can customize the install with environment variables:

| Variable | Description | Default |
Expand Down Expand Up @@ -259,7 +264,7 @@ If you have not installed the CLI yet:

```bash
# Standalone (no Node.js required)
curl -fsSL https://raw.githubusercontent.com/archgate/cli/main/install.sh | sh
curl -fsSL https://cli.archgate.dev/install-unix | sh

# Or via npm
npm install -g archgate
Expand Down Expand Up @@ -1013,7 +1018,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: curl -fsSL https://raw.githubusercontent.com/archgate/cli/main/install.sh | sh
- run: curl -fsSL https://cli.archgate.dev/install-unix | sh
- run: ~/.archgate/bin/archgate check --ci
```

Expand Down
9 changes: 7 additions & 2 deletions docs/src/content/docs/getting-started/installation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,19 @@ The fastest way to install Archgate — no Node.js or package manager required:

```bash
# macOS / Linux
curl -fsSL https://raw.githubusercontent.com/archgate/cli/main/install.sh | sh
curl -fsSL https://cli.archgate.dev/install-unix | sh

# Windows (PowerShell)
irm https://raw.githubusercontent.com/archgate/cli/main/install.ps1 | iex
irm https://cli.archgate.dev/install-windows | iex

# Windows (Git Bash / MSYS2)
curl -fsSL https://cli.archgate.dev/install-unix | sh
```

This downloads a pre-built binary for your platform and installs it to `~/.archgate/bin/`. The installer detects your shell profiles and offers to add the directory to your PATH.

On Windows, the PowerShell installer also detects Git Bash shell profiles (`.bashrc`, `.bash_profile`, `.profile`) and offers to configure PATH there as well.

You can customize the install with environment variables:

| Variable | Description | Default |
Expand Down
2 changes: 1 addition & 1 deletion docs/src/content/docs/getting-started/quick-start.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ If you have not installed the CLI yet:

```bash
# Standalone (no Node.js required)
curl -fsSL https://raw.githubusercontent.com/archgate/cli/main/install.sh | sh
curl -fsSL https://cli.archgate.dev/install-unix | sh

# Or via npm
npm install -g archgate
Expand Down
2 changes: 1 addition & 1 deletion docs/src/content/docs/guides/ci-integration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: curl -fsSL https://raw.githubusercontent.com/archgate/cli/main/install.sh | sh
- run: curl -fsSL https://cli.archgate.dev/install-unix | sh
- run: ~/.archgate/bin/archgate check --ci
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,19 @@ A forma mais rápida de instalar o Archgate — sem necessidade de Node.js ou ge

```bash
# macOS / Linux
curl -fsSL https://raw.githubusercontent.com/archgate/cli/main/install.sh | sh
curl -fsSL https://cli.archgate.dev/install-unix | sh

# Windows (PowerShell)
irm https://raw.githubusercontent.com/archgate/cli/main/install.ps1 | iex
irm https://cli.archgate.dev/install-windows | iex

# Windows (Git Bash / MSYS2)
curl -fsSL https://cli.archgate.dev/install-unix | sh
```

Isso baixa um binário pré-compilado para sua plataforma e instala em `~/.archgate/bin/`. O instalador detecta os perfis do seu shell e oferece adicionar o diretório ao seu PATH.

No Windows, o instalador PowerShell também detecta perfis de shell do Git Bash (`.bashrc`, `.bash_profile`, `.profile`) e oferece configurar o PATH neles.

Você pode personalizar a instalação com variáveis de ambiente:

| Variável | Descrição | Padrão |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Se você ainda não instalou a CLI:

```bash
# Standalone (sem necessidade de Node.js)
curl -fsSL https://raw.githubusercontent.com/archgate/cli/main/install.sh | sh
curl -fsSL https://cli.archgate.dev/install-unix | sh

# Ou via npm
npm install -g archgate
Expand Down
2 changes: 1 addition & 1 deletion docs/src/content/docs/pt-br/guides/ci-integration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: curl -fsSL https://raw.githubusercontent.com/archgate/cli/main/install.sh | sh
- run: curl -fsSL https://cli.archgate.dev/install-unix | sh
- run: ~/.archgate/bin/archgate check --ci
```

Expand Down
44 changes: 44 additions & 0 deletions install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -93,5 +93,49 @@ if ($CurrentPath -notlike "*$InstallDir*") {
Write-Host "Restart your terminal for the change to take effect in new sessions."
}

# --- Update Git Bash / MSYS2 shell profiles ---

$GitBashProfiles = @()
foreach ($f in @("$HOME\.bashrc", "$HOME\.bash_profile", "$HOME\.profile")) {
if (Test-Path $f) {
$GitBashProfiles += $f
break
}
}

$InstallDirPosix = $InstallDir -replace '\\', '/' -replace '^([A-Za-z]):', '/$1'
$PathLine = "export PATH=`"$InstallDirPosix:`$PATH`""

$NeedsUpdate = @()
foreach ($f in $GitBashProfiles) {
if (-not (Select-String -Path $f -SimpleMatch $InstallDirPosix -Quiet)) {
$NeedsUpdate += $f
}
}

if ($NeedsUpdate.Count -gt 0) {
Write-Host ""
Write-Host "Detected Git Bash shell profiles to update:"
foreach ($f in $NeedsUpdate) {
Write-Host " $f -> $PathLine"
}
Write-Host ""

$answer = Read-Host "Update these files now? [Y/n]"
if ($answer -match '^[nN]') {
Write-Host ""
Write-Host "Skipped. To add manually, append this line to your shell profile:"
Write-Host ""
Write-Host " $PathLine"
} else {
foreach ($f in $NeedsUpdate) {
Add-Content -Path $f -Value "`n# archgate`n$PathLine"
Write-Host " Updated: $f"
}
Write-Host ""
Write-Host "Restart Git Bash for the change to take effect."
}
}

Write-Host ""
Write-Host "Run 'archgate --help' to get started."
43 changes: 32 additions & 11 deletions install.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/sh
# Archgate installer for macOS and Linux
# Archgate installer for macOS, Linux, and Windows (Git Bash / MSYS2)
# Usage: curl -fsSL https://raw.githubusercontent.com/archgate/cli/main/install.sh | sh
set -eu

Expand All @@ -13,11 +13,12 @@ detect_platform() {
arch="$(uname -m)"

case "$os" in
Darwin) platform="darwin" ;;
Linux) platform="linux" ;;
Darwin) platform="darwin" ;;
Linux) platform="linux" ;;
MINGW*|MSYS*) platform="win32" ;;
*)
echo "Error: unsupported OS: $os" >&2
echo "archgate supports macOS (ARM64) and Linux (x86_64)." >&2
echo "archgate supports macOS (ARM64), Linux (x86_64), and Windows (x64)." >&2
exit 1
;;
esac
Expand All @@ -41,6 +42,10 @@ detect_platform() {
echo "Error: Linux is only supported on x86_64." >&2
exit 1
fi
if [ "$platform" = "win32" ] && [ "$arch" != "x64" ]; then
echo "Error: Windows is only supported on x86_64." >&2
exit 1
fi

ARTIFACT="archgate-${platform}-${arch}"
}
Expand Down Expand Up @@ -98,26 +103,38 @@ resolve_version() {
# --- Download and install ---

download_and_install() {
url="https://github.com/${REPO}/releases/download/${VERSION}/${ARTIFACT}.tar.gz"
if [ "$platform" = "win32" ]; then
ext="zip"
else
ext="tar.gz"
fi

url="https://github.com/${REPO}/releases/download/${VERSION}/${ARTIFACT}.${ext}"

echo "Installing archgate ${VERSION} (${ARTIFACT})..."

tmpdir="$(mktemp -d)"
trap 'rm -rf "$tmpdir"' EXIT

if command -v curl >/dev/null 2>&1; then
curl -fsSL "$url" -o "$tmpdir/archgate.tar.gz"
curl -fsSL "$url" -o "$tmpdir/archgate.${ext}"
elif command -v wget >/dev/null 2>&1; then
wget -qO "$tmpdir/archgate.tar.gz" "$url"
wget -qO "$tmpdir/archgate.${ext}" "$url"
else
echo "Error: neither 'curl' nor 'wget' is installed. Please install one of them to download archgate." >&2
exit 1
fi

tar -xzf "$tmpdir/archgate.tar.gz" -C "$tmpdir"
mkdir -p "$INSTALL_DIR"
mv "$tmpdir/archgate" "$INSTALL_DIR/archgate"
chmod +x "$INSTALL_DIR/archgate"

if [ "$platform" = "win32" ]; then
unzip -qo "$tmpdir/archgate.zip" -d "$tmpdir"
mv "$tmpdir/archgate.exe" "$INSTALL_DIR/archgate.exe"
else
tar -xzf "$tmpdir/archgate.tar.gz" -C "$tmpdir"
mv "$tmpdir/archgate" "$INSTALL_DIR/archgate"
chmod +x "$INSTALL_DIR/archgate"
fi
}

# --- Update PATH ---
Expand Down Expand Up @@ -272,7 +289,11 @@ main() {
resolve_version
download_and_install

echo "archgate ${VERSION} installed to ${INSTALL_DIR}/archgate"
if [ "$platform" = "win32" ]; then
echo "archgate ${VERSION} installed to ${INSTALL_DIR}/archgate.exe"
else
echo "archgate ${VERSION} installed to ${INSTALL_DIR}/archgate"
fi
setup_path

echo ""
Expand Down
Loading