Skip to main content

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.
Parameters: Returns: Promise<DrevonConfig> Throws: If config is missing or invalid (Zod validation).

writeConfig

Write a config object to drevon.config.json.
Parameters:

createDefaultConfig

Generate a default config for a given mode and identity.
Parameters: Returns: DrevonConfig

compile

Compile config into agent-specific files. Only writes changed files.
Parameters: Returns: Promise<CompileResult>

scaffold

Run the full initialization sequence (what drevon init does).

detectMode

Auto-detect whether a directory should be hub or project mode.
Returns: { suggested: DrevonMode, reason: string }

Types

DrevonConfig

AgentId

DrevonMode

Usage in CI/CD

Example: validate config in a GitHub Action:
Example: auto-sync on config changes: