config

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package config implements the "scut codex config" command group.

Index

Constants

This section is empty.

Variables

View Source
var ErrUnknownOnlyToken = errors.New("unknown --only token")

ErrUnknownOnlyToken is returned when --only contains a token that is not a known Codex hook slug.

Functions

func Install

func Install(stdout io.Writer, fs afero.Fs, logger *slog.Logger, opts InstallOptions) error

Install reads hooks.json, merges scut entries, and writes the result.

func PathForScope

func PathForScope(scope string) (string, error)

PathForScope returns the hooks.json path for a project or user scope.

Types

type Cmd

type Cmd struct {
	Install   installCmd   `cmd:"install" help:"Write/merge scut hook entries into hooks.json."`
	Uninstall uninstallCmd `cmd:"uninstall" help:"Remove scut entries from hooks.json."`
	Status    statusCmd    `cmd:"status" help:"Show currently-installed scut entries in hooks.json."`
}

Cmd is the Kong command group for "scut codex config".

type HookEntry

type HookEntry struct {
	Type           string                    `json:"type"`
	Command        string                    `json:"command"`
	CommandWindows string                    `json:"commandWindows,omitzero"`
	Timeout        int                       `json:"timeout,omitzero"`
	StatusMessage  string                    `json:"statusMessage,omitzero"`
	Foreign        map[string]jsontext.Value `json:",inline"`
}

HookEntry is one command hook handler.

type HookGroup

type HookGroup struct {
	Matcher string                    `json:"matcher,omitzero"`
	Hooks   []HookEntry               `json:"hooks"`
	Foreign map[string]jsontext.Value `json:",inline"`
}

HookGroup is one matcher group for a Codex hook event.

type HooksFile

type HooksFile struct {
	Hooks   map[string][]HookGroup    `json:"hooks,omitzero"`
	Foreign map[string]jsontext.Value `json:",inline"`
}

HooksFile is the subset of Codex hooks.json that scut manipulates. Foreign top-level keys round-trip through the Foreign field.

type InstallOptions

type InstallOptions struct {
	Scope        string
	Only         []string
	BakeLog      bool
	BakeLogLevel string
	DryRun       bool
}

InstallOptions configures Codex hook installation.

Jump to

Keyboard shortcuts

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