Building AI Systems
November 23, 2026•8 min read

How to Install OpenCode CLI: curl https://dev.meta.ai/cli/install-opencode.sh Setup Guide

Execute /bin/bash -c "$(curl -fsSL https://dev.meta.ai/cli/install-opencode.sh)" to install Meta's autonomous coding agent CLI. Fix curl SSL handshake failures, permission denied, and discover 1-click alternatives.

AIStoreHub
AIStoreHub
Open AI Registry & Developer Platform
Executive Blueprint & Summary (BLUF)

Meta's OpenCode is an open-source autonomous coding agent designed for multi-file codebase refactoring, automated bug hunting, and test generation directly in the terminal. The official installer script is hosted at dev.meta.ai and invoked via /bin/bash -c "$(curl -fsSL https://dev.meta.ai/cli/install-opencode.sh)". This guide details the installation procedure across macOS, Linux, and Windows WSL2, provides solutions for curl SSL handshake failures and PATH errors, and outlines 1-click cloud execution options.

1-Click Install via AIStoreHub CLI
$ aihub mcp install community/postgres-mcp --client cursor
Requires: pip install aistorehubCLI Docs

Autonomous software engineering has taken a monumental leap forward with Meta's open-source release of OpenCode—a terminal-native agent capable of multi-file refactoring, test suite generation, git branch orchestration, and self-debugging runtime exceptions.

Unlike GUI-based extensions, OpenCode is distributed as a lightweight standalone command-line binary. The primary installation mechanism provided by Meta is an automated shell bootstrap script.

In this guide, we cover the exact installation command, resolve common terminal and network bottlenecks, and explore how to orchestrate OpenCode agent directives seamlessly.


Registry Fast-Track: Avoid manual shell scripting. Explore the OpenCode Autonomous Coding Agent Package on AIStoreHub to review verified manifests, dependencies, and 1-click cloud workflows.


Official OpenCode CLI One-Line Install Command

To install OpenCode CLI on macOS or Linux, open your terminal and run the official command:

bash
/bin/bash -c "$(curl -fsSL https://dev.meta.ai/cli/install-opencode.sh)"

What the Curl Flags Mean:

  • -f (--fail): Prevents curl from outputting server error documents (like 404 or 500 HTML) when the endpoint fails.
  • -s (--silent): Suppresses the progress meter and status messages for clean pipe execution.
  • -S (--show-error): Ensures an error message is printed if the download fails despite silent mode.
  • -L (--location): Automatically follows HTTP 301/302 redirects from dev.meta.ai to the appropriate CDN release artifact.

Once the script completes, verify your installation:

bash
opencode --version

System Prerequisites & Shell Requirements

Before invoking the installer, ensure your workstation satisfies the following minimum runtime requirements:

  • Operating System: macOS (Apple Silicon or Intel, macOS 12+) or Linux (x86_64 or aarch64, glibc 2.28+).
  • Curl: Version 7.68 or higher with TLS 1.3 support.
  • Git: Installed and initialized with global identity (git config --global user.name).
  • Node.js (Optional): Node 18+ if pairing OpenCode with Model Context Protocol (MCP) servers.

Installing OpenCode on Windows (PowerShell vs WSL2)

Because the installer uses Bash syntax (/bin/bash), running it directly inside native Windows Command Prompt (cmd.exe) or standard PowerShell will produce:

text
'/bin/bash' is not recognized as an internal or external command, operable program or batch file.
  1. Open PowerShell as Administrator and ensure WSL is installed:
    powershell
    wsl --install
  2. Launch your Ubuntu or Debian WSL shell:
    powershell
    wsl
  3. Run the official command inside WSL:
    bash
    /bin/bash -c "$(curl -fsSL https://dev.meta.ai/cli/install-opencode.sh)"

Troubleshooting curl SSL Handshake & Certificate Errors

If your terminal reports curl: (35) schannel: failed to receive handshake or SSL certificate problem: certificate has expired, your system root certificates may be outdated or intercepted by a corporate firewall:

Fix 1: Update CA Certificates (Ubuntu/Debian)

bash
sudo apt-get update && sudo apt-get install -y ca-certificates curl

Fix 2: macOS Keychain Verification

On macOS, ensure your default curl binary is from system or Homebrew:

bash
which curl
# If using macOS default: /usr/bin/curl

Fixing 'Permission Denied' on /usr/local/bin

By default, the script places the compiled binary into /usr/local/bin/opencode. If your non-root user does not own this directory:

bash
# 1. Grant ownership of /usr/local/bin to your current user
sudo chown -R $(whoami) /usr/local/bin

# 2. Re-run the installer
/bin/bash -c "$(curl -fsSL https://dev.meta.ai/cli/install-opencode.sh)"

The 1-Click Browser & CLI Alternative: AIStoreHub

If you do not wish to execute raw shell scripts or want to manage OpenCode alongside other autonomous developer tools (like Godmode, Clip Watcher, and Freefield), use the AIStoreHub CLI:

bash
# 1. Install AIStoreHub CLI via pip or uv
pip install aistorehub

# 2. Pull verified OpenCode directives and integration manifests
aihub pull @community/opencode

# 3. Inspect package specifications
aihub info @community/opencode

Browse over 7,017+ verified autonomous agents and developer skills in the AIStoreHub Registry.

Interactive Registry Preview

Featured Systems in the AIStoreHub Registry

Verified packages installable directly via terminal into Cursor, Claude Desktop, and Python runtimes.

Browse all 143 systems
MCP Server
PostgreSQL & SQLite Inspector

Inspect schema, explain queries, and generate zero-downtime migrations in Cursor.

Autonomous Agent
Harvey 24/7 AI Sales Agent

Autonomous prospecting, cold emails, and meeting booking with zero API token bills.

Claude Skill
Day Trader Skills: 11 Claude Skills

Scan charts, calculate risk/reward brackets, and backtest setups via Claude Code.

Frequently Asked Questions

Essential clarifications for developers and engineering teams building and operating AI systems.

The official one-line install command for macOS and Linux is: /bin/bash -c "$(curl -fsSL https://dev.meta.ai/cli/install-opencode.sh)".
AIStoreHub
Written by AIStoreHub
Open AI Registry & Developer Platform

AIStoreHub is the open registry and 1-click CLI for discovering, running, and installing production-grade AI systems, Model Context Protocol (MCP) servers, and autonomous agents.

Topics:#OpenCode#Autonomous Agents#Coding Agents#Developer Tools#CLI#Troubleshooting
Sponsored AdvertisementAds by Google

Related Engineering Guides

Continue learning how to build, monetize, and operate AI systems effectively.

Building AI Systems9 min read

How to Add MCP in .cursor/mcp.json (Cursor MCP Settings Guide 2026)

Complete tutorial for configuring .cursor/mcp.json in Cursor IDE. Discover exact Windows and Mac config paths, valid JSON schemas, local knowledge base servers, and how to fix MCP connection error -32000.

#Cursor#Model Context Protocol#Cursor Settings
November 20, 2026
Read