Skip to content

Commit f458f65

Browse files
committed
Add Windows install script and instructions
1 parent 050b0d9 commit f458f65

3 files changed

Lines changed: 81 additions & 2 deletions

File tree

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,16 @@ A command-line tool for Webex APIs — Calling, Contact Center, Admin, Devices,
44

55
## Install
66

7+
**macOS / Linux:**
78
```bash
89
curl -fsSL https://raw.githubusercontent.com/Cloverhound/webex-cli/main/install.sh | sh
910
```
1011

12+
**Windows (PowerShell):**
13+
```powershell
14+
irm https://raw.githubusercontent.com/Cloverhound/webex-cli/main/install.ps1 | iex
15+
```
16+
1117
Or download from [Releases](https://github.com/Cloverhound/webex-cli/releases).
1218

1319
## Quick Start

install.ps1

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# Webex CLI installer for Windows
2+
# Usage: irm https://raw.githubusercontent.com/Cloverhound/webex-cli/main/install.ps1 | iex
3+
4+
$ErrorActionPreference = "Stop"
5+
6+
$Repo = "Cloverhound/webex-cli"
7+
$Binary = "webex.exe"
8+
$InstallDir = "$env:LOCALAPPDATA\webex-cli"
9+
10+
# Detect architecture
11+
$Arch = if ([Environment]::Is64BitOperatingSystem) {
12+
if ($env:PROCESSOR_ARCHITECTURE -eq "ARM64") { "arm64" } else { "amd64" }
13+
} else {
14+
Write-Error "Unsupported: 32-bit Windows is not supported"
15+
return
16+
}
17+
18+
# Get latest version
19+
Write-Host "Fetching latest release..."
20+
$Release = Invoke-RestMethod "https://api.github.com/repos/$Repo/releases/latest"
21+
$Version = $Release.tag_name -replace '^v', ''
22+
if (-not $Version) {
23+
Write-Error "Could not determine latest version"
24+
return
25+
}
26+
Write-Host "Latest version: v$Version"
27+
28+
# Download
29+
$ZipName = "webex-cli_${Version}_windows_${Arch}.zip"
30+
$Url = "https://github.com/$Repo/releases/download/v$Version/$ZipName"
31+
32+
$TmpDir = New-Item -ItemType Directory -Path (Join-Path $env:TEMP "webex-cli-install-$(Get-Random)")
33+
34+
try {
35+
Write-Host "Downloading $Url..."
36+
Invoke-WebRequest -Uri $Url -OutFile (Join-Path $TmpDir $ZipName)
37+
38+
# Extract
39+
Expand-Archive -Path (Join-Path $TmpDir $ZipName) -DestinationPath $TmpDir -Force
40+
41+
# Install
42+
New-Item -ItemType Directory -Path $InstallDir -Force | Out-Null
43+
Move-Item -Path (Join-Path $TmpDir $Binary) -Destination (Join-Path $InstallDir $Binary) -Force
44+
45+
# Add to user PATH if not already there
46+
$UserPath = [Environment]::GetEnvironmentVariable("Path", "User")
47+
if ($UserPath -notlike "*$InstallDir*") {
48+
[Environment]::SetEnvironmentVariable("Path", "$InstallDir;$UserPath", "User")
49+
$env:Path = "$InstallDir;$env:Path"
50+
Write-Host "Added $InstallDir to your PATH."
51+
}
52+
53+
Write-Host ""
54+
Write-Host "Installed webex v$Version to $InstallDir\$Binary"
55+
Write-Host ""
56+
Write-Host "NOTE: Restart your terminal for PATH changes to take effect."
57+
Write-Host ""
58+
Write-Host "Get started:"
59+
Write-Host " webex config set client-id <your-client-id> # if not using built-in defaults"
60+
Write-Host " webex config set client-secret <your-client-secret>"
61+
Write-Host " webex login"
62+
} finally {
63+
Remove-Item -Recurse -Force $TmpDir -ErrorAction SilentlyContinue
64+
}

site/src/content/docs/installation.mdx

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,19 @@ description: How to install the Webex CLI.
55

66
## Quick Install
77

8+
**macOS / Linux:**
89
```bash
910
curl -fsSL https://raw.githubusercontent.com/Cloverhound/webex-cli/main/install.sh | sh
1011
```
1112

12-
This downloads the latest release for your platform and installs it to `/usr/local/bin/webex`.
13+
This downloads the latest release and installs it to `/usr/local/bin/webex`.
14+
15+
**Windows (PowerShell):**
16+
```powershell
17+
irm https://raw.githubusercontent.com/Cloverhound/webex-cli/main/install.ps1 | iex
18+
```
19+
20+
This downloads the latest release and installs it to `%LOCALAPPDATA%\webex-cli\webex.exe`, and adds it to your user PATH.
1321

1422
## Manual Download
1523

@@ -22,6 +30,7 @@ Download the binary for your platform from the [GitHub Releases](https://github.
2230
| Linux | x86_64 | `webex-cli_*_linux_amd64.tar.gz` |
2331
| Linux | ARM64 | `webex-cli_*_linux_arm64.tar.gz` |
2432
| Windows | x86_64 | `webex-cli_*_windows_amd64.zip` |
33+
| Windows | ARM64 | `webex-cli_*_windows_arm64.zip` |
2534

2635
## Build from Source
2736

@@ -31,7 +40,7 @@ cd webex-cli
3140
go build -o webex .
3241
```
3342

34-
Requires Go 1.20+.
43+
Requires Go 1.23+.
3544

3645
## Verify Installation
3746

0 commit comments

Comments
 (0)