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
47 changes: 47 additions & 0 deletions .github/workflows/unix-regression.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Unix regression smoke

on:
pull_request:
paths:
- ".github/workflows/unix-regression.yml"
- "lib/ourocode/terminal/**"
- "test/ourocode/terminal/**"
- "rust/ourocode_ipc/**"
- "mix.exs"
- "mix.lock"
- "scripts/package.sh"
workflow_dispatch:

jobs:
tui-helper:
name: ${{ matrix.os }} tty helper
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]

steps:
- uses: actions/checkout@v4

- uses: erlef/setup-beam@v1
with:
otp-version: "27"
elixir-version: "1.18"

- uses: dtolnay/rust-toolchain@stable

- name: Fetch Mix dependencies
run: mix deps.get

- name: Build Unix tty helper
run: cargo build --release --manifest-path rust/ourocode_ipc/Cargo.toml --bin ourocode_tty

- name: Test Rust IPC crate
run: cargo test --manifest-path rust/ourocode_ipc/Cargo.toml

- name: Test terminal helper discovery
run: mix test test/ourocode/terminal/tty_driver_test.exs

- name: Package Unix release asset
run: ./scripts/package.sh
111 changes: 111 additions & 0 deletions .github/workflows/windows-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
name: Windows package smoke

on:
pull_request:
paths:
- ".github/workflows/windows-package.yml"
- "install.ps1"
- "uninstall.ps1"
- "scripts/package-windows.ps1"
- "lib/ourocode/terminal/tty_driver.ex"
- "rust/ourocode_ipc/**"
- "mix.exs"
- "mix.lock"
workflow_dispatch:

jobs:
package-install-smoke:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4

- uses: erlef/setup-beam@v1
with:
otp-version: "27"
elixir-version: "1.18"

- uses: dtolnay/rust-toolchain@stable
with:
targets: x86_64-pc-windows-msvc

- name: Fetch Mix dependencies
shell: pwsh
run: mix deps.get

- name: Build Windows release zip
shell: pwsh
run: |
.\scripts\package-windows.ps1 -Version "0.0.0-ci" -OutputDir ".\dist"
if (-not (Test-Path ".\dist\ourocode-v0.0.0-ci-windows-x64.zip")) {
throw "Windows release zip was not created"
}
if (-not (Test-Path ".\dist\ourocode-v0.0.0-ci-windows-x64.zip.sha256")) {
throw "Windows release checksum was not created"
}
$expanded = Join-Path $env:RUNNER_TEMP "Ourocode Expanded"
Expand-Archive -LiteralPath ".\dist\ourocode-v0.0.0-ci-windows-x64.zip" -DestinationPath $expanded -Force
if (-not (Get-ChildItem -LiteralPath $expanded -Recurse -Filter "uninstall.ps1" | Select-Object -First 1)) {
throw "Windows release zip did not include uninstall.ps1"
}

- name: Install from zip with checksum
shell: pwsh
run: |
$zip = Resolve-Path ".\dist\ourocode-v0.0.0-ci-windows-x64.zip"
$sha = (Get-FileHash -LiteralPath $zip -Algorithm SHA256).Hash
$root = Join-Path $env:RUNNER_TEMP "Ourocode Test"
$originalUserPath = [Environment]::GetEnvironmentVariable("Path", "User")
try {
powershell -NoProfile -ExecutionPolicy Bypass -File .\install.ps1 -LocalZip $zip -Sha256 $sha -InstallRoot $root
$expectedBin = Join-Path $root "bin"
$updatedUserPath = [Environment]::GetEnvironmentVariable("Path", "User")
if ($updatedUserPath -notlike "*$expectedBin*") {
throw "installer did not add the stable shim directory to the user PATH"
}
$env:Path = "$updatedUserPath;$([Environment]::GetEnvironmentVariable("Path", "Machine"))"
powershell -NoProfile -Command "ourocode --version"
cmd.exe /c "ourocode --version"
}
finally {
[Environment]::SetEnvironmentVariable("Path", $originalUserPath, "User")
}

- name: Reject checksum mismatch
shell: pwsh
run: |
$zip = Resolve-Path ".\dist\ourocode-v0.0.0-ci-windows-x64.zip"
$root = Join-Path $env:RUNNER_TEMP "Ourocode Bad Hash"
powershell -NoProfile -ExecutionPolicy Bypass -File .\install.ps1 -LocalZip $zip -Sha256 0000 -InstallRoot $root -NoPathUpdate
$code = $LASTEXITCODE
if ($code -eq 0) {
throw "checksum mismatch unexpectedly succeeded"
}
$global:LASTEXITCODE = 0

