Documentation
¶
Overview ¶
Package writ implements the writ CLI commands.
Index ¶
- Variables
- func CollectLayerSources() ([]tree.LayerSource, error)
- func NewRootCmd() *cobra.Command
- func PartitionByScope(sources []tree.LayerSource) map[string][]tree.LayerSource
- type AdoptConfig
- type Config
- type DecommissionConfig
- type DeployConfig
- type StatusConfig
- type TargetSpec
- type UpgradeConfig
Constants ¶
This section is empty.
Variables ¶
var LayerOrder = []string{"base", "team", "personal"}
LayerOrder defines the processing order for repository layers. Layers are processed in this order, with later layers overriding earlier ones.
Functions ¶
func CollectLayerSources ¶
func CollectLayerSources() ([]tree.LayerSource, error)
CollectLayerSources gathers all configured repository layers and expands them into source/target pairs. Returns sources ordered: base/System, base/Home, team/System, team/Home, personal/System, personal/Home (if configured/exist).
func NewRootCmd ¶
NewRootCmd creates the root writ command with all subcommands.
Returns:
- *cobra.Command: configured writ command with target flag and all subcommands
func PartitionByScope ¶
func PartitionByScope(sources []tree.LayerSource) map[string][]tree.LayerSource
PartitionByScope groups layer sources by their TargetName ("System", "Home"). Sources within each partition retain their original ordering. Returns an empty map when sources is empty.
Parameters:
- sources: flat list of layer sources from CollectLayerSources
Returns:
- map[string][]tree.LayerSource: sources keyed by TargetName
Types ¶
type AdoptConfig ¶
type AdoptConfig struct {
Config
// Files to adopt.
Files []string
// Layer to adopt into (personal, team, base).
Layer string
// LayerPath is the resolved path to the layer directory.
LayerPath string
// Project to adopt into.
Project string
// FromReceipt adopts from a lore receipt.
FromReceipt bool
}
AdoptConfig contains all settings for an adopt operation.
type Config ¶
type Config struct {
// Tool is "writ" or "lore".
Tool string
// Sources
LayerSources []tree.LayerSource
SourceRoot string // single-repo mode (when no layers configured)
TargetRoot string
// Selection
Projects []string
Segments segment.Segments
// Behavior
DryRun bool
Verbose bool
ConflictPolicy op.ConflictPolicy
// Data for templates
TemplateData map[string]any
// Identities for decryption
Identities []age.Identity
// Signing key (optional)
SigningKey *age.X25519Identity
}
Config contains all resolved settings for a lifecycle operation. This is the common base; specific operations extend it.
func (*Config) SegmentMap ¶
SegmentMap returns the segments as a string map for template data.
type DecommissionConfig ¶
type DecommissionConfig struct {
Config
// Prune empty parent directories after file removal.
Prune bool
}
DecommissionConfig contains all settings for a decommission operation.
type DeployConfig ¶
type DeployConfig struct {
Config
// AllowDirty permits planning against layers with uncommitted changes.
AllowDirty bool
}
DeployConfig contains all settings for a deploy operation.
type StatusConfig ¶
type StatusConfig struct {
Config
// JSONOutput outputs JSON instead of human-readable text.
JSONOutput bool
}
StatusConfig contains all settings for a status report.
type TargetSpec ¶
type TargetSpec struct {
SourceDir string // "System" or "Home"
TargetRoot string // "/" or "$HOME"
}
TargetSpec defines a source directory within a repo and its deployment target.
func TargetOrder ¶
func TargetOrder() []TargetSpec
TargetOrder defines the processing order for targets within each repo. System files are deployed before Home files.
type UpgradeConfig ¶
type UpgradeConfig struct {
Config
// Force upgrades even if target has local modifications.
Force bool
}
UpgradeConfig contains all settings for an upgrade operation.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package adopt plans the `writ adopt` batch graph.
|
Package adopt plans the `writ adopt` batch graph. |
|
Package decommission removes deployed files through the sealed graph model (phase-8 step 47 slice 2).
|
Package decommission removes deployed files through the sealed graph model (phase-8 step 47 slice 2). |
|
Package deploy plans and executes writ deployments on the sealed graph model (phase-8 step 47 slice 1).
|
Package deploy plans and executes writ deployments on the sealed graph model (phase-8 step 47 slice 1). |
|
Package identity provides age identity loading for writ.
|
Package identity provides age identity loading for writ. |
|
Package migrate implements dotfile migration analysis and execution.
|
Package migrate implements dotfile migration analysis and execution. |
|
Package readback derives "what has writ deployed" from the store's graph and trace documents (phase-8 step 47 slice 1).
|
Package readback derives "what has writ deployed" from the store's graph and trace documents (phase-8 step 47 slice 1). |
|
Package secret implements the writ secret family: SOPS lifecycle operations scoped to registered layers.
|
Package secret implements the writ secret family: SOPS lifecycle operations scoped to registered layers. |
|
Package segment provides segment-based directory matching for writ.
|
Package segment provides segment-based directory matching for writ. |
|
Package snapshot provides git worktree-based snapshots for hermetic planning.
|
Package snapshot provides git worktree-based snapshots for hermetic planning. |
|
Package status reports what should be present, where it should have come from, and what's missing or different (phase-8 step 47 slice 3 — `writ status` replaces `writ reconcile`).
|
Package status reports what should be present, where it should have come from, and what's missing or different (phase-8 step 47 slice 3 — `writ status` replaces `writ reconcile`). |
|
Package tree builds deployment trees from source and target specifications.
|
Package tree builds deployment trees from source and target specifications. |
|
Package upgrade regenerates deployed copied files (templates, secrets, copies) from their current sources (phase-8 step 47 slice 2).
|
Package upgrade regenerates deployed copied files (templates, secrets, copies) from their current sources (phase-8 step 47 slice 2). |
|
Package verify implements `writ verify` — publisher-signature verification for graph and trace documents (phase-8 step 46).
|
Package verify implements `writ verify` — publisher-signature verification for graph and trace documents (phase-8 step 46). |