# Installation Methods for OfficeCLI: Complete Setup Guide for macOS, Linux, and Windows

> Install OfficeCLI easily on macOS, Linux, and Windows using seven methods like shell scripts, Homebrew, Scoop, npm, or binary downloads. Get started now!

- Repository: [OfficeAI/OfficeCLI](https://github.com/iofficeai/OfficeCLI)
- Tags: getting-started
- Published: 2026-07-14

---

**OfficeCLI offers seven installation methods including one-line shell scripts, package managers (Homebrew, Scoop, npm), and manual binary downloads, all of which verify SHA-256 checksums and place the `officecli` binary in your PATH.**

The iOfficeAI/OfficeCLI repository provides a self-contained, cross-platform command-line tool for office automation. Regardless of your operating system, you can install OfficeCLI using automated scripts that handle platform detection, checksum verification, and PATH configuration automatically.

## One-Line Installation Scripts

The fastest way to install OfficeCLI uses curl on Unix systems or PowerShell on Windows. These methods download the official installer scripts from the repository, detect your operating system and architecture, fetch the appropriate binary, verify its integrity, and install it to your local bin directory.

### macOS and Linux (Bash)

The [`install.sh`](https://github.com/iOfficeAI/OfficeCLI/blob/main/install.sh) script located in the repository root handles platform detection and binary placement for Unix-like systems. It downloads the matching binary from the official mirror (with GitHub as a fallback), verifies the SHA-256 checksum against the `SHA256SUMS` manifest, and copies the binary to `~/.local/bin`.

```bash
curl -fsSL https://raw.githubusercontent.com/iOfficeAI/OfficeCLI/main/install.sh | bash

```

After execution, the `officecli` command becomes available in your terminal without requiring `sudo` privileges.

### Windows (PowerShell)

Windows users can use the equivalent `install.ps1` script, which performs the same OS detection, binary download, and checksum verification. The script places the executable in `%USERPROFILE%\.local\bin` and updates the user PATH.

```powershell
irm https://raw.githubusercontent.com/iOfficeAI/OfficeCLI/main/install.ps1 | iex

```

## Package Manager Installation

For users who prefer managing tools through package managers, OfficeCLI supports Homebrew on macOS/Linux, Scoop on Windows, and npm across all platforms.

### Homebrew (macOS and Linux)

Homebrew installs OfficeCLI via a dedicated tap, handling binary placement within the Homebrew prefix and making `officecli` globally available.

```bash
brew install officecli

```

### Scoop (Windows)

Scoop fetches the binary from its bucket, verifies the checksum, and adds the executable to the Scoop shim directory automatically.

```powershell
scoop install officecli

```

### npm (Global Installation)

The `@officecli/officecli` package works on any platform with Node.js installed. When you run the global install command, the npm package executes a downloader that fetches the native binary for your current platform and proxies the `officecli` command.

```bash
npm install -g @officecli/officecli

```

As documented in [`npm/README.md`](https://github.com/iOfficeAI/OfficeCLI/blob/main/npm/README.md), this method is particularly useful for CI/CD pipelines or environments where Node.js is already present.

## Manual and Bare Invocation Methods

### Manual Binary Download

You can download pre-built binaries directly from the GitHub Releases page without using scripts. Choose the appropriate file for your platform (e.g., `officecli-linux-x64`), move it to a directory in your PATH, and set execution permissions on Unix systems.

```bash

# Example for Linux x64

curl -L -o officecli-linux-x64 https://github.com/iOfficeAI/OfficeCLI/releases/download/vX.Y.Z/officecli-linux-x64
chmod +x officecli-linux-x64
mv officecli-linux-x64 ~/.local/bin/officecli

```

### Bare Invocation (Auto-Install)

OfficeCLI supports a zero-install workflow where running the command without a prior installation triggers the same one-line download routine automatically. The first invocation both installs and executes the command.

```bash
officecli --help

```

## How the Installation Scripts Work

The installation process relies on [`install.sh`](https://github.com/iOfficeAI/OfficeCLI/blob/main/install.sh) (and its PowerShell counterpart `install.ps1`) to ensure secure, platform-specific deployment. According to the source code in `iOfficeAI/OfficeCLI`, these scripts perform several critical functions:

- **Platform Detection**: Automatically identify the operating system and CPU architecture to select the correct binary
- **Checksum Verification**: Validate downloaded binaries against the `SHA256SUMS` manifest to prevent tampering
- **Secure Placement**: Install to user-local directories (`~/.local/bin` on Unix, `%USERPROFILE%\.local\bin` on Windows) without requiring administrative privileges
- **PATH Management**: Update shell configuration files or environment variables to ensure the binary is accessible

Binaries are also signed for macOS to satisfy Gatekeeper requirements on Apple systems.

## Summary

- **One-line scripts** provide the fastest setup using `curl` on macOS/Linux or `irm` on Windows, with automatic platform detection and SHA-256 verification
- **Package managers** including Homebrew, Scoop, and npm (`@officecli/officecli`) offer familiar installation workflows for their respective ecosystems
- **Manual installation** allows direct binary downloads from GitHub Releases for air-gapped or specific version requirements
- **Bare invocation** enables automatic installation when running `officecli` for the first time
- All methods reference the installer logic in [`install.sh`](https://github.com/iOfficeAI/OfficeCLI/blob/main/install.sh) and verify binaries against cryptographic checksums before placement in `~/.local/bin` (Unix) or `%USERPROFILE%\.local\bin` (Windows)

## Frequently Asked Questions

### Does OfficeCLI require administrator privileges to install?

No. All installation methods place the binary in user-local directories such as `~/.local/bin` on macOS and Linux, or `%USERPROFILE%\.local\bin` on Windows. This approach avoids modifying system directories and allows installation without `sudo` or elevated PowerShell sessions.

### How does the npm package install a native binary?

The `@officecli/officecli` npm package contains a post-install script that runs the same downloader logic found in [`install.sh`](https://github.com/iOfficeAI/OfficeCLI/blob/main/install.sh). When you execute `npm install -g @officecli/officecli`, the package detects your platform, downloads the appropriate native binary, and creates a proxy command that invokes it.

### Is it safe to pipe the installation script directly to bash or PowerShell?

Yes. The scripts in [`install.sh`](https://github.com/iOfficeAI/OfficeCLI/blob/main/install.sh) and `install.ps1` verify every downloaded binary against SHA-256 checksums before installation. However, if you prefer to inspect the script first, you can download it separately with `curl -o install.sh`, review the contents, and then execute it locally with `bash install.sh`.

### Can I install OfficeCLI on CI/CD runners?

Yes. The one-line curl and PowerShell commands work well in CI/CD environments. Alternatively, use the npm global install method (`npm install -g @officecli/officecli`) in workflows that already include Node.js, or download binaries directly from GitHub Releases for specific version pinning.