Overview
Drevon exports its core functions as a public API, allowing you to integrate it into custom tools, CI/CD pipelines, and scripts.Installation
Exports
Functions
loadConfig
Load and validate a Drevon config from a directory.| Param | Type | Description |
|---|---|---|
dir | string | Path to directory containing drevon.config.json |
Promise<DrevonConfig>
Throws: If config is missing or invalid (Zod validation).
writeConfig
Write a config object todrevon.config.json.
| Param | Type | Description |
|---|---|---|
dir | string | Target directory |
config | DrevonConfig | Config object to write |
createDefaultConfig
Generate a default config for a given mode and identity.| Param | Type | Description |
|---|---|---|
mode | DrevonMode | 'hub' or 'project' |
name | string | Workspace/project name |
identity | IdentityConfig | Identity configuration |
agents | Record<string, boolean> | Agents to enable |
DrevonConfig
compile
Compile config into agent-specific files. Only writes changed files.| Param | Type | Description |
|---|---|---|
dir | string | Workspace directory |
config | DrevonConfig | Loaded config |
Promise<CompileResult>
scaffold
Run the full initialization sequence (whatdrevon init does).
detectMode
Auto-detect whether a directory should be hub or project mode.{ suggested: DrevonMode, reason: string }