settings

package
v0.7.23 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const CommitMatcher = "Bash(git commit*)"

CommitMatcher is the hook matcher string that chunk manages.

Variables

This section is empty.

Functions

func Build

func Build(commands []config.Command) ([]byte, error)

Build generates .claude/settings.json content from commands. It creates a single PreToolUse hook matching "Bash(git commit*)" that runs each command directly.

func Diff

func Diff(original, merged []byte) string

Diff returns a unified diff string between the original and merged JSON. Returns an empty string if there are no differences.

Types

type MergeResult

type MergeResult struct {
	Original []byte // existing settings.json content (re-marshaled for normalized formatting)
	Merged   []byte // merged result
	Changed  bool   // false if already up to date
}

MergeResult holds the computed merge without performing any I/O.

func Merge

func Merge(existing, generated []byte) (*MergeResult, error)

Merge computes the merged settings from existing and generated JSON bytes. It preserves all unknown keys in the existing settings and applies chunk's generated keys on top. Returns data only — display and file writing are the caller's responsibility.

Jump to

Keyboard shortcuts

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