Documentation
¶
Overview ¶
Package config provides path resolution for Flow's directory structure.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SaveFlowConfig ¶
func SaveFlowConfig(path string, fc *FlowConfig) error
SaveFlowConfig writes a FlowConfig to disk as YAML.
Types ¶
type Agent ¶ added in v1.0.0
type Agent struct {
Name string `yaml:"name"`
Exec string `yaml:"exec"`
Default bool `yaml:"default,omitempty"`
}
Agent represents a configured agent tool (editor, AI assistant, etc.).
type Config ¶
type Config struct {
Home string // Root directory (~/.flow or $FLOW_HOME)
WorkspacesDir string // ~/.flow/workspaces/
ReposDir string // ~/.flow/repos/
AgentsDir string // ~/.flow/agents/
ConfigFile string // ~/.flow/config.yaml
StatusSpecFile string // ~/.flow/status.yaml
FlowConfig *FlowConfig // loaded global config
}
Config holds resolved paths for Flow's directory structure.
func New ¶
New creates a Config with resolved paths. Respects $FLOW_HOME if set, otherwise defaults to ~/.flow.
func (*Config) BareRepoPath ¶
BareRepoPath returns the bare clone path for a repo URL. e.g., github.com/org/repo → ~/.flow/repos/github.com/org/repo.git Handles URLs that already end in .git (e.g., git@github.com:org/repo.git).
func (*Config) ClaudeAgentDir ¶
ClaudeAgentDir returns the path for the shared Claude agent directory.
func (*Config) EnsureDirs ¶
EnsureDirs creates the top-level directories if they don't exist. It also creates the default config file if missing, and loads the config.
func (*Config) WorkspacePath ¶
WorkspacePath returns the path for a named workspace.
func (*Config) WorkspaceStatusSpecPath ¶ added in v1.0.0
WorkspaceStatusSpecPath returns the status.yaml path for a workspace.
type FlowConfig ¶
type FlowConfig struct {
APIVersion string `yaml:"apiVersion"`
Kind string `yaml:"kind"`
Spec FlowConfigSpec `yaml:"spec,omitempty"`
}
FlowConfig represents the global flow configuration file.
func DefaultFlowConfig ¶
func DefaultFlowConfig() *FlowConfig
DefaultFlowConfig returns a FlowConfig with default values.
func LoadFlowConfig ¶
func LoadFlowConfig(path string) (*FlowConfig, error)
LoadFlowConfig reads and parses a flow config file from disk.
func (*FlowConfig) DefaultAgent ¶ added in v1.0.0
func (fc *FlowConfig) DefaultAgent() *Agent
DefaultAgent returns the agent marked as default, or nil if none is configured.
type FlowConfigSpec ¶ added in v1.0.0
type FlowConfigSpec struct {
Agents []Agent `yaml:"agents,omitempty"`
}
FlowConfigSpec holds optional configuration nested under spec.