projectcfg

package
v0.66.3 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package projectcfg is the first-class home for locating and loading the project's devx.yaml. It exists so commands stop re-implementing find+read+unmarshal with their own ad-hoc inline structs (the schema itself still lives in package cmd today; this package owns the I/O + the small, command-agnostic views over it).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Find

func Find() (path, dir string, err error)

Find locates devx.yaml by walking up from the current directory, returning its absolute path and the directory it was found in (error if absent).

func Load

func Load(out any) error

Load finds devx.yaml, reads it, and unmarshals it into out — the single reusable entry point so commands don't each re-implement find+read+unmarshal.

Types

type Settings

type Settings struct {
	Env []string `yaml:"env"`
	AI  struct {
		Bridge *bool `yaml:"bridge"`
	} `yaml:"ai"`
}

Settings is the small, command-agnostic slice of devx.yaml that shell-style commands need — the secret-source list and the AI bridge toggle — as a typed view, so callers don't re-declare ad-hoc inline structs.

func LoadSettings

func LoadSettings() (s Settings, found bool)

LoadSettings loads the Settings view. found is false (with no error) when there is no readable devx.yaml, so callers can fall back to a plain .env — matching the historic lenient behavior. Env defaults to ["file://.env"] when omitted.

func (Settings) AIBridgeEnabled

func (s Settings) AIBridgeEnabled() bool

AIBridgeEnabled reports whether the AI bridge override should apply — true unless devx.yaml explicitly set `ai: bridge: false`.

Jump to

Keyboard shortcuts

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