- name: Uninstall and reinstall loop
shell: pwsh
run: |
$zip = Resolve-Path ".\dist\ourocode-v0.0.0-ci-windows-x64.zip"
$sha = (Get-FileHash -LiteralPath $zip -Algorithm SHA256).Hash
$root = Join-Path $env:RUNNER_TEMP "Ourocode Reinstall"
$originalUserPath = [Environment]::GetEnvironmentVariable("Path", "User")
try {
powershell -NoProfile -ExecutionPolicy Bypass -File .\install.ps1 -LocalZip $zip -Sha256 $sha -InstallRoot $root
powershell -NoProfile -ExecutionPolicy Bypass -File .\uninstall.ps1 -InstallRoot $root -AllVersions
if (Test-Path -LiteralPath $root) {
throw "uninstall left install root behind"
}
$updatedUserPath = [Environment]::GetEnvironmentVariable("Path", "User")
if ($updatedUserPath -like "*$root*") {
throw "uninstall left the install root on user PATH"
}
powershell -NoProfile -ExecutionPolicy Bypass -File .\install.ps1 -LocalZip $zip -Sha256 $sha -InstallRoot $root
$cmd = Join-Path $root "bin\ourocode.cmd"
if (-not (Test-Path -LiteralPath $cmd)) {
throw "reinstall did not recreate the launcher"
}
}
finally {
[Environment]::SetEnvironmentVariable("Path", $originalUserPath, "User")
Remove-Item -LiteralPath $root -Recurse -Force -ErrorAction SilentlyContinue
}
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,7 @@

# Stray seed artifacts
/seed_*.yaml

.om*/
*.dump
docs/rubrics/
115 changes: 106 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,30 +22,53 @@ The current release is optimized for local macOS development and guided workflow

## Quick Start

Install the latest prerelease build:
Install the latest prerelease build on macOS or Linux:

```bash
curl -fsSL https://raw.githubusercontent.com/Q00/ourocode/release/bootstrap/install.sh | bash
```

Install a Windows release from PowerShell:

```powershell
powershell -NoProfile -ExecutionPolicy Bypass -File .\install.ps1 -Version <version>
```

Then run:

```bash
```text
ourocode
ourocode --version
```

With no arguments, `ourocode` uses the current working directory as the project
directory. Pass `--project-dir PATH` (or set `OUROCODE_PROJECT_DIR`) to point it
elsewhere.

### Requirements
### Requirements For Running Ourocode

The bundled `ourocode` is an Erlang escript, so it needs the **Erlang/OTP
runtime** (`escript`/`erl`) on your `PATH`. The installer installs it
best-effort (Homebrew on macOS, `apt`/`dnf` on Linux); if that is not possible
it stops with manual instructions. Install it yourself with `brew install
erlang`, `sudo apt-get install erlang`, or `sudo dnf install erlang`. Set
`OUROCODE_SKIP_ERLANG=1` to bypass the check.
runtime** (`escript`/`erl`) on your `PATH`.

Windows users need:

- Windows 10/11, Windows Server 2019, or Windows Server 2022.
- Windows PowerShell 5.1 or PowerShell 7+.
- Erlang/OTP with `erl.exe` and `escript.exe` available on `PATH`.

Check the Windows runtime prerequisites:

```powershell
$PSVersionTable.PSVersion
Get-Command escript.exe
erl -eval "erlang:display(erlang:system_info(otp_release)), halt()." -noshell
```

macOS and Linux users need Erlang/OTP with `escript` and `erl` on `PATH`. The
Unix installer installs it best-effort (Homebrew on macOS, `apt`/`dnf` on
Linux); if that is not possible it stops with manual instructions. Install it
yourself with `brew install erlang`, `sudo apt-get install erlang`, or `sudo dnf
install erlang`. Set `OUROCODE_SKIP_ERLANG=1` to bypass the check on Unix.

Optional model backends:

Expand Down Expand Up @@ -102,7 +125,7 @@ Ctrl-G show active key help

## Install Locally

Install from GitHub without cloning:
Install from GitHub without cloning on macOS or Linux:

```bash
curl -fsSL https://raw.githubusercontent.com/Q00/ourocode/release/bootstrap/install.sh | bash
Expand All @@ -115,6 +138,61 @@ When run from a source checkout, the same installer uses bundled release binarie

Set `OUROCODE_SKIP_OUROBOROS=1` to skip the best-effort Ouroboros install step.

### Windows PowerShell Install

The Windows path uses PowerShell only. It does not require Bash, Git Bash, WSL,
`tar`, `chmod`, or a permanent execution-policy change.

Final-user prerequisites:

- Windows 10/11, Windows Server 2019, or Windows Server 2022.
- Windows PowerShell 5.1 or PowerShell 7+.
- Erlang/OTP on `PATH`, including `erl.exe` and `escript.exe`.

Verify prerequisites before installing:

```powershell
$PSVersionTable.PSVersion
Get-Command escript.exe
erl -eval "erlang:display(erlang:system_info(otp_release)), halt()." -noshell
```

Install a release:

```powershell
powershell -NoProfile -ExecutionPolicy Bypass -File .\install.ps1 -Version <version>
ourocode --version
```

`-ExecutionPolicy Bypass` applies only to that process. The installer does not
change the machine or user execution policy permanently.

