Installation
The Google Workspace CLI can be installed via npm (recommended) or built from source using Cargo.System Requirements
Operating System
Operating System
- Linux: All major distributions (Ubuntu, Debian, Fedora, Arch, etc.)
- macOS: 10.15 (Catalina) or later
- Windows: Windows 10/11 with WSL2 recommended
Node.js (for npm installation)
Node.js (for npm installation)
- Version: Node.js 18 or later
- Check your version:
node --version - Download from nodejs.org
Rust (for source installation)
Rust (for source installation)
- Version: Rust 1.70 or later (2021 edition)
- Check your version:
cargo --version - Install from rustup.rs
gcloud CLI (for auth setup)
gcloud CLI (for auth setup)
- Required for
gws auth setupcommand - Optional if you configure OAuth manually
- Install from Google Cloud SDK
Install via npm (Recommended)
The easiest way to installgws is through npm:
The npm package includes pre-built binaries for Linux, macOS, and Windows. No Rust toolchain required.
Verify Installation
Confirm the CLI is installed correctly:Terminal
Output
Build from Source
If you want to build from source or contribute to development, use Cargo:Development Build
For active development, build without installing:Terminal
Terminal
Package Managers
Planned Support
- Homebrew (macOS/Linux):
brew install googleworkspace/tap/gws - Chocolatey (Windows):
choco install gws - Snap (Linux):
snap install gws
Configuration Directory
After installation,gws creates a configuration directory on first run:
| Platform | Location |
|---|---|
| Linux | ~/.config/gws/ |
| macOS | ~/Library/Application Support/gws/ |
| Windows | %APPDATA%\gws\ |
client_secret.json: OAuth client credentials (if configured manually)- Discovery cache: API discovery documents (cached for 24 hours)
- Encrypted credentials: OAuth tokens secured with OS keyring
Credentials are encrypted at rest using AES-256-GCM with keys stored in your OS keyring.
Updating
Keepgws up to date to get the latest features and bug fixes.
Update via npm
Terminal
Update from source
Terminal
Uninstall
Remove npm installation
Terminal
Remove Cargo installation
Terminal
Remove configuration
To completely remove all stored credentials and cache:Troubleshooting
Command not found: gws
Command not found: gws
Problem: The
gws binary is not in your PATH.Solution:- For npm: Ensure npm global bin directory is in PATH
- For Cargo: Ensure
~/.cargo/binis in your PATH
Permission denied errors
Permission denied errors
Problem: Insufficient permissions to install globally.Solution:
- Use
sudofor npm (not recommended): - Or configure npm to use a user directory (recommended):
Rust compilation errors
Rust compilation errors
Problem: Cargo build fails with dependency errors.Solution:
- Update Rust to the latest stable version:
- Clean build artifacts and retry:
Next Steps
Quickstart
Set up authentication and run your first command
Authentication
Configure Google Cloud OAuth credentials