Getting Started
Weave vNext runs exclusively on Bun. Make sure you have Bun installed before continuing.
Installation
Install the Weave packages for your chosen harness adapter:
bash
# Core + config + engine
bun add @weaveio/weave-core @weaveio/weave-config @weaveio/weave-engine
# Pick the adapter for your harness
bun add @weaveio/weave-adapter-opencode # OpenCode
bun add @weaveio/weave-adapter-claude-code # Claude CodeCreate your config directory
Weave looks for configuration in two places:
| Scope | Path |
|---|---|
| Global | ~/.weave/config.weave |
| Project | .weave/config.weave |
Create the project config directory:
bash
mkdir .weaveWrite your first .weave file
Create .weave/config.weave:
weave
# .weave/config.weave
agent my-reviewer {
description "Careful code reviewer"
prompt "You are a thorough code reviewer. Focus on correctness, security, and readability."
models ["claude-sonnet-4-5", "gpt-4o"]
mode subagent
temperature 0.2
tool_policy {
read allow
write deny
execute deny
delegate deny
}
}
category frontend {
description "Frontend UI and styling"
patterns ["src/components/**", "src/pages/**", "**/*.tsx", "**/*.css"]
prompt_append "Preserve accessibility, responsive behavior, and design-system consistency."
}
settings {
log_level INFO
}Load the config in your adapter
Each adapter exposes its own initialization API. Here is a minimal example using the OpenCode adapter:
ts
import { discoverConfig } from "@weaveio/weave-config";
import { WeaveRunner } from "@weaveio/weave-engine";
import { OpenCodeAdapter } from "@weaveio/weave-adapter-opencode";
const config = await discoverConfig();
if (config.isErr()) {
console.error("Failed to load config", config.error);
process.exit(1);
}
const adapter = new OpenCodeAdapter();
const runner = new WeaveRunner(config.value, adapter);
await runner.run();Directory layout
~/.weave/ # Global config root
├── config.weave # Global agent/category/workflow definitions
└── prompts/ # Global prompt files (.md)
.weave/ # Project config root
├── config.weave # Project-level overrides
├── prompts/ # Project prompt files
│ └── my-reviewer.md
├── plans/ # Plan files (created by Pattern agent)
└── workflows/ # Additional workflow files (optional)Next Steps
- DSL Syntax: full reference for the
.weavelanguage - Agents: built-in and custom agent configuration
- Categories: file-pattern-based domain routing
- Workflows: multi-step pipelines
- Adapters: harness-specific integration details
- Migrating from v0: upgrading from the OpenCode-exclusive alpha
