Remote script. This pipes a script from Opencode.ai straight into bash, so read the script first and only run it on machines where you accept that code.
Who it is forA systems administrator or developer setting up OpenCode on a shared Linux or macOS machine where the install location must be controlled.
The problemThe default install path may not match where a team keeps shared tools, so the binary needs to go somewhere specific.
The outcomeThe Opencode binary installed in your chosen directory and ready to run from the command line.
What you need first
- A terminal on macOS, Linux, or Windows, or the desktop app installer for your platform
- One package manager available: npm, bun, pnpm, yarn, or brew
- A local project folder you want the agent to work in
- Configuration for OpenCode as described in the docs at opencode.ai/docs (the README only links to them)
Steps
- Review the install script at Opencode.ai/v2/install before running it.
- Run
OPENCODE_INSTALL_DIR=/usr/local/bin curl -fsSL https://opencode.ai/v2/install | bash(replace the path with your own directory). - Make sure the directory is on your PATH, then confirm the install location.
- Run
opencodefrom a new terminal to confirm it starts. (inferred, check the README)
Prompt for your agent
Install OpenCode from the anomalyco/opencode install script into <install-directory> by setting OPENCODE_INSTALL_DIR. Expected output: an opencode binary in that directory. Verify with the install directory check you choose, and confirm that no earlier install takes precedence on the PATH.
Caveat. The README lists the install directory priority order, but it does not say what the script changes beyond placing the binary, so check the script before running it.
Use this in your AI agent
Ask your agent
Using the Deduped MCP, get the setup steps for anomalyco/opencode and "Install OpenCode into a chosen directory on a shared machine"
Add Deduped to Claude Code once
claude mcp add --transport http deduped https://dedupedai.com/mcp
Every Monday: the 5 hottest repos and exactly how to use them. Free, one email a week, unsubscribe anytime.
Get them freeShare: X LinkedIn Hacker News Email Copy link
Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer