
- Installs
- 628
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/different-ai/openwork --skill opencode-bridge- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads opencode-bridge automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
Overview
OpenWork communicates with OpenCode via three mechanisms:
- CLI invocation: Spawn
opencodewith prompts and get JSON responses. - Database access: Read OpenCode's SQLite database for sessions and messages.
- MCP bridge: Real-time bidirectional communication for streaming and permissions.
CLI Invocation
Non-interactive mode
opencode -p "your prompt" -f json -q
Returns JSON with the response content.
Flags
| Flag | Description |
|---|---|
-p | Prompt to execute |
-f | Output format (text, json) |
-q | Quiet mode (no spinner) |
-c | Working directory |
-d | Debug mode |
Example response
{
"content": "Here is the result...",
"session_id": "abc123"
}
Database Access
Location
~/.opencode/opencode.db
Or project-local:
.opencode/opencode.db
Schema (key tables)
sessions
CREATE TABLE sessions (
id TEXT PRIMARY KEY,
parent_session_id TEXT,
title TEXT,
message_count INTEGER,
prompt_tokens INTEGER,
completion_tokens INTEGER,
summary_message_id TEXT,
cost REAL,
created_at INTEGER,
updated_at INTEGER
);
messages
CREATE TABLE messages (
id TEXT PRIMARY KEY,
session_id TEXT,
role TEXT, -- 'user', 'assistant', 'tool'
parts TEXT, -- JSON array of content parts
model TEXT,
created_at INTEGER,
updated_at INTEGER
);
Querying from Rust (Tauri)
use tauri_plugin_sql::{Migration, MigrationKind};
#[tauri::command]
async fn list_sessions(db: tauri::State<'_, Database>) -> Result<Vec<Session>, String> {
let sessions = sqlx::query_as::<_, Session>(
"SELECT * FROM sessions ORDER BY updated_at DESC"
)
.fetch_all(&db.pool)
.await
.map_err(|e| e.to_string())?;
Ok(sessions)
}
Querying from SolidJS
import Database from "@tauri-apps/plugin-sql";
const db = await Database.load("sqlite:~/.opencode/opencode.db");
const sessions = await db.select<Session[]>(
"SELECT * FROM sessions ORDER BY updated_at DESC"
);
MCP Bridge (Advanced)
OpenWork can register as an MCP server that OpenCode connects to.
Configuration (opencode.json)
{
"mcpServers": {
"openwork": {
"type": "stdio",
"command": "openwork-mcp-bridge"
}
}
}
Use cases
- Real-time permission prompts surfaced in OpenWork UI.
- Streaming progress updates.
- Custom tools exposed from OpenWork (e.g., native file picker).
Message Content Parts
Messages contain a parts JSON array with different content types:
TextContent
{ "type": "text", "text": "Hello world" }
ToolCall
{
"type": "tool_call",
"id": "call_123",
"name": "bash",
"input": "{\"command\": \"ls\"}"
}
ToolResult
{
"type": "tool_result",
"tool_call_id": "call_123",
"content": "file1.txt\nfile2.txt",
"is_error": false
}
Finish
{
"type": "finish",
"reason": "end_turn",
"time": 1704067200
}
Common Gotchas
- Database is SQLite; use read-only access to avoid conflicts with running OpenCode.
- Message parts are JSON-encoded strings; parse them in the UI.
- Session IDs are UUIDs; tool call IDs are also UUIDs.
- Cost is in USD; tokens are raw counts.
First-Time Setup
Verify OpenCode is installed
which opencode
opencode --version
Verify database exists
ls ~/.opencode/opencode.db
Test CLI invocation
opencode -p "Hello" -f json -q
FAQ
What does the opencode-bridge skill do?
Bridge between OpenWork UI and OpenCode runtime
How do I install opencode-bridge?
Run npx skills add https://github.com/different-ai/openwork --skill opencode-bridge in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/opencode-bridge/ (personal) or .claude/skills/opencode-bridge/ (project).
Which AI agents can use opencode-bridge?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is opencode-bridge safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains opencode-bridge?
It is published by different-ai in different-ai/openwork. It has 628 recorded installs.
More from different-ai/openwork
opencode-primitives
different-ai/openwork
Reference OpenCode docs when implementing skills, plugins, MCPs, or config-driven behavior.
solidjs-patterns
different-ai/openwork
SolidJS reactivity + UI state patterns for OpenWork
opencode-mirror
different-ai/openwork
Maintain the local OpenCode mirror for self-reference
Popular frontend & design skills
setup-matt-pocock-skills
mattpocock/skills
Configure this repo for the engineering skills: set up its issue tracker, triage label vocabulary, and domain doc layout. Run once before first use of the other engineering skills.
frontend-design
anthropics/skills
Guidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults.
hyperframes-animation
heygen-com/hyperframes
All animation knowledge for HyperFrames — atomic motion rules, multi-phase scene blueprints, scene transitions, broader motion-design techniques, AND the seven runtime adapters (GSAP default, plus Lottie, Three.js, Anime.js, CSS keyframes, Web Animations API, TypeGPU). Use for any motion or animation task: pick 2-4 rules and compose, or load a blueprint, or look up runtime-specific API (e.g. GSAP eases / Lottie player / Three.js mixer). Also covers auditing an existing composition's choreography (animation map) and 24 named text-animation effects. HyperFrames-native: single paused timeline, seek-safe, deterministic.
prototype
mattpocock/skills
Build a throwaway prototype to answer a design question. Use when the user wants to sanity-check whether a state model or logic feels right, or explore what a UI should look like.
hyperframes-core
heygen-com/hyperframes
The HyperFrames composition contract — build one renderable project. Use for composition structure, the data- timing attributes, class="clip", tracks, sub-compositions, variables, framework-owned media playback, deterministic-render rules, and validation. Read before writing composition HTML.
vercel-react-best-practices
vercel-labs/agent-skills
React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.