Skip to content

Commit 6d66c81

Browse files
1broseidonclaude
andcommitted
feat: redesign landing page with modern UX and improved layout
Major UI/UX improvements to the documentation landing page: ## New Features - Modern segmented control for OS selection (macOS/Linux/Windows) - Animated sliding background indicator for active OS - Cleaner install command URLs (promptext.sh/install, etc.) - Dedicated uninstall script with comprehensive cleanup - OS-aware installation with Homebrew support for macOS ## Layout Improvements - Consolidated vertical spacing for better content visibility - Fixed-height terminal (450px) to prevent layout shifts - Terminal animation shows realistic workflow (cd to project, run prx) - Hero content vertically centered to match terminal height - View Docs button integrated into controls row ## Terminal Enhancements - Added directory context (~/projects/myapp) - Realistic command prompt with current directory - Updated output to show "myapp" instead of "promptext" - Added spacing between command and output for readability - Static height prevents jolting during animation ## Installation Scripts - Created Astro endpoints for clean install URLs - Added uninstall.sh with alias/PATH/symlink cleanup - Updated install.sh with correct uninstall syntax - Copied scripts to docs-astro/public/scripts for serving ## Icon & Visual Updates - Replaced emoji with proper SVG icons (Apple, Linux, Windows) - Fixed Linux icon to use correct Tux penguin SVG - Improved icon sizing and padding within buttons - Consistent rounded corners (8px) throughout 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent b2a1132 commit 6d66c81

File tree

13 files changed

+1677
-47
lines changed

13 files changed

+1677
-47
lines changed

.goreleaser.yaml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,19 @@ release:
7676
**Direct Install Scripts:**
7777
```bash
7878
# Linux/macOS
79-
curl -sSL https://raw.githubusercontent.com/1broseidon/promptext/main/scripts/install.sh | bash
79+
curl -sSL promptext.sh/install | bash
8080
8181
# Windows PowerShell
82-
irm https://raw.githubusercontent.com/1broseidon/promptext/main/scripts/install.ps1 | iex
82+
irm promptext.sh/install.ps1 | iex
83+
```
84+
85+
**Uninstall:**
86+
```bash
87+
# Linux/macOS
88+
curl -sSL promptext.sh/uninstall | bash
89+
90+
# Homebrew
91+
brew uninstall promptext
8392
```
8493
8594
**Manual Download:**

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,12 @@ go install github.com/1broseidon/promptext/cmd/promptext@latest
6969

7070
**Linux / macOS (curl):**
7171
```bash
72-
curl -sSL https://raw.githubusercontent.com/1broseidon/promptext/main/scripts/install.sh | bash
72+
curl -sSL promptext.sh/install | bash
7373
```
7474

7575
**Windows (PowerShell):**
7676
```powershell
77-
irm https://raw.githubusercontent.com/1broseidon/promptext/main/scripts/install.ps1 | iex
77+
irm promptext.sh/install.ps1 | iex
7878
```
7979

8080
**Manual Download:**
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Installation Scripts
2+
3+
These scripts are served via Astro endpoints at:
4+
- `promptext.sh/install``install.sh`
5+
- `promptext.sh/uninstall``uninstall.sh`
6+
- `promptext.sh/install.ps1``install.ps1`
7+
8+
## Keeping Scripts in Sync
9+
10+
**Important:** These scripts are copies from `/scripts` in the main repo.
11+
12+
When updating installation scripts:
13+
1. Update the source scripts in `/scripts/`
14+
2. Copy them here: `cp scripts/*.{sh,ps1} docs-astro/public/scripts/`
15+
3. Commit both locations together
16+
17+
## Endpoints
18+
19+
The Astro endpoints are defined in:
20+
- `src/pages/install.ts`
21+
- `src/pages/uninstall.ts`
22+
- `src/pages/install.ps1.ts`
23+
24+
These endpoints serve the scripts as plain text with proper headers for piping to bash/PowerShell.
Lines changed: 242 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,242 @@
1+
#Requires -Version 5.1
2+
[CmdletBinding()]
3+
param (
4+
[string]$Version = "latest",
5+
[switch]$Uninstall
6+
)
7+
8+
$ErrorActionPreference = "Stop"
9+
$ProgressPreference = "SilentlyContinue"
10+
11+
# Configuration
12+
$owner = "1broseidon"
13+
$repo = "promptext"
14+
$binaryName = "promptext.exe"
15+
$defaultInstallDir = Join-Path $env:LOCALAPPDATA "promptext"
16+
17+
function Write-Status {
18+
param([string]$Message)
19+
Write-Host "$Message" -ForegroundColor Blue
20+
}
21+
22+
function Get-LatestRelease {
23+
$url = "https://api.github.com/repos/$owner/$repo/releases/latest"
24+
$release = Invoke-RestMethod -Uri $url -UseBasicParsing
25+
return $release
26+
}
27+
28+
function Get-OSInfo {
29+
$arch = switch ($env:PROCESSOR_ARCHITECTURE) {
30+
"AMD64" { "x86_64" }
31+
"ARM64" { "arm64" }
32+
default {
33+
throw "Unsupported architecture: $env:PROCESSOR_ARCHITECTURE"
34+
}
35+
}
36+
return @{
37+
OS = "Windows"
38+
Arch = $arch
39+
}
40+
}
41+
42+
function Get-AssetUrl {
43+
param($Release)
44+
$osInfo = Get-OSInfo
45+
$patterns = @(
46+
"promptext_$($osInfo.OS)_$($osInfo.Arch).zip",
47+
"promptext-$($osInfo.OS)-$($osInfo.Arch).zip"
48+
)
49+
50+
Write-Host "Looking for release assets:" -ForegroundColor Yellow
51+
foreach ($pattern in $patterns) {
52+
Write-Host "- $pattern"
53+
}
54+
Write-Host "`nAvailable assets:" -ForegroundColor Yellow
55+
$Release.assets | ForEach-Object { Write-Host "- $($_.name)" }
56+
57+
foreach ($pattern in $patterns) {
58+
$assets = $Release.assets | Where-Object { $_.name -eq $pattern }
59+
if ($assets) {
60+
Write-Host "`nFound matching asset: $($assets[0].name)" -ForegroundColor Green
61+
return $assets[0].browser_download_url
62+
}
63+
}
64+
65+
throw "Could not find compatible Windows binary. Please report this issue."
66+
}
67+
68+
function Uninstall-Promptext {
69+
Write-Status "Uninstalling promptext..."
70+
71+
# Remove from PATH
72+
$currentPath = [Environment]::GetEnvironmentVariable("Path", "User")
73+
if ($currentPath -like "*$defaultInstallDir*") {
74+
$newPath = ($currentPath.Split(';') | Where-Object { $_ -ne $defaultInstallDir }) -join ';'
75+
[Environment]::SetEnvironmentVariable("Path", $newPath, "User")
76+
$env:Path = ($env:Path.Split(';') | Where-Object { $_ -ne $defaultInstallDir }) -join ';'
77+
}
78+
79+
# Remove installation directory
80+
if (Test-Path $defaultInstallDir) {
81+
Remove-Item -Path $defaultInstallDir -Recurse -Force
82+
}
83+
84+
# Remove alias from profile
85+
if (Test-Path $PROFILE.CurrentUserCurrentHost) {
86+
$content = Get-Content $PROFILE.CurrentUserCurrentHost | Where-Object { $_ -notmatch "Set-Alias.*prx.*promptext" }
87+
Set-Content -Path $PROFILE.CurrentUserCurrentHost -Value $content
88+
}
89+
90+
Write-Host "Promptext has been uninstalled successfully." -ForegroundColor Green
91+
exit 0
92+
}
93+
94+
function Verify-Checksum {
95+
param(
96+
$Release,
97+
$FilePath,
98+
$AssetName
99+
)
100+
101+
$checksumAsset = $Release.assets | Where-Object {
102+
$_.name -eq "checksums.txt" -or
103+
$_.name -eq "SHA256SUMS" -or
104+
$_.name -eq "sha256sums.txt"
105+
}
106+
if (-not $checksumAsset) {
107+
Write-Warning "Skipping checksum verification: checksum file not found in release"
108+
return
109+
}
110+
111+
Write-Status "Verifying checksum..."
112+
Write-Host "Asset name: $AssetName"
113+
$checksumUrl = $checksumAsset.browser_download_url
114+
$checksumContent = (Invoke-WebRequest -Uri $checksumUrl -UseBasicParsing).Content
115+
Write-Host "Checksum content:"
116+
Write-Host $checksumContent
117+
$expectedChecksum = ($checksumContent -split "`n" | Where-Object { $_ -like "*$AssetName*" }) -split '\s+' | Select-Object -First 1
118+
119+
if (-not $expectedChecksum) {
120+
Write-Warning "Skipping checksum verification: checksum not found for $AssetName"
121+
return
122+
}
123+
124+
$actualChecksum = Get-FileHash -Path $FilePath -Algorithm SHA256 | Select-Object -ExpandProperty Hash
125+
if ($actualChecksum -ne $expectedChecksum) {
126+
throw "Checksum verification failed.`nExpected: $expectedChecksum`nGot: $actualChecksum"
127+
}
128+
129+
Write-Status "Checksum verification successful"
130+
}
131+
132+
try {
133+
# Handle execution policy
134+
$policy = Get-ExecutionPolicy
135+
if ($policy -eq "Restricted") {
136+
Write-Status "Setting execution policy to RemoteSigned for current process..."
137+
Set-ExecutionPolicy -Scope Process -ExecutionPolicy RemoteSigned -Force
138+
}
139+
140+
if ($Uninstall) {
141+
Uninstall-Promptext
142+
exit 0
143+
}
144+
145+
$osInfo = Get-OSInfo
146+
Write-Status "Installing promptext..."
147+
Write-Status "OS: $($osInfo.OS)"
148+
Write-Status "Architecture: $($osInfo.Arch)"
149+
Write-Status "Installation directory: $defaultInstallDir"
150+
151+
# Create install directory
152+
if (-not (Test-Path $defaultInstallDir)) {
153+
New-Item -ItemType Directory -Path $defaultInstallDir | Out-Null
154+
}
155+
156+
# Get latest release info
157+
Write-Status "Fetching release information..."
158+
$release = Get-LatestRelease
159+
$downloadUrl = Get-AssetUrl $release
160+
161+
# Download and verify
162+
Write-Status "Downloading binary..."
163+
$zipPath = Join-Path $env:TEMP "promptext.zip"
164+
$assetName = $downloadUrl.Split('/')[-1]
165+
Invoke-WebRequest -Uri $downloadUrl -OutFile $zipPath -UseBasicParsing
166+
Verify-Checksum -Release $release -FilePath $zipPath -AssetName $assetName
167+
168+
Write-Status "Extracting files..."
169+
try {
170+
Add-Type -AssemblyName System.IO.Compression.FileSystem
171+
$zip = [System.IO.Compression.ZipFile]::OpenRead($zipPath)
172+
173+
# Find the executable entry
174+
$exeEntry = $zip.Entries | Where-Object {
175+
$_.Name -eq "promptext.exe" -and
176+
-not $_.FullName.Contains("../") -and
177+
-not $_.FullName.StartsWith("/")
178+
} | Select-Object -First 1
179+
180+
if (-not $exeEntry) {
181+
throw "Could not find valid promptext.exe in the archive"
182+
}
183+
184+
# Extract the executable
185+
$exePath = Join-Path $defaultInstallDir "promptext.exe"
186+
[System.IO.Compression.ZipFileExtensions]::ExtractToFile($exeEntry, $exePath, $true)
187+
188+
} catch {
189+
throw "Failed to extract executable: $_"
190+
} finally {
191+
if ($zip) {
192+
$zip.Dispose()
193+
}
194+
Remove-Item $zipPath -ErrorAction SilentlyContinue
195+
}
196+
197+
# Update PATH
198+
$currentPath = [Environment]::GetEnvironmentVariable("Path", "User")
199+
if (-not ($currentPath -like "*$defaultInstallDir*")) {
200+
$newPath = "$currentPath;$defaultInstallDir"
201+
[Environment]::SetEnvironmentVariable("Path", $newPath, "User")
202+
$env:Path = "$env:Path;$defaultInstallDir"
203+
Write-Status "Added $defaultInstallDir to PATH"
204+
}
205+
206+
# Add alias to PowerShell profile
207+
$profileDir = Split-Path $PROFILE.CurrentUserCurrentHost -Parent
208+
if (-not (Test-Path $profileDir)) {
209+
New-Item -ItemType Directory -Path $profileDir -Force | Out-Null
210+
}
211+
if (-not (Test-Path $PROFILE.CurrentUserCurrentHost)) {
212+
New-Item -ItemType File -Path $PROFILE.CurrentUserCurrentHost -Force | Out-Null
213+
}
214+
215+
$aliasLine = "Set-Alias prx '$defaultInstallDir\promptext.exe'"
216+
if (-not (Select-String -Path $PROFILE.CurrentUserCurrentHost -Pattern "Set-Alias.*prx.*promptext" -Quiet)) {
217+
Add-Content -Path $PROFILE.CurrentUserCurrentHost -Value $aliasLine
218+
Write-Status "Added 'prx' alias to PowerShell profile"
219+
}
220+
221+
# Verify installation
222+
$promptextPath = Join-Path $defaultInstallDir "promptext.exe"
223+
if (-not (Test-Path $promptextPath)) {
224+
throw "Installation failed: promptext.exe not found at $promptextPath"
225+
}
226+
227+
# Test the installation
228+
try {
229+
$version = & $promptextPath -v
230+
Write-Status "Installation verified: $version"
231+
} catch {
232+
Write-Warning "Installation completed but verification failed: $_"
233+
}
234+
235+
Write-Host "`n✨ Installation complete!" -ForegroundColor Green
236+
Write-Host "You can use either 'promptext' or 'prx' command after restarting your terminal." -ForegroundColor Yellow
237+
Write-Host "To uninstall, run this script with -Uninstall flag" -ForegroundColor Yellow
238+
239+
} catch {
240+
Write-Host "Error: $_" -ForegroundColor Red
241+
exit 1
242+
}

0 commit comments

Comments
 (0)