When downloading a release, the installer downloads the matching `.sha256`
sidecar and verifies the zip before installing. For a local zip, pass `-Sha256`
with the expected hash or keep the `.zip.sha256` sidecar next to the zip. It writes the selected version under
`%LOCALAPPDATA%\Ourocode\<version>`, creates the launcher in
`%LOCALAPPDATA%\Ourocode\bin`, and updates the user `PATH` so new PowerShell or
`cmd.exe` windows can run `ourocode`. If the current shell was open before
install, restart the shell or refresh `PATH` before running the launcher.

Uninstall all Windows versions and remove the launcher/PATH entry:

```powershell
powershell -NoProfile -ExecutionPolicy Bypass -File .\uninstall.ps1 -AllVersions
```

Then rerun the installer. This install/uninstall loop is safe to repeat:

```powershell
powershell -NoProfile -ExecutionPolicy Bypass -File .\install.ps1 -Version <version>
powershell -NoProfile -ExecutionPolicy Bypass -File .\uninstall.ps1 -AllVersions
powershell -NoProfile -ExecutionPolicy Bypass -File .\install.ps1 -Version <version>
```

If a Windows build does not include `ourocode_tty.exe`, Ourocode still starts
through the escript launcher and reports the reduced TUI helper capability
instead of requiring Bash or WSL.

## Package A Release

Build a local release tarball:
Expand Down Expand Up @@ -157,6 +235,25 @@ brew install ourocode

Longer term, Ourocode should move toward a single self-contained binary or app bundle so users do not need to install Elixir/Rust just to run it.

### Windows Release Builder Prerequisites

Developers and release builders need the final-user prerequisites plus:

- Git.
- Erlang/OTP.
- Elixir and Mix.
- Rust stable with the MSVC target for the release architecture.
- Microsoft C++ Build Tools / MSVC Build Tools.

Build a Windows release zip:

```powershell
.\scripts\package-windows.ps1 -Version <version>
```

The Windows package command emits `dist\ourocode-v<version>-windows-x64.zip`
and a `.sha256` file for checksum verification by the PowerShell installer.

## Architecture

This section is for contributors and plugin authors. Day-to-day users should
Expand Down
31 changes: 28 additions & 3 deletions docs/site/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,12 @@ <h1 id="hero-title">Ourocode</h1>
Start with a PM interview, clarify the task, approve execution, and keep proof in the terminal.
</p>
<div class="hero-actions" id="install">
<button class="copy-command" type="button" data-copy="powershell -NoProfile -ExecutionPolicy Bypass -File .\install.ps1 -Version &lt;version&gt;">
<span>PowerShell: .\install.ps1 -Version &lt;version&gt;</span>
<span class="copy-state">copy</span>
</button>
<button class="copy-command" type="button" data-copy="curl -fsSL https://raw.githubusercontent.com/Q00/ourocode/release/bootstrap/install.sh | bash">
<span>curl -fsSL .../install.sh | bash</span>
<span>Unix: curl -fsSL .../install.sh | bash</span>
<span class="copy-state">copy</span>
</button>
<a class="secondary-action" href="../remote-headless-control.md">Headless JSON</a>
Expand Down Expand Up @@ -147,9 +151,30 @@ <h2>Built around decisions, not log watching.</h2>
<section class="section install-panel">
<div>
<p class="eyebrow">install</p>
<h2>Run it from a source checkout or release build.</h2>
<h2>Install with PowerShell on Windows or Bash on Unix.</h2>
<p>
Windows uses PowerShell 5.1+ or 7+, Erlang/OTP, and `escript.exe`.
Downloaded releases verify the `.sha256` sidecar before install, write to `%LOCALAPPDATA%\Ourocode`,
update the user PATH for new shells, and include `uninstall.ps1` for repeatable reinstall cycles.
The Windows path does not require Bash, WSL, or a permanent execution-policy change.
Release builders also need Git, Elixir/Mix, Rust stable with the MSVC target, and MSVC Build Tools.
</p>
</div>
<pre><code>curl -fsSL https://raw.githubusercontent.com/Q00/ourocode/release/bootstrap/install.sh | bash
<pre><code># Windows final-user checks
$PSVersionTable.PSVersion
Get-Command escript.exe
erl -eval "erlang:display(erlang:system_info(otp_release)), halt()." -noshell

# Windows install
powershell -NoProfile -ExecutionPolicy Bypass -File .\install.ps1 -Version &lt;version&gt;
ourocode --version
powershell -NoProfile -ExecutionPolicy Bypass -File .\uninstall.ps1 -AllVersions

# Windows release builder
.\scripts\package-windows.ps1 -Version &lt;version&gt;

# macOS / Linux
curl -fsSL https://raw.githubusercontent.com/Q00/ourocode/release/bootstrap/install.sh | bash
ourocode
ourocode --prompt "/agents" --format json
ourocode --verify --format json --project-dir .</code></pre>
Expand Down
Loading