Guide
Install OpenClaw CLI for the Nylas Plugin
Install OpenClaw from npm so you can use the Nylas plugin for email, calendar, and contacts. Covers PATH fixes, Windows setup, plugin installation, and how OpenClaw with Nylas supports all major email providers.
Written by Nick Barraclough Product Manager
What this guide covers
OpenClaw is an open-source CLI framework for building AI-powered messaging assistants. It connects to email, WhatsApp, iMessage, and other channels through a plugin system that currently lists over 40 community-maintained packages on npm. You install the CLI globally from npm, add plugins for the integrations you need, and configure each one through a JSON config file. The goal here is to get OpenClaw installed and ready to run the Nylas plugin for email, calendar, and contacts.
Quick path for Nylas users
The fastest way to get Nylas running inside OpenClaw is a 7-step sequence that takes under 3 minutes on a fresh machine with Node.js already installed. The steps cover installing the CLI, adding the Nylas plugin, trusting it for agent sessions, and verifying the connection with a test query against your email accounts.
Each step below runs a single command. The config set calls write to OpenClaw's JSON config at ~/.openclaw/config.json, and the gateway restart picks up those changes without losing active sessions.
If you do not have a Nylas API key yet, create a Nylas account before step 5, then copy the API key into the OpenClaw plugin config.
# 1. Install OpenClaw
npm install -g openclaw
# 2. Verify the binary is on PATH
openclaw --version
# 3. Install the Nylas plugin
openclaw plugins install @nylas/openclaw-nylas-plugin
# 4. Trust the plugin and expose its tools to agent sessions
openclaw config set 'plugins.allow' '["nylas"]'
openclaw config set 'tools.alsoAllow' '["nylas"]'
# 5. Configure your Nylas API key
openclaw config set 'plugins.entries.nylas.config.apiKey' 'YOUR_NYLAS_API_KEY'
# 6. Restart the gateway so the plugin config is reloaded
openclaw gateway restart
# 7. Verify the integration
openclaw plugins list
openclaw run "List my connected email accounts" --plugin nylasThe sections that follow explain each install step in detail, cover PATH fixes for common environments, and address troubleshooting for both macOS/Linux and Windows.
What Is the OpenClaw npm Package Name?
The OpenClaw CLI is published on npm under the unscoped package name openclaw. There is no @openclaw/ scope prefix for the core CLI binary. Plugins follow a different convention and use scoped names like @nylas/openclaw-nylas-plugin, but the CLI itself installs from the top-level openclaw package. The package has been on npm since early 2025 and averages over 12,000 weekly downloads as of May 2026.
Running npm install -g openclaw places the openclaw binary in your npm global bin directory, typically at $(npm config get prefix)/bin/.
# The npm package name is "openclaw"
npm install -g openclawInstall OpenClaw CLI
Installing OpenClaw CLI requires Node.js 22.12.0 or later and a single npm install -g command. The global install places the openclaw binary on your system PATH so it is available in every terminal session. On a typical broadband connection, the full install completes in under 60 seconds and downloads approximately 45 MB of dependencies.
Check your Node.js version first. OpenClaw uses native ES modules and the Node.js built-in test runner, both of which require Node.js 22.12.0 as a minimum. Older versions fail at startup with a syntax error.
# Check Node.js version (must be 22.12.0+)
node --version
# Install OpenClaw CLI globally
npm install -g openclaw
# Verify the installation
openclaw --versionIf you see a version number, the install succeeded. A "command not found" error means the npm global bin directory is not on your PATH — the troubleshooting section on PATH fixes addresses that directly.
On systems where you manage Node.js with nvm, make sure your active Node version is 22.12.0 or above before running the install:
# Switch to Node.js 22 with nvm
nvm install 22
nvm use 22
# Then install openclaw
npm install -g openclawWhat Are the System Requirements?
OpenClaw runs on macOS (Intel and Apple Silicon), Linux (x64 and arm64), and Windows 10 or later. The only hard dependency is Node.js 22.12.0+, which itself requires about 80 MB of disk space. OpenClaw adds roughly 45 MB on top of that for its own dependencies. No native compiler toolchain is needed because the CLI is pure JavaScript with no native add-ons.
| Platform | Node.js install | Notes |
|---|---|---|
| macOS | brew install node@22 | Works on Apple Silicon and Intel |
| Ubuntu / Debian | NodeSource or nvm | System apt packages are too old |
| Windows | nodejs.org installer | Use PowerShell, not cmd.exe |
| WSL | nvm | Same as Linux instructions |
Install OpenClaw Plugins
OpenClaw plugins are npm packages that register new tools, integrations, and commands with the CLI. The built-in plugin manager handles downloading, version resolution, and tool registration. As of May 2026, the OpenClaw ecosystem has over 40 published plugins covering email, messaging, CRM, and developer tooling. Each plugin installs in a few seconds and activates after a gateway restart.
The openclaw plugins subcommands manage the full plugin lifecycle: install, list, update, and uninstall. After installing a plugin or changing plugin config, run openclaw gateway restart so the gateway process loads the new plugin state.
# Install a plugin
openclaw plugins install <package-name>
# Example: install the Nylas plugin for email, calendar, and contacts
openclaw plugins install @nylas/openclaw-nylas-plugin
# Verify it was installed
openclaw plugins list
# Restart the gateway so new plugins are loaded
openclaw gateway restartPlugin management commands reference
| Command | Description |
|---|---|
openclaw plugins install <pkg> | Install a plugin from npm |
openclaw plugins uninstall <pkg> | Remove an installed plugin |
openclaw plugins list | List all installed plugins |
openclaw plugins list --json | List plugins in JSON format |
openclaw plugins update <pkg> | Update a plugin to its latest version |
openclaw plugins update --all | Update all installed plugins |
List Installed Plugins
The openclaw plugins list command prints every installed plugin with its version number and active/inactive status. The output is a 3-column table showing NAME, VERSION, and STATUS. Adding the --json flag produces machine-readable JSON that you can pipe to jq or parse in a script — useful for CI checks that verify a required plugin set before deploying an agent.
A plugin shows "active" when its tools are loaded and available for agent sessions. A status of "inactive" means the plugin is installed but either disabled in config or failed to initialize during the last gateway start.
# List all installed plugins
openclaw plugins list
# Example output:
# NAME VERSION STATUS
# @nylas/openclaw-nylas-plugin 1.2.0 active
# openclaw-whatsapp-bridge 0.9.1 active
# openclaw-imsg 0.8.3 active
# JSON output for scripting
openclaw plugins list --jsonUninstall Plugins
The openclaw plugins uninstall command removes a plugin and deregisters all of its tools from the CLI in a single step. The uninstall takes effect immediately without a gateway restart, unlike plugin installation which requires one. The plugin's npm package is deleted from the local ~/.openclaw/plugins/ directory, freeing the disk space it occupied — typically 5-15 MB per plugin depending on dependencies.
Pass the full npm package name exactly as it appeared during install. Run openclaw plugins list afterward to confirm the plugin no longer appears.
# Uninstall a plugin
openclaw plugins uninstall @nylas/openclaw-nylas-plugin
# Verify it was removed
openclaw plugins listOpenClaw on Windows
OpenClaw runs natively on Windows 10 and later through PowerShell 5.1+. The Windows install path is the same as macOS and Linux: install Node.js 22.12.0 or later, then run npm install -g openclaw. According to the Node.js Foundation, the Windows .msi installer from nodejs.org automatically adds Node.js and npm to the system PATH, which means OpenClaw's binary is available without manual PATH edits in most cases.
# Windows PowerShell setup
# 1. Install Node.js 22+ from https://nodejs.org (use the LTS installer)
# 2. Open PowerShell and verify Node.js
node --version
# 3. Install OpenClaw globally
npm install -g openclaw
# 4. Verify
openclaw --version
# 5. If you get EACCES or permission errors, run PowerShell as Administrator:
# Right-click PowerShell → "Run as Administrator"
# Then repeat: npm install -g openclawOn Windows, the OpenClaw config directory is %USERPROFILE%\.openclaw\. Plugins and configuration files live in that directory. Make sure your PATH includes the npm global bin directory, which the Node.js installer normally sets up automatically.
Optional: iMessage CLI Path Setup
The openclaw-imsg plugin bridges OpenClaw to iMessage on macOS. Because macOS app sandboxing restricts where binaries can live, the plugin cannot auto-detect the iMessage CLI binary — you must set the path explicitly via openclaw config set imsg.cliPath. This extra step takes about 30 seconds and is only needed once per machine.
The iMessage CLI binary (imsg-cli) is a separate open-source tool. If you installed it via Homebrew, the binary lives under $(brew --prefix)/bin/. Manual installs typically place it at /usr/local/bin/imsg-cli.
# Install the iMessage plugin
openclaw plugins install openclaw-imsg
# Set the iMessage CLI binary path
openclaw config set imsg.cliPath "/usr/local/bin/imsg-cli"
# If you installed imsg-cli via Homebrew:
openclaw config set imsg.cliPath "$(brew --prefix)/bin/imsg-cli"
# Verify the path is set
openclaw config get imsg.cliPath
# Test the iMessage connection
openclaw imsg statusThe imsg.cliPath config value must point to the actual binary. If you get "command not found" errors from the plugin, the path is wrong or the binary does not exist at that location. Use which imsg-cli to find the correct path on your system.
Optional: WhatsApp Integration
The openclaw-whatsapp-bridge plugin connects OpenClaw to the WhatsApp Business API, which serves over 2 billion monthly active users according to Meta's 2025 earnings report. The plugin handles message sending, receiving, and webhook registration through Meta's Cloud API. You need a WhatsApp Business account and an access token from the Meta developer dashboard. Setup takes about 5 minutes once you have your credentials ready.
Three config values are required: the access token, the phone number ID, and the business account ID. All three are available in the Meta Developer Portal under your WhatsApp app settings.
# Install the WhatsApp bridge plugin
openclaw plugins install openclaw-whatsapp-bridge
# Configure your WhatsApp Business credentials
openclaw config set whatsapp.accessToken "YOUR_ACCESS_TOKEN"
openclaw config set whatsapp.phoneNumberId "YOUR_PHONE_NUMBER_ID"
openclaw config set whatsapp.businessAccountId "YOUR_BUSINESS_ACCOUNT_ID"
# Verify the configuration
openclaw whatsapp status
# Send a test message
openclaw whatsapp send --to "+1234567890" --message "Hello from OpenClaw"The phone number ID identifies which WhatsApp number sends messages on behalf of your agent. Access tokens generated in the Meta Developer Portal expire after 24 hours unless you create a permanent token through the System Users page in Business Settings. For production deployments, use a permanent token to avoid authentication failures.
Optional: Configure exec-approvals.json
OpenClaw's exec approval system controls which shell commands plugins are allowed to run on your machine. The exec-approvals.json file defines pattern-based rules with 3 possible actions: allow, deny, or ask (prompt before executing). Without this file, OpenClaw defaults to prompting for every shell command, which means plugins cannot run anything silently unless you explicitly approve it.
The config file lives at ~/.openclaw/exec-approvals.json on macOS and Linux, or %USERPROFILE%\.openclaw\exec-approvals.json on Windows. Rules are evaluated top-to-bottom; the first matching pattern wins. The example below shows a typical setup with 3 rules covering Nylas CLI, curl, and file deletion.
// Example exec-approvals.json
{
"version": 1,
"rules": [
{
"pattern": "nylas *",
"action": "allow",
"comment": "Allow all Nylas CLI commands"
},
{
"pattern": "curl *",
"action": "ask",
"comment": "Prompt before running curl"
},
{
"pattern": "rm *",
"action": "deny",
"comment": "Never allow file deletion"
}
],
"default": "ask"
}The default field controls what happens when no rule matches. Set it to "ask" to be prompted for unknown commands, "deny" to block everything not explicitly allowed, or "allow" if you trust all plugins completely. For most users, "ask" is the safest default.
You can inspect the current config with cat or reset it to OpenClaw's defaults. The reset command restores the factory exec-approvals.json with a default action of ask and no custom rules.
# View your current exec approvals config
cat ~/.openclaw/exec-approvals.json
# Reset to defaults
openclaw config reset exec-approvalsAdd the Nylas Plugin
The @nylas/openclaw-nylas-plugin adds native email, calendar, and contacts tools to OpenClaw. The Nylas plugin supports 6 email providers — Gmail, Outlook, Exchange, Yahoo, iCloud, and IMAP — through a single API. It registers over 20 tools with OpenClaw covering message CRUD, calendar event management, contact search, and attachment handling.
Installation requires the npm package name, a Nylas API key (from dashboard.nylas.com), and a gateway restart. The API key is stored in OpenClaw's local config file and never leaves your machine.
# Install the Nylas plugin
openclaw plugins install @nylas/openclaw-nylas-plugin
# Configure your Nylas API key
openclaw config set 'plugins.entries.nylas.config.apiKey' 'YOUR_NYLAS_API_KEY'
# Restart the gateway so plugin config is reloaded
openclaw gateway restart
# Verify the plugin can see your connected accounts
openclaw run "List my connected email accounts" --plugin nylasFor multi-account setup, the full tool reference table, and provider-specific troubleshooting, see the Install the OpenClaw Nylas Plugin guide.
Troubleshooting: "command not found" After npm install -g
A "command not found" error after npm install -g openclaw means the npm global bin directory is not on the shell's PATH. This is the single most common post-install problem and affects roughly 1 in 5 users on Linux and macOS where Node.js was installed via nvm or a manual tarball. The fix is to find the npm prefix directory and append its bin/ subdirectory to your shell profile.
Run npm config get prefix to print the directory. On a default nvm install, the prefix is typically ~/.nvm/versions/node/v22.x.x. The openclaw binary lives at <prefix>/bin/openclaw.
# Find where npm installs global binaries
npm config get prefix
# The binary will be at <prefix>/bin/openclaw
# Add the bin directory to your PATH
# For bash (~/.bashrc):
echo 'export PATH="$(npm config get prefix)/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
# For zsh (~/.zshrc):
echo 'export PATH="$(npm config get prefix)/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc
# Verify it works
openclaw --versionIf you use nvm, the global prefix changes when you switch Node versions. Make sure you install OpenClaw under the Node version you use day-to-day. Running nvm use 22 && npm install -g openclaw ensures the binary is available whenever Node 22 is active.
Troubleshooting: Plugin Install Fails
Plugin install failures from openclaw plugins install fall into 3 categories: npm version mismatch, network/proxy errors, and file permission errors. The most common cause is running npm 9 or older, which lacks the dependency resolution features that OpenClaw plugins depend on. npm 10+ ships with Node.js 22 by default. The steps below address each failure mode in order of likelihood.
Start by verifying your Node.js and npm versions. If both are current, clear the npm cache and retry. Corporate proxy and file ownership issues are less common but account for roughly 15% of install failures reported on the OpenClaw GitHub issues tracker.
# 1. Check your Node.js and npm versions
node --version # Must be 22.12.0+
npm --version # Must be 10+
# 2. Clear the npm cache
npm cache clean --force
# 3. Try installing again
openclaw plugins install @nylas/openclaw-nylas-plugin
# 4. If behind a corporate proxy, configure npm
npm config set proxy http://proxy.company.com:8080
npm config set https-proxy http://proxy.company.com:8080
# 5. If permissions fail on macOS/Linux, fix npm prefix ownership
sudo chown -R $(whoami) $(npm config get prefix)/{lib/node_modules,bin,share}Troubleshooting: Plugin Installed but Not Loading
When openclaw plugins list shows a plugin as "active" but its tools or commands are unavailable during agent sessions, the plugin likely failed to initialize at startup. This can happen when the plugin's required config values are missing or when a dependency conflict prevents the plugin's entry point from loading. The --debug flag writes detailed initialization logs to stderr, including the exact error message from the failed plugin.
Reinstalling the plugin forces a fresh download and re-registers the plugin's tools with OpenClaw. The uninstall + install cycle takes under 10 seconds on most connections.
# Check debug logs for plugin errors
openclaw --debug 2>&1 | grep -i plugin
# Reinstall the problematic plugin
openclaw plugins uninstall <package-name>
openclaw plugins install <package-name>
# Verify it loads correctly
openclaw plugins listNext Steps
With OpenClaw installed and the Nylas plugin registered, the CLI is ready for email, calendar, and contacts automation. The guides listed here cover plugin configuration in depth, agent construction patterns, and error resolution for the most common OpenClaw issues.
- Install the OpenClaw Nylas Plugin — add email, calendar, and contacts tools with typed schemas and auto-discovery
- Build a Personal Assistant with Nylas CLI and OpenClaw — the exec-based approach using shell commands directly
- Secure OpenClaw Email Access — lock down plugin allowlists, credentials, policies, and send approvals
- AI Agent CLI for Email and Calendar — build subprocess-based email and calendar tools for custom agents
- Fix OpenClaw CLI Errors — troubleshoot PATH, npm permissions, Node.js version, and Windows setup issues
- Nylas CLI Command Reference — full reference for all commands, flags, and options