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.
To install OpenCode CLI on macOS or Linux, open your terminal and run the official command:
/bin/bash -c "$(curl -fsSL https://dev.meta.ai/cli/install-opencode.sh)"
-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:
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.
Because the installer uses Bash syntax (/bin/bash), running it directly inside native Windows Command Prompt (cmd.exe) or standard PowerShell will produce:
'/bin/bash' is not recognized as an internal or external command, operable program or batch file.
- Open PowerShell as Administrator and ensure WSL is installed:
- Launch your Ubuntu or Debian WSL shell:
- Run the official command inside WSL:
/bin/bash -c "$(curl -fsSL https://dev.meta.ai/cli/install-opencode.sh)"
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:
sudo apt-get update && sudo apt-get install -y ca-certificates curl
On macOS, ensure your default curl binary is from system or Homebrew:
which curl
# If using macOS default: /usr/bin/curl
By default, the script places the compiled binary into /usr/local/bin/opencode. If your non-root user does not own this directory:
# 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)"
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:
# 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.