Code Plan

OpenCode Integration

Complete OpenCode setup with sharing, IDE extensions, GitHub workflow, and OneInfer-compatible configuration.

This guide follows the full OpenCode flow from the reference and adapts provider configuration for OneInfer.

Step 1: Install OpenCode

The easiest installation method is the install script:

bash
curl -fsSL https://opencode.ai/install | bash

You can also install via npm:

bash
npm install -g opencode-ai
cd your-project-directory
opencode

Step 2: Getting Started

  1. Get your API key from OneInfer dashboard.
  2. Run opencode auth login and choose OpenAI-compatible/custom provider.
  3. Enter your OneInfer API key.
  4. Run opencode to launch OpenCode.
  5. Use /models to choose your target model.
bash
$ opencode auth login

┌  Add credential
│
◆  Select provider
│  ● OpenAI-compatible
│  ...
└
json
{
  "env": {
    "OPENAI_BASE_URL": "https://api.oneinfer.ai/v1",
    "OPENAI_API_KEY": "<ONEINFER_API_KEY>"
  }
}

Optional: configure Vision/Search/Web Reader MCP servers in your environment if you want tool-augmented responses.

Share

OpenCode can create shareable conversation links for collaboration.

How it works

  1. Create a unique public URL for your session.
  2. Sync conversation history to share infrastructure.
  3. Expose link as opencode.ai/s/<share-id>.

Share / Un-share

bash
/share
/unshare

IDE Extensions

Works with VS Code, Cursor, Windsurf, and similar IDEs that support terminals.

  1. Open IDE terminal.
  2. Run opencode to trigger extension install.
  • Quick Launch: Cmd+Esc (Mac) or Ctrl+Esc (Windows/Linux)
  • New Session: Cmd+Shift+Esc or Ctrl+Shift+Esc
  • File references: @File#L37-42

GitHub Workflow

OpenCode can execute tasks from GitHub issue/PR comments using your GitHub Actions runner.

Install

bash
opencode github install

Examples

bash
/opencode explain this issue
/opencode fix this
Delete the attachment from S3 when the note is removed /oc

Troubleshooting

  • Restart your terminal after changing environment variables.
  • Confirm OPENAI_BASE_URL is https://api.oneinfer.ai/v1.
  • Verify your OneInfer API key and active credit balance before retrying.
  • If auth fails in login flow, remove stale credentials and run opencode auth login again.

Resources

  • OpenCode docs: opencode.ai/docs
  • OpenCode issues: github.com/sst/opencode/issues
  • OpenCode Discord: opencode.ai/discord
  • OneInfer docs: oneinfer.ai/docs