config

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// ConfigVersion defines the schema version of agent-sync.yml
	ConfigVersion string `yaml:"configVersion"`
	// Projects holds named project configurations
	Projects map[string]Project `yaml:"projects"`
	// New fields for top-level project config
	OutputDirs []string `yaml:"outputDirs,omitempty"`
	Tasks      []Task   `yaml:"tasks,omitempty"`
	// User holds global user-level configuration
	User UserConfig `yaml:"user"`
}

Config represents the root configuration for agent-sync

func LoadConfig

func LoadConfig(path string) (*Config, string, error)

LoadConfig reads and parses the agent-sync YAML configuration from the given path. If the provided path is a directory, it looks for "agent-sync.yml" or "agent-sync.yaml" in that directory.

func (*Config) SetDefaultNames

func (c *Config) SetDefaultNames()

SetDefaultNames sets default names for all tasks across all projects and user config

type Output

type Output struct {
	// Agent is the target AI agent (e.g., "roo", "claude")
	Agent string `yaml:"agent"`
	// OutputPath is an optional custom output path
	// The path format determines concatenation behavior:
	// - If path ends with "/", it will be treated as a directory (non-concatenated outputs)
	// - If path doesn't end with "/", it will be treated as a file (concatenated outputs)
	OutputPath string `yaml:"outputPath,omitempty"`
}

Output represents an output destination for a task

type Project

type Project struct {
	// OutputDirs are the output directories for generated files
	// Supports tilde (~) expansion for home directory.
	OutputDirs []string `yaml:"outputDirs"`
	// Tasks is the list of generation tasks for this project
	Tasks []Task `yaml:"tasks"`
}

Project represents a project-specific configuration block

func (*Project) SetDefaultNames

func (p *Project) SetDefaultNames(projectName string)

SetDefaultNames sets default names for all tasks in this project

type Task

type Task struct {
	// Name is an optional identifier for the task
	Name string `yaml:"name,omitempty"`
	// Type is either "command" or "memory"
	Type string `yaml:"type"`
	// Inputs are file or directory paths relative to config directory
	Inputs []string `yaml:"inputs"`
	// Outputs define the output agents and paths
	Outputs []Output `yaml:"outputs"`
}

Task represents a single generation task (command or memory)

func (*Task) SetDefaultName

func (t *Task) SetDefaultName(prefix string)

SetDefaultName sets a default name for a task if one is not provided

type UserConfig

type UserConfig struct {
	// Tasks is the list of generation tasks for user scope
	Tasks []Task `yaml:"tasks"`
	// Home is an optional override for the user's home directory, primarily for debugging purposes
	Home string `yaml:"home,omitempty"`
}

UserConfig represents global user-level configuration

func (*UserConfig) SetDefaultNames

func (u *UserConfig) SetDefaultNames()

SetDefaultNames sets default names for all tasks in user config

Jump to

Keyboard shortcuts

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