← 开源

OpenCode (Rune) desktop client and embeddable Rune session crates

Rust
增长势头
+4024 小时新增 Star+1.7%
2.33k
Star
132
Fork
+1,007
本周
8
贡献者
创建于 2026-11-04 · 更新于 2026-12-06 · 今日第 417 名
主要开发者
README

OpenCode (Rune)

OpenCode Desktop, rewritten from scratch in Rust on Rune.
10–100× faster and lighter. Native on macOS, Windows, and Linux — and the same app in the browser over WebGPU.

Try the dev build

No Electron, no DOM, no Chromium at startup. Download the latest dev build:

Platform Download (dev)
macOS Apple Silicon (.dmg) · Intel (.dmg)
Windows x64 setup · arm64 setup
Linux x64 AppImage · DEB · RPM
Linux arm64 AppImage · DEB · RPM

Set chmod +x on Linux AppImage files. macOS and Windows dev builds auto-update in the background. Want to test a pull request alongside dev? See docs/trying-opencode-rune.md. Release channels and signing: docs/releasing.md.

What's inside

  • Windfoil GPU text. Draws each glyph's exact coverage directly from its vector outline on the GPU, so text stays sharp while zooming or moving.
  • Zero Chromium at startup. The built-in browser pane (⌃⌘B / Ctrl+Alt+B) fetches an isolated CEF sidecar (apps/browser-engine) lazily on demand. If you never open it, you never pay for it.
  • Real native engines. Ghostty-VT (libghostty-vt) terminal tabs, virtualized syntax-highlighted code and split diffs (opencode-code-view), native GPU ```ui generative UI and vector diagrams (rune-parts), lazy-downloaded Word/Excel/PowerPoint previews (apps/office-engine + office-protocol), local Hex voice dictation (hex-client), crash-safe SQLite with an mmap draft journal (opencode-storage), and 63 locales with RTL.
  • 0 ms UI iteration. Built-in Psychoscript JS plugins (plugins/*) reload live in place with --plugin-hot without touching rustc.
  • Headless eyes, zero tests. By policy, this repo has no automated tests or mocks ("Application code is truth", see AGENTS.md). The binary renders any scene or 111-story playground view offscreen to PNG (--snap), dumps its live element tree (--tree), and replays scripted input (--script).
  • Weird things built right in. Pull on the final e of the wordmark on a new-session tab — something lives inside it, and pulling it out pops the letters into an 800-pin 3D GPU board and Brick Breaker with synthesized sound (features/egg). Press ⌘⇧⌥R (Dev › Rewind) to freeze the last minute of layout frames and scrub a glitch frame by frame.

Run from source

cargo run -p opencode-desktop -- --live

For fast local iteration (skips debuginfo, Office fonts, and standalone story modules, and enables Psychoscript JS --plugin-hot live reload):

scripts/dev-fast.sh          # macOS / Linux
pwsh scripts/dev-fast.ps1    # Windows

To scaffold a new Psychoscript JS plugin (plugins/<id>/) or decoupled Rust feature crate (features/<id>/), run scripts/new-feature.sh (or pwsh scripts/new-feature.ps1). See docs/fast-builds.md for profiles, sccache, and fast linkers, and crates/opencode-plugin-spec/docs/writing-a-plugin.md for the plugin guide.

Other targets

Target Command
Standalone session-view playground (no server) cargo run -p session-view --example read_only
Local macOS .app (~/Applications/OpenCode (Rune).app) apps/desktop/scripts/dev.sh (or --release)
Browser wasm32/WebGPU (apps/web) pwsh scripts/web.ps1

Release builds: --profile release is what ships — fat LTO, one codegen unit, plus the PGO profiles in apps/desktop/pgo/ via pwsh apps/desktop/scripts/release.ps1 (Windows x64) and apps/desktop/scripts/build-app.sh (Apple Silicon macOS). A plain cargo build --release omits the PGO profile and takes 25–60 minutes and ~10 GB RAM for one rustc. Use --profile release-quick or --profile release-thin for fast optimized iteration (docs/fast-builds.md).

Architecture

Organized by progressive disclosure across four tiers: start at Tier 1 and step down only when a feature needs lower-level metal. Full crate inventory, dependency graph, and wiring guide live in ARCHITECTURE.md.

Tier Path Purpose
Tier 1 plugins/* Built-in Psychoscript JS plugins (panels, dialogs, commands, server sources); hot-reloads without touching Rust
Tier 2 features/* Decoupled Rust feature crates (opencode-feature-*) with zero cross-feature deps and non-generic &mut dyn *Host boundaries
Tier 3 crates/* Shell kernel (opencode-kernel), UI foundation (opencode-ui), headless runtime (opencode-runtime), platform/storage/search/i18n/plugin-runtime libraries, and embeddable crates (session-view, opencode-code-view, opencode-kit, rune-parts, terminal, browser-pane, office-preview, project-icon, hex-client, otlp-lite)
Tier 4 apps/* Host shells and packaging: apps/desktop (opencode-desktop lib + native bin), apps/web (opencode-web wasm32/WebGPU), apps/installer (opencode-rune-setup), and apps/browser-engine (on-demand CEF sidecar, excluded from workspace)
Embedding session-view in another Rune app

Add git dependencies from this repository pinned to a commit rev matching your anomalyco/rune pin:

opencode-kit = { git = "https://github.com/anomalyco/opencode-rune", rev = "<rev>" }
session-view = { git = "https://github.com/anomalyco/opencode-rune", rev = "<rev>" }

Hold a session_view::ViewState on your app state (calling view.setup(waker, headless) during setup), implement session_view::TimelineHost (using session_view::delegate_view_state! for the state accessors), drive session_view::poll(s, now, tx) each frame, and render session_view::read_only(s, p, id, transcript) or session_view::timeline_area(s, p, id, transcript, pills, header) alongside session_view::overlays(s, p, cx). See crates/session-view/examples/read_only.rs for a complete minimal host.

Checks

This repo has no automated tests (see AGENTS.md). Verify changes by running the app and the cheap pre-push guardrails (architecture layers, file size, folder shape, dialog sizes, and generated tables; rules in ARCHITECTURE.md):

scripts/guardrails.sh          # macOS / Linux / Git Bash
pwsh scripts/guardrails.ps1    # Windows PowerShell

Run scripts/clippy.sh separately for workspace-wide -D warnings checks across feature sets.

排名相邻

AI Rank iPhone 版

随时追踪 AI 模型榜单

在 App Store 下载