Skip to content
Open
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
35 changes: 35 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ of your environment or kicking off a pentest as part of a continuous integration
The steps below will get you up and running quickly with h3-cli. These instructions were tested on
macOS and Linux machines, and generally should work on any [POSIX-compliant](https://en.wikipedia.org/wiki/POSIX) system with bash support.

For Windows users, please see the [Windows Installation](#windows-installation) section.

If you plan to run _internal_ pentests using h3-cli, you should install h3-cli on the same Docker Host
where you launch NodeZero.

Expand Down Expand Up @@ -97,6 +99,39 @@ h3
If everything's installed correctly, you should see the h3-cli help text.


## Windows Installation

**Prerequisites:**
- [Git for Windows](https://git-scm.com/download/win) (Git Bash)
- PowerShell 5.1 or later

### 1. Download and Install

Open PowerShell and run the following commands:

```powershell
# Clone the repository
git clone https://github.com/horizon3ai/h3-cli
cd h3-cli

# Run the installer
.\easy_install.ps1 -ApiKey "your-api-key-here"
```

The installer will:
1. Download `jq` for Windows.
2. Create your h3-cli profile in `~/.h3`.
3. Add `h3-cli/bin` to your User PATH.

### 2. Verify Installation

Restart your PowerShell terminal to ensure the PATH changes take effect, then run:

```powershell
h3 version
```


## Upgrading h3-cli

We release new features, bug fixes, and other updates for the h3-cli every month. Upgrade your installation using
Expand Down
30 changes: 30 additions & 0 deletions bin/h3.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
@echo off
setlocal

REM Try to find Git Bash in standard locations
if exist "%ProgramFiles%\Git\bin\bash.exe" (
set "BASH=%ProgramFiles%\Git\bin\bash.exe"
goto :Found
)
if exist "%ProgramFiles(x86)%\Git\bin\bash.exe" (
set "BASH=%ProgramFiles(x86)%\Git\bin\bash.exe"
goto :Found
)

REM Fallback to PATH bash
WHERE bash >nul 2>nul
IF %ERRORLEVEL% EQU 0 (
set "BASH=bash"
goto :Found
)

ECHO bash.exe not found. Please install Git Bash.
EXIT /B 1

:Found
SET "SCRIPT_DIR=%~dp0"
SET "SCRIPT_PATH=%SCRIPT_DIR%h3"
SET "SCRIPT_PATH=%SCRIPT_PATH:\=/%"

"%BASH%" "%SCRIPT_PATH%" %*
EXIT /B %ERRORLEVEL%
19 changes: 19 additions & 0 deletions bin/h3.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<#
.SYNOPSIS
Wrapper to run the h3 bash CLI on Windows.
#>
$ScriptPath = Join-Path $PSScriptRoot "h3"
$ScriptPath = $ScriptPath.Replace("\", "/")

$BashPath = "bash"
if (Test-Path "$env:ProgramFiles\Git\bin\bash.exe") {
$BashPath = "$env:ProgramFiles\Git\bin\bash.exe"
} elseif (Test-Path "$env:ProgramFiles(x86)\Git\bin\bash.exe") {
$BashPath = "$env:ProgramFiles(x86)\Git\bin\bash.exe"
} elseif (-not (Get-Command bash -ErrorAction SilentlyContinue)) {
Write-Error "bash.exe not found. Please install Git Bash."
exit 1
}

& "$BashPath" "$ScriptPath" @args
exit $LASTEXITCODE
Loading