commands

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2025 License: MIT Imports: 24 Imported by: 0

Documentation

Overview

Package commands provides Command implementations for the pack orchestration.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetPacksStatus

func GetPacksStatus(opts StatusCommandOptions) (*display.PackCommandResult, error)

GetPacksStatus shows the deployment status of specified packs This is a query operation that uses core pack discovery but doesn't execute handlers.

func InitPreprocess

func InitPreprocess(packName string, dotfilesRoot string, fs types.FS) error

InitPreprocess creates the pack directory before the pipeline runs. This should be called before executing the pack orchestration.

Types

type AddIgnoreCommand

type AddIgnoreCommand struct{}

AddIgnoreCommand implements the "add-ignore" command using the pack orchestration. It creates a .dodotignore file in a pack.

func (*AddIgnoreCommand) ExecuteForPack

func (c *AddIgnoreCommand) ExecuteForPack(pack types.Pack, opts orchestration.Options) (*orchestration.PackResult, error)

ExecuteForPack creates a .dodotignore file in the pack.

func (*AddIgnoreCommand) Name

func (c *AddIgnoreCommand) Name() string

Name returns the command name.

type AdoptCommand

type AdoptCommand struct {
	// SourcePaths are the files to adopt
	SourcePaths []string
	// Force allows overwriting existing files
	Force bool
}

AdoptCommand implements the "adopt" command using the pack orchestration. It moves files from the system into a pack.

func (*AdoptCommand) ExecuteForPack

func (c *AdoptCommand) ExecuteForPack(pack types.Pack, opts orchestration.Options) (*orchestration.PackResult, error)

ExecuteForPack adopts files into a pack.

func (*AdoptCommand) Name

func (c *AdoptCommand) Name() string

Name returns the command name.

type DownCommand

type DownCommand struct{}

DownCommand implements the "down" command using the pack orchestration.

func (*DownCommand) ExecuteForPack

func (c *DownCommand) ExecuteForPack(pack types.Pack, opts orchestration.Options) (*orchestration.PackResult, error)

ExecuteForPack executes the "down" command for a single pack.

func (*DownCommand) Name

func (c *DownCommand) Name() string

Name returns the command name.

type FileStatus

type FileStatus struct {
	Handler        string
	Path           string
	Status         Status
	AdditionalInfo string
}

FileStatus represents the status of a single file

type FillCommand

type FillCommand struct{}

FillCommand implements the "fill" command using the pack orchestration. It populates a pack with template files.

func (*FillCommand) ExecuteForPack

func (c *FillCommand) ExecuteForPack(pack types.Pack, opts orchestration.Options) (*orchestration.PackResult, error)

ExecuteForPack fills a pack with template files.

func (*FillCommand) Name

func (c *FillCommand) Name() string

Name returns the command name.

type InitCommand

type InitCommand struct {
	// PackName is the name of the pack to create
	PackName string
}

InitCommand implements the "init" command using the pack orchestration. It creates a new pack and then uses FillCommand to populate it.

func (*InitCommand) ExecuteForPack

func (c *InitCommand) ExecuteForPack(pack types.Pack, opts orchestration.Options) (*orchestration.PackResult, error)

ExecuteForPack creates a new pack and fills it with template files. Note: This is special because it creates the pack first, then operates on it.

func (*InitCommand) Name

func (c *InitCommand) Name() string

Name returns the command name.

type Status

type Status struct {
	State     StatusState
	Message   string
	Timestamp *time.Time
}

Status represents the status of a single item

type StatusCommand

type StatusCommand struct{}

StatusCommand implements the "status" command using the pack orchestration.

func (*StatusCommand) ExecuteForPack

func (c *StatusCommand) ExecuteForPack(pack types.Pack, opts orchestration.Options) (*orchestration.PackResult, error)

ExecuteForPack executes the "status" command for a single pack.

func (*StatusCommand) Name

func (c *StatusCommand) Name() string

Name returns the command name.

type StatusCommandOptions

type StatusCommandOptions struct {
	// DotfilesRoot is the root directory containing packs
	DotfilesRoot string

	// PackNames specifies which packs to check status for
	// If empty, all packs are checked
	PackNames []string

	// Paths provides system paths (optional, will be created if not provided)
	Paths types.Pather

	// FileSystem to use (optional, defaults to OS filesystem)
	FileSystem types.FS
}

StatusCommandOptions contains options for the status command

type StatusOptions

type StatusOptions struct {
	Pack       types.Pack
	DataStore  datastore.DataStore
	FileSystem types.FS
	Paths      paths.Paths
}

StatusOptions contains options for getting pack status

type StatusResult

type StatusResult struct {
	Name      string
	Path      string
	HasConfig bool
	IsIgnored bool
	Status    string
	Files     []FileStatus
}

StatusResult represents the complete status of a pack

func GetStatus

func GetStatus(opts StatusOptions) (*StatusResult, error)

GetStatus retrieves the status of a pack

type StatusState

type StatusState string

StatusState represents the state of a deployment

const (
	// StatusStatePending indicates the action has not been executed yet
	StatusStatePending StatusState = "pending"
	// StatusStateReady indicates the action was executed and is ready
	StatusStateReady StatusState = "ready"
	// StatusStateSuccess indicates success
	StatusStateSuccess StatusState = "success"
	// StatusStateMissing indicates missing files
	StatusStateMissing StatusState = "missing"
	// StatusStateError indicates an error occurred
	StatusStateError StatusState = "error"
	// StatusStateIgnored indicates the file/pack is ignored
	StatusStateIgnored StatusState = "ignored"
	// StatusStateConfig indicates this is a config file
	StatusStateConfig StatusState = "config"
)

type UpCommand

type UpCommand struct {
	// NoProvision skips the provisioning phase
	NoProvision bool

	// Force forces operations even if they might be destructive
	Force bool
}

UpCommand implements the "up" command using the pack orchestration.

func (*UpCommand) ExecuteForPack

func (c *UpCommand) ExecuteForPack(pack types.Pack, opts orchestration.Options) (*orchestration.PackResult, error)

ExecuteForPack executes the "up" command for a single pack.

func (*UpCommand) Name

func (c *UpCommand) Name() string

Name returns the command name.

Jump to

Keyboard shortcuts

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