config

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2026 License: MIT Imports: 5 Imported by: 0

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 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
	FlowConfig    *FlowConfig // loaded global config
}

Config holds resolved paths for Flow's directory structure.

func New

func New() (*Config, error)

New creates a Config with resolved paths. Respects $FLOW_HOME if set, otherwise defaults to ~/.flow.

func (*Config) BareRepoPath

func (c *Config) BareRepoPath(repoURL string) string

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

func (c *Config) ClaudeAgentDir() string

ClaudeAgentDir returns the path for the shared Claude agent directory.

func (*Config) EnsureDirs

func (c *Config) EnsureDirs() error

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) StatePath

func (c *Config) StatePath(name string) string

StatePath returns the state.yaml path for a named workspace.

func (*Config) WorkspacePath

func (c *Config) WorkspacePath(name string) string

WorkspacePath returns the path for a named workspace.

type FlowConfig

type FlowConfig struct {
	APIVersion string `yaml:"apiVersion"`
	Kind       string `yaml:"kind"`
}

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.

Jump to

Keyboard shortcuts

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