Skip to content

Latest commit

 

History

History
324 lines (249 loc) · 8.99 KB

File metadata and controls

324 lines (249 loc) · 8.99 KB

Upgraded OpenCode Stack

Complete custom enhancement stack for OpenCode CLI. Clone this repo, run install, and your OpenCode CLI is fully upgraded.

Quick Start

git clone https://github.com/OpenSIN-Code/Infra-SIN-OpenCode-Stack.git
cd Infra-SIN-OpenCode-Stack
./install.sh

Prerequisites

1.1 macOS (Apple Silicon or Intel)

# Check macOS version
sw_vers -productVersion
# ✅ Must be 13.0 or higher
# ❌ Upgrade macOS if needed

1.2 Node.js 20+

node --version
# ✅ Must show "v20.x.x" or higher
# ❌ "command not found" → brew install node

1.3 OpenCode CLI

which opencode
# ✅ Must show path (e.g., "/usr/local/bin/opencode")
# ❌ "not found" → npm install -g @opencode/cli

1.4 Git with GitHub Access

git --version
# ✅ Must show "git version 2.x.x"
gh auth status
# ✅ Must show "Logged in to github.com"
# ❌ "not logged in" → gh auth login

1.5 npm/pnpm

npm --version
# ✅ Must show "10.x.x" or higher
pnpm --version
# ✅ Optional but recommended

Installation

Step 1: Clone Repository

cd ~/dev
git clone https://github.com/OpenSIN-Code/Infra-SIN-OpenCode-Stack.git
cd Infra-SIN-OpenCode-Stack
# ✅ Repository cloned successfully
# ❌ "fatal: could not create work tree" → mkdir -p ~/dev first

Step 2: Run Installer

./install.sh
# ✅ Installer runs without errors
# ❌ "Permission denied" → chmod +x install.sh

The installer will:

  1. Install 29 skills to ~/.config/opencode/skills/
  2. Install 4 plugins to ~/.config/opencode/plugins/
  3. Install 21 agents to ~/.config/opencode/agents/
  4. Install 13 commands to ~/.config/opencode/commands/
  5. Install 12 scripts to ~/.config/opencode/scripts/
  6. Set up git hooks
  7. Configure templates and instructions
  8. Install SIN-Pool-Router (Fireworks AI proxy with auto-failover)

Step 3: Verify Installation

# Check skills
ls ~/.config/opencode/skills/ | wc -l
# ✅ Should show 29+ entries

# Check plugins
ls ~/.config/opencode/plugins/ | wc -l
# ✅ Should show 4+ entries

# Check agents
ls ~/.config/opencode/agents/ | wc -l
# ✅ Should show 21+ entries

# Check commands
ls ~/.config/opencode/commands/ | wc -l
# ✅ Should show 13+ entries

What This Installs

Category Count Description
Skills 30 Custom workflows for A2A creation, deployment, debugging, browser automation, image generation, and thumbnail A/B testing
Plugins 4 Auth plugins for Antigravity, Qwen, OpenRouter
Agents 22 Custom agents including SIN-Zeus, OMOC swarm, SIN-Image-Generator, and multimodal tools
Commands 13 Custom CLI commands for swarm orchestration, terminal management, Zeus control
Scripts 12 Utility scripts for sync, rotation, PR watching, GitHub management
CLI Tools 12 sin-* CLI tools for docs, n8n, telegram, health, metrics
Templates 5 JSON schemas for work items, PR watchers, governance
Hooks 1 Pre-commit hook for auto-sync
Instructions 4 Orchestrator, planner, worker guidelines
Rules 1 Model preservation rules
Pool Router 1 SIN-Pool-Router (Fireworks AI proxy with auto-failover)
Vercel Pool 1 SINator-Vercel (Vercel AI Gateway proxy with Key-Pool, 28+ active Vercel keys)

🖼️ Image Generation (SIN-Image-Generator)

Der Stack enthält einen dedizierten Bild-Generator-Agent auf Basis von Gemini 3.1 Flash Image (Nano Banana 2) über den Vercel AI Gateway Pool.

Setup (zusätzlich zur Hauptinstallation)

# 1. SINator-Vercel Pool clonen + starten (Port 8001)
git clone https://github.com/SIN-Rotator/SINator-Vercel.git ~/dev/SINator-Vercel
cd ~/dev/SINator-Vercel
python3 -m venv .venv
.venv/bin/pip install fastapi httpx uvicorn
nohup ./.venv/bin/python3 -m uvicorn main:app --host 0.0.0.0 --port 8001 \
  > /tmp/sinator-vercel-pool.log 2>&1 < /dev/null &

# 2. Vercel API Keys hinzufügen
.venv/bin/python3 add_keys.py --add vck_DEIN_KEY_1
.venv/bin/python3 add_keys.py --add vck_DEIN_KEY_2
# ODER bulk:
.venv/bin/python3 add_keys.py --file keys.txt

# 3. Status prüfen
curl -s http://localhost:17341/pool/status | python3 -m json.tool

Verwendung

# Agent
opencode run "Generate a minimalist logo for SIN-Lab, blue gradient, vector style" \
  --agent SIN-Image-Generator

# Direktes Model
opencode run "Erstelle ein Architektur-Diagramm für unseren Pool-Proxy" \
  --model vercel-pool/nano-banana-2

Capabilities

  • Text→Image, Image→Image, Multi-Turn-Edit
  • 512, 1K, 2K, 4K Auflösungen
  • 15 Aspect Ratios (1:1 bis 21:9)
  • Bis zu 14 Reference-Images pro Prompt
  • SynthID Watermark automatisch

Pricing

Resolution Cost/Image
512 (0.5K) $0.045
1K (default) $0.067
2K $0.101
4K $0.151

Directory Structure

Infra-SIN-OpenCode-Stack/
├── install.sh              # Main installer
├── opencode.json           # OpenCode configuration (sanitized)
├── AGENTS.md               # Global agent rules
├── skills/                 # 29 custom skills
├── plugins/                # Custom auth plugins
│   └── local-plugins/      # Local plugin source
├── commands/               # 13 custom commands
├── scripts/                # 12 utility scripts
├── hooks/                  # Git hooks
├── templates/              # JSON schemas
├── instructions/           # Agent instructions
├── rules/                  # Model rules
├── tools/                  # Utility tools
├── platforms/              # Platform evidence
├── bin/                    # CLI tool stubs
└── docs/                   # Documentation

Post-Install Steps

1. Set Environment Variables

# Copy example env file
cp .env.example .env
# Edit .env with your credentials
nano .env

2. Configure Fireworks AI Provider

The installer automatically sets up the SIN-Pool-Router. Verify:

# Check pool router (public endpoint)
curl -s https://sinatorpool-router.delqhi.com/inference/v1/models | head -20
# ✅ Should show Fireworks models list

# Check local router
pgrep -f pool-router.py
# ✅ Should show PID

3. Quick OpenCode Config (One-Liner)

If you only need the OpenCode Fireworks config without the full stack:

curl -fsSL https://raw.githubusercontent.com/SIN-Hermes-Bundles/SIN-Hermes-Provider-Bundle/main/opencode-config-install.sh | bash

Mit API Key:

curl -fsSL https://raw.githubusercontent.com/SIN-Hermes-Bundles/SIN-Hermes-Provider-Bundle/main/opencode-config-install.sh | bash -s -- --api-key fw_xxx

Installiert:

  • provider.fireworks-ai in ~/.config/opencode/opencode.json
  • 5 Reasoning-Modelle (deepseek-v4-pro, glm-5p1, kimi-k2p6, qwen3p6-plus, minimax-m2p7)
  • Varianten: off / low / medium / high / max
  • Base URL: https://sinatorpool-router.delqhi.com/inference/v1

4. Configure Auth Plugins

# Configure Antigravity plugin
opencode plugin config antigravity

# Configure Qwen plugin
opencode plugin config qwen

# Configure OpenRouter plugin
opencode plugin config openrouter

5. Run sin-sync

# Sync to other machines
sin-sync
# ✅ All files synced successfully

6. Verify Installation

# Check OpenCode version
opencode --version
# ✅ Must show version number

# Test a skill
opencode skill run test-skill
# ✅ Skill runs successfully

Troubleshooting

Skills not showing up

# Reinstall skills
./install.sh --force
# Or manually:
rsync -av skills/ ~/.config/opencode/skills/

Plugins not loading

# Check plugin dependencies
npm install -g @opencode/plugin-antigravity
npm install -g @opencode/plugin-qwen
npm install -g @opencode/plugin-openrouter

Commands not found

# Add to PATH
export PATH="$HOME/.config/opencode/commands:$PATH"
# Or add to ~/.zshrc or ~/.bashrc

Git hooks not working

# Check git hooks
ls -la .git/hooks/
# Should show pre-commit symlink
# If not:
ln -s hooks/pre-commit .git/hooks/pre-commit

Configuration

See CONFIGURATION.md for detailed configuration options.


Last updated: 2026-05-30 Version: 2025.1