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.
- stepClone and install
bash
git clone https://github.com/HarjjotSinghh/moonshift-opencode.git cd moonshift-opencode bun install - stepConfigure environment
Export at minimum these three variables before launching OpenCode. A LibSQL file works for local; Turso works for shared.
bash
export OPENAI_API_KEY="sk-..." export LIBSQL_URL="file:./moonshift.db" export BETTER_AUTH_SECRET="$(openssl rand -base64 32)" - stepStart OpenCode
bash
opencodeMoonshift registers
/moonshifton 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.
- stepCreate the plugin directories
bash
mkdir -p .opencode/plugins .opencode/command - stepCopy the plugin and command
bash
MOONSHIFT_DIR=/absolute/path/to/moonshift-opencode cp "$MOONSHIFT_DIR/.opencode/plugins/moonshift.ts" .opencode/plugins/ cp "$MOONSHIFT_DIR/.opencode/command/moonshift.md" .opencode/command/ - stepPoint the plugin at the orchestrator
Open
.opencode/plugins/moonshift.tsand 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", }; - stepRestart OpenCode
OpenCode scans plugins on start. Quit and relaunch; you should see the
moonshiftplugin 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"