//install · opencode

Set up Moonshift on OpenCode

Moonshift was built OpenCode-native. The plugin lives in .opencode/plugins and registers a /moonshift slash command that drives the 14-agent pipeline.

Option A · Use the Moonshift repo

The fastest path: clone Moonshift and start OpenCode inside it. The plugin is already wired up.

  1. step
    Clone and install
    bashgit clone https://github.com/HarjjotSinghh/moonshift-opencode.git
    cd moonshift-opencode
    bun install
  2. step
    Configure environment

    Export at minimum these three variables before launching OpenCode. A LibSQL file works for local; Turso works for shared.

    bashexport OPENAI_API_KEY="sk-..."
    export LIBSQL_URL="file:./moonshift.db"
    export BETTER_AUTH_SECRET="$(openssl rand -base64 32)"
  3. step
    Start OpenCode
    bashopencode

    Moonshift registers /moonshift on boot. Type it at the OpenCode prompt and you're in.

Option B · Drop the plugin into an existing project

Moonshift's plugin is self-contained. You can install it in any OpenCode project by copying two files into your workspace.

  1. step
    Create the plugin directories
    bashmkdir -p .opencode/plugins .opencode/command
  2. step
    Copy the plugin and command
    bashMOONSHIFT_DIR=/absolute/path/to/moonshift-opencode
    cp "$MOONSHIFT_DIR/.opencode/plugins/moonshift.ts" .opencode/plugins/
    cp "$MOONSHIFT_DIR/.opencode/command/moonshift.md" .opencode/command/
  3. step
    Point the plugin at the orchestrator

    Open .opencode/plugins/moonshift.ts and set the orchestrator path. This is the only edit - everything else picks up from env.

    ts// .opencode/plugins/moonshift.ts
    export const moonshift = {
      name: "moonshift",
      orchestrator: "/absolute/path/to/moonshift-opencode/orchestrator/src/index.ts",
    };
  4. step
    Restart OpenCode

    OpenCode scans plugins on start. Quit and relaunch; you should see the moonshift plugin logged on boot.

Run your first swarm

In the OpenCode TUI, invoke the slash command with a single-sentence product idea. Moonshift creates an isolated workspace under runs/<id> and streams phase events to both the TUI and the web dashboard.

/moonshift "Build a SaaS that turns GitHub READMEs into stand-up comedy sets"

Start bun run web in another terminal and open http://localhost:4040/runs/<id> to watch the same run with agent rows, live logs, images, and the HITL approval gate.

Deploying + publishing keys

Add these when you want the run to push a real deploy, real GitHub repo, and draft launch posts. Without them, Moonshift still plans + generates code, just stops at local artifacts.

bashexport VERCEL_TOKEN="..."
export GITHUB_TOKEN="..."

# Publishing (optional - nothing posts without HITL approval).
export X_API_KEY="..."
export X_API_KEY_SECRET="..."
export X_ACCESS_TOKEN="..."
export X_ACCESS_SECRET="..."
export LINKEDIN_ACCESS_TOKEN="..."
export LINKEDIN_USER_URN="urn:li:person:..."

Verifying the install

bash# Confirm the plugin loaded.
opencode plugins list | grep moonshift

# Dry-run without burning LLM credits.
bun run orchestrator/src/index.ts --dry-run "hello world"

Common issues