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.
Get 5 new use cases every morning. Free, one short email, unsubscribe anytime.
Get them freeShare: X LinkedIn Hacker News Email Copy link
Disclaimer
Deduped lists open-source repositories that belong to other people. We do not own, maintain, audit, or vouch for any of them, and a repo appearing here is not an endorsement or a safety check. The use cases, steps, and prompts are written by AI and may be incomplete, outdated, or just wrong. Where a use case is marked "Seen in the wild", we link to public posts where someone described something similar, but we have not verified those posts and the use case itself is still our AI's own write-up. Use all of this at your own risk. Only run code, commands, or agents on systems and accounts you are authorized to use, and read the code and every command before you run it, especially anything that touches credentials, files, or the network. Nothing here is professional, security, legal, or financial advice. All trademarks and project names belong to their respective owners, and their use here does not imply affiliation. Content is provided as is, without warranties of any kind. Found a mistake, a safety problem, or something you want removed? Email [email protected] and we will look at it promptly. Full disclaimer page