parser

package
v0.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 13, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SubstituteVars

func SubstituteVars(s string, vars map[string]string) string

SubstituteVars replaces $(VAR) references in a string with variable values.

Types

type Directive

type Directive struct {
	Name string // "require", "mcp", "skill", "network", "no-sandbox"
	Args string
}

Directive represents a modifier on a target (e.g. @require, @mcp, @skill, @network, @no-sandbox).

type Target

type Target struct {
	Name         string
	Dependencies []string
	Recipe       string
	Model        string // per-target model override
	Directives   []Directive
}

Target represents a single target definition in a Vibefile.

func (*Target) DirectiveArgs

func (t *Target) DirectiveArgs(name string) string

DirectiveArgs returns the args for the first directive with the given name, or empty string.

func (*Target) ExecutionMode

func (t *Target) ExecutionMode() string

ExecutionMode returns the execution mode for this target based on its directives.

func (*Target) HasDirective

func (t *Target) HasDirective(name string) bool

HasDirective checks whether the target has a directive with the given name.

type Vibefile

type Vibefile struct {
	Variables map[string]string
	Targets   map[string]*Target
	Order     []string // target names in declaration order
}

Vibefile represents a parsed Vibefile.

func Parse

func Parse(input string) (*Vibefile, error)

Parse reads a Vibefile string and returns a structured representation.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL