Documentation
¶
Index ¶
- func FindConfigDir(ctx context.Context, toolName string) (string, error)
- func ValidateA2ADefaultCluster(ctx context.Context, cluster string) error
- func ValidateBaselinePath(ctx context.Context, baselinePath string) error
- type A2ADefaultClusterWriter
- type BaselineWriter
- type Config
- type Loader
- type Notification
- type Vault
- func (v *Vault) GetClaudeScript() string
- func (v *Vault) GetDailyDir() string
- func (v *Vault) GetExcludes() []string
- func (v *Vault) GetGoalTemplate() string
- func (v *Vault) GetGoalsDir() string
- func (v *Vault) GetKnowledgeDir() string
- func (v *Vault) GetObjectiveTemplate() string
- func (v *Vault) GetObjectivesDir() string
- func (v *Vault) GetSessionProjectDir() string
- func (v *Vault) GetTaskTemplate() string
- func (v *Vault) GetTasksDir() string
- func (v *Vault) GetThemeTemplate() string
- func (v *Vault) GetThemesDir() string
- func (v *Vault) GetTopicsDir() string
- func (v *Vault) GetVisionDir() string
- func (v *Vault) GetVisionTemplate() string
- func (v *Vault) GetWorkOnCommand() string
- func (v *Vault) GetWorkOnGoalCommand() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindConfigDir ¶ added in v0.96.0
FindConfigDir returns the config directory for the given tool, applying XDG-first priority. If ~/.config/<toolName>/ exists it is returned. Otherwise, if the legacy ~/.<toolName>/ directory exists, it is returned. When neither exists, the XDG path ~/.config/<toolName>/ is returned as the default for new installs. FindConfigDir never creates directories and never writes to the filesystem; it only checks directory existence via os.Stat.
func ValidateA2ADefaultCluster ¶ added in v0.177.0
ValidateA2ADefaultCluster validates a vault's default A2A cluster name. The value is a cluster NAME such as `nukedev`, never a spawn target such as `k8s:nukedev` — the consumer forms the target from the name, so a colon is refused rather than passed through. The rule is the input boundary for the write path: every value accepted here is safe to store and to re-emit in `config list --output json`, and every value rejected here leaves the config file untouched.
func ValidateBaselinePath ¶ added in v0.149.0
ValidateBaselinePath validates a vault-relative baseline path. It rejects an empty path, an absolute path, and any path whose cleaned form escapes the vault root. The same rule guards the write (`config set-baseline`) and the read (`rollup weekly`): a path accepted here is a path both sides can resolve against the vault root, and a path rejected here is rejected by both.
Types ¶
type A2ADefaultClusterWriter ¶ added in v0.177.0
type A2ADefaultClusterWriter interface {
// SetA2ADefaultCluster writes cluster onto the named vault's config entry
// under the key "a2a_default_cluster". The config file is read and validated
// before anything is written: a missing or unparseable config file, a vault
// the config does not name, or a rejected cluster name leaves the file
// exactly as it was.
SetA2ADefaultCluster(ctx context.Context, vaultName string, cluster string) error
}
A2ADefaultClusterWriter persists a vault's default A2A cluster name into the vault-cli config file. It is the only writer of that key.
func NewA2ADefaultClusterWriter ¶ added in v0.177.0
func NewA2ADefaultClusterWriter(configPath string) A2ADefaultClusterWriter
NewA2ADefaultClusterWriter creates an A2ADefaultClusterWriter for the config file at configPath. An empty configPath resolves the config file by the loader's own rule.
type BaselineWriter ¶ added in v0.149.0
type BaselineWriter interface {
// SetBaseline writes baselinePath onto the named vault's config entry under the
// key "baseline". The config file is read and validated before anything is
// written: a missing or unparseable config file, a vault the config does not
// name, or a rejected path leaves the file exactly as it was.
SetBaseline(ctx context.Context, vaultName string, baselinePath string) error
}
BaselineWriter persists a vault's baseline file path into the vault-cli config file. It is the only writer of the config file; `rollup weekly` never writes.
func NewBaselineWriter ¶ added in v0.149.0
func NewBaselineWriter(configPath string) BaselineWriter
NewBaselineWriter creates a BaselineWriter for the config file at configPath. An empty configPath resolves the config file by the loader's own rule.
type Config ¶
type Config struct {
CurrentUser string `yaml:"current_user"`
DefaultVault string `yaml:"default_vault"`
Vaults map[string]Vault `yaml:"vaults"`
Notification Notification `yaml:"notification,omitempty"`
}
Config represents the vault-cli configuration.
type Loader ¶
type Loader interface {
Load(ctx context.Context) (*Config, error)
GetVaultPath(ctx context.Context, vaultName string) (string, error)
GetVault(ctx context.Context, vaultName string) (*Vault, error)
GetAllVaults(ctx context.Context) ([]*Vault, error)
GetCurrentUser(ctx context.Context) (string, error)
}
type Notification ¶ added in v0.134.0
type Notification struct {
Brokers string `yaml:"brokers,omitempty" json:"brokers,omitempty"`
TopicPrefix string `yaml:"topic_prefix,omitempty" json:"topic_prefix,omitempty"`
}
Notification carries the optional escalation-publish settings. An empty Brokers value means vault-cli publishes nothing and opens no broker connection, which is what keeps the tool usable as a standalone local binary.
type Vault ¶
type Vault struct {
Path string `yaml:"path" json:"path"`
Name string `yaml:"name" json:"name"`
TasksDir string `yaml:"tasks_dir,omitempty" json:"tasks_dir,omitempty"`
GoalsDir string `yaml:"goals_dir,omitempty" json:"goals_dir,omitempty"`
ThemesDir string `yaml:"themes_dir,omitempty" json:"themes_dir,omitempty"`
ObjectivesDir string `yaml:"objectives_dir,omitempty" json:"objectives_dir,omitempty"`
VisionDir string `yaml:"vision_dir,omitempty" json:"vision_dir,omitempty"`
DailyDir string `yaml:"daily_dir,omitempty" json:"daily_dir,omitempty"`
KnowledgeDir string `yaml:"knowledge_dir,omitempty" json:"knowledge_dir,omitempty"`
TopicsDir string `yaml:"topics_dir,omitempty" json:"topics_dir,omitempty"`
ClaudeScript string `yaml:"claude_script,omitempty" json:"claude_script,omitempty"`
SessionProjectDir string `yaml:"session_project_dir,omitempty" json:"session_project_dir,omitempty"`
WorkOnCommand string `yaml:"work_on_command,omitempty" json:"work_on_command,omitempty"`
WorkOnGoalCommand string `yaml:"work_on_goal_command,omitempty" json:"work_on_goal_command,omitempty"`
TaskTemplate string `yaml:"task_template,omitempty" json:"task_template,omitempty"`
GoalTemplate string `yaml:"goal_template,omitempty" json:"goal_template,omitempty"`
ThemeTemplate string `yaml:"theme_template,omitempty" json:"theme_template,omitempty"`
ObjectiveTemplate string `yaml:"objective_template,omitempty" json:"objective_template,omitempty"`
VisionTemplate string `yaml:"vision_template,omitempty" json:"vision_template,omitempty"`
Excludes []string `yaml:"excludes,omitempty" json:"excludes,omitempty"`
// Baseline is the vault-relative path of the vault's hand-authored baseline
// file. Empty means the vault has no baseline: `rollup weekly` then prints
// exactly what it printed before the baseline feature existed.
Baseline string `yaml:"baseline,omitempty" json:"baseline,omitempty"`
// A2ADefaultCluster is the cluster NAME (nukedev, not k8s:nukedev) that an
// A2A spawn for this vault falls back to when the task carries no explicit
// target. Empty means the vault names no default: the consumer keeps its own
// fallback behaviour. The value is validated when written and never when
// read, so a hand-edited config carrying a malformed value still lists.
A2ADefaultCluster string `yaml:"a2a_default_cluster,omitempty" json:"a2a_default_cluster,omitempty"`
}
Vault represents a single vault configuration.
func (*Vault) GetClaudeScript ¶ added in v0.17.0
GetClaudeScript returns the claude script to use for sessions, defaulting to "claude" if not set.
func (*Vault) GetDailyDir ¶
GetDailyDir returns the daily notes directory, defaulting to "Daily Notes" if not set.
func (*Vault) GetExcludes ¶ added in v0.28.0
GetExcludes returns the list of excluded directory prefixes.
func (*Vault) GetGoalTemplate ¶ added in v0.57.0
GetGoalTemplate returns the resolved absolute path to the goal template, or empty string if not set.
func (*Vault) GetGoalsDir ¶
GetGoalsDir returns the goals directory, defaulting to "Goals" if not set.
func (*Vault) GetKnowledgeDir ¶ added in v0.66.2
GetKnowledgeDir returns the knowledge base directory, defaulting to "50 Knowledge Base" if not set.
func (*Vault) GetObjectiveTemplate ¶ added in v0.57.0
GetObjectiveTemplate returns the resolved absolute path to the objective template, or empty string if not set.
func (*Vault) GetObjectivesDir ¶
GetObjectivesDir returns the objectives directory, defaulting to "22 Objectives" if not set.
func (*Vault) GetSessionProjectDir ¶ added in v0.47.0
GetSessionProjectDir returns the session project directory override, or empty string if not set.
func (*Vault) GetTaskTemplate ¶ added in v0.57.0
GetTaskTemplate returns the resolved absolute path to the task template, or empty string if not set.
func (*Vault) GetTasksDir ¶
GetTasksDir returns the tasks directory, defaulting to "Tasks" if not set.
func (*Vault) GetThemeTemplate ¶ added in v0.57.0
GetThemeTemplate returns the resolved absolute path to the theme template, or empty string if not set.
func (*Vault) GetThemesDir ¶
GetThemesDir returns the themes directory, defaulting to "21 Themes" if not set.
func (*Vault) GetTopicsDir ¶ added in v0.133.0
GetTopicsDir returns the topics directory, defaulting to "23 Topics" if not set.
func (*Vault) GetVisionDir ¶
GetVisionDir returns the vision directory, defaulting to "20 Vision" if not set.
func (*Vault) GetVisionTemplate ¶ added in v0.57.0
GetVisionTemplate returns the resolved absolute path to the vision template, or empty string if not set.
func (*Vault) GetWorkOnCommand ¶ added in v0.66.10
GetWorkOnCommand returns the Claude slash command for starting work-on sessions, defaulting to /vault-cli:work-on-task if not configured.
func (*Vault) GetWorkOnGoalCommand ¶ added in v0.99.0
GetWorkOnGoalCommand returns the Claude slash command for starting goal work-on sessions, defaulting to /vault-cli:work-on-goal if not configured.