Skip to content

Latest commit

 

History

History
94 lines (73 loc) · 2.27 KB

File metadata and controls

94 lines (73 loc) · 2.27 KB

Set Up OpenCode with Argo

OpenCode is an open-source, model-agnostic AI coding assistant that runs as a CLI or from a terminal inside your IDE. This guide configures it to use Argonne's Argo Gateway API.

Note: OpenCode works best on Linux, macOS, and Windows + WSL. If you are on native Windows, consider using Claude Code instead.

Prerequisites

  • Connected to the Argonne network (on-site or VPN from an Argonne-managed computer)
  • Your ANL domain username

1. Install

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

Or via npm:

npm i -g opencode-ai

2. Configure

Create the configuration file:

mkdir -p ~/.config/opencode/

Edit ~/.config/opencode/opencode.json with the following content. Replace ENTER-YOUR-ARGONNE-DOMAIN-USERNAME with your actual ANL domain username:

{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "argo": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "Argo Gateway API",
      "options": {
        "baseURL": "https://apps.inside.anl.gov/argoapi/v1",
        "headers": {
          "Authorization": "Bearer ENTER-YOUR-ARGONNE-DOMAIN-USERNAME"
        }
      },
      "models": {
        "gpt54": {
          "name": "GPT-5.4",
          "modalities": {
            "input": ["text", "image"],
            "output": ["text"]
          }
        },
        "claudesonnet46": {
          "name": "Claude Sonnet 4.6",
          "modalities": {
            "input": ["text", "image"],
            "output": ["text"]
          }
        },
        "claudehaiku45": {
          "name": "Claude Haiku 4.5",
          "modalities": {
            "input": ["text", "image"],
            "output": ["text"]
          }
        }
      }
    }
  }
}

Important: OpenCode does not automatically pull available models from a custom provider. You must manually add models to your config file. See argo-usage.md for the full list of available model IDs.

3. Launch

Navigate to your project directory and run:

cd /path/to/project
opencode

You can also run opencode from the terminal inside VS Code or JetBrains.

4. Update

opencode upgrade

Learn more about OpenCode usage at https://opencode.ai/.