settings

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package settings hosts the `da settings` command tree. It splits out from the parent commands/ package per plan root-command-decomposition (t10b), mirroring the agents/ and skills/ subpackages. Canonical list/show/remove flows route through commands/internal/cmdutil so the rules/mcp/settings trio share one implementation of the resource-command shape.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCmd

func NewCmd(deps Deps) *cobra.Command

NewCmd builds the `da settings` command tree from injected dependencies. Mirrors agents.NewAgentsCmd / skills.NewSkillsCmd: helpers come from Deps so the subpackage stays independent of the parent commands/ package. The cobra-tree assembly lives in cmdutil so mcp/settings/rules share one implementation; the per-resource description lives in a single CanonicalFileSpec built by canonicalSpec (see list.go).

func NewListCmd

func NewListCmd(deps Deps) *cobra.Command

NewListCmd / NewShowCmd / NewRemoveCmd build each subcommand standalone.

func NewRemoveCmd

func NewRemoveCmd(deps Deps) *cobra.Command

func NewShowCmd

func NewShowCmd(deps Deps) *cobra.Command

func RunList

func RunList(scope string) error

RunList prints canonical settings entries for a scope. No Deps needed because no hint-driven errors fire in the list path — list surfaces only info messages via cmdutil.

func RunRemove

func RunRemove(deps Deps, scope, name string) error

RunRemove deletes a canonical settings file under ~/.agents/settings/<scope>/, honoring the dry-run / yes / force flags carried in Deps.

func RunShow

func RunShow(deps Deps, scope, name string) error

RunShow prints metadata for one canonical settings file under ~/.agents/settings/<scope>/.

Types

type Deps

type Deps struct {
	Flags                 GlobalFlags
	ErrorWithHints        func(message string, hints ...string) error
	UsageError            func(message string, hints ...string) error
	MaximumNArgsWithHints func(n int, hints ...string) cobra.PositionalArgs
	ExactArgsWithHints    func(n int, hints ...string) cobra.PositionalArgs
}

Deps carries UX helpers from the commands package without an import cycle. Mirrors agents.Deps / skills.Deps so the extracted subpackages share the same wiring shape. Only fields actually consumed by settings subcommands are present.

type GlobalFlags

type GlobalFlags struct {
	DryRun bool
	Yes    bool
	Force  bool
}

GlobalFlags mirrors the subset of commands.Flags used by settings subcommands. Kept as a parallel type to commands.GlobalFlags so the settings subpackage has no import on the parent commands/ package.

Jump to

Keyboard shortcuts

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