@claudiv/vite-sdk
v0.4.2
Published
Vite framework SDK for Claudiv — declarative AI interaction platform
Readme
@claudiv/vite-sdk
Vite framework SDK for the Claudiv declarative AI interaction platform
Overview
@claudiv/vite-sdk integrates Claudiv into Vite projects as an add-on package. It provides claudiv:* npm scripts for initializing, watching, and generating from .cdml files.
Installation
npm install --save-dev @claudiv/vite-sdkOn install, claudiv:init script is added to your package.json.
npm Scripts
After npm run claudiv:init, these scripts are available:
npm run claudiv:init # Scan project, generate .cdml + context
npm run claudiv:dev # Watch .cdml files, diff and process
npm run claudiv:gen # One-shot generation
npm run claudiv:mode # Switch between cli/api modeHow It Works
Init
- Detects Vite project (vite.config.* or vite in package.json)
- Scans source directories (src/, lib/, app/, etc.)
- Generates component
.cdmlskeleton - Generates
.claudiv/context.cdmlwith scope-to-file mappings - Generates
claudiv.project.cdmlmanifest - Adds remaining
claudiv:*scripts to package.json
Dev Mode
Watches *.cdml files with chokidar. On change:
- Diffs against cached state
- Processes changes through context engine
- Executes headless Claude for each changed scope
Gen Mode
One-shot processing. Supports --scope filter and --dry-run.
SDK Interface
Implements ClaudivSDK from @claudiv/core:
interface ClaudivSDK {
name: string;
frameworkDetector: FrameworkDetector;
init(projectRoot: string): Promise<InitResult>;
dev(projectRoot: string, opts: DevOptions): Promise<void>;
gen(projectRoot: string, opts: GenOptions): Promise<void>;
getScripts(): Record<string, string>;
}Bin Scripts
| Script | Purpose |
|--------|---------|
| claudiv-vite-init | Project initialization |
| claudiv-vite-dev | Dev mode watcher |
| claudiv-vite-gen | One-shot generation |
| claudiv-vite-mode | Mode selection prompt |
License
MIT
