Documentation
¶
Overview ¶
Package cli implements the blackdot command-line interface using Cobra.
Package cli output utilities Mirrors lib/_colors.sh and lib/_logging.sh from the Zsh implementation
Package cli implements the blackdot command-line interface using Cobra.
Commands mirror the existing Zsh implementation in bin/blackdot-* to ensure behavioral compatibility during migration.
Package cli provides custom help styling that matches the ZSH implementation.
Package cli implements the blackdot command-line interface using Cobra.
Package cli implements the blackdot command-line interface using Cobra.
Package cli implements the blackdot command-line interface using Cobra.
Package cli implements the blackdot command-line interface using Cobra.
Package cli implements the blackdot command-line interface using Cobra.
Package cli implements the blackdot command-line interface using Cobra.
Package cli implements the blackdot command-line interface using Cobra.
Package cli implements the blackdot command-line interface using Cobra.
Index ¶
- Variables
- func BlackdotDir() string
- func ConfigDir() string
- func Confirm(prompt string) bool
- func Debug(format string, a ...interface{})
- func DryRun(format string, a ...interface{})
- func Execute() error
- func Fail(format string, a ...interface{})
- func Info(format string, a ...interface{})
- func Pass(format string, a ...interface{})
- func PrintDeps(deps string)
- func PrintFeature(name, description string, enabled bool)
- func PrintHeader(title string)
- func PrintHint(format string, a ...interface{})
- func PrintLegend()
- func PrintSubheader(title string)
- func SetVersionInfo(version, commit, date string)
- func StatusColor(enabled bool) *color.Color
- func StatusIcon(enabled bool) string
- func Warn(format string, a ...interface{})
- type DevcontainerConfig
- type DevcontainerCustomizations
- type DevcontainerImage
- type DevcontainerPreset
- type DevcontainerService
- type DriftFileState
- type DriftState
- type HookEntry
- type HookSettings
- type HooksConfig
- type MetricEntry
- type PackagesConfig
- type PathsConfig
- type SetupConfig
- type SetupState
- type SyncDirection
- type VSCodeCustomizations
- type VaultConfig
- type VaultItem
Constants ¶
This section is empty.
Variables ¶
var ( Red = color.New(color.FgRed) Green = color.New(color.FgGreen) Yellow = color.New(color.FgYellow) Blue = color.New(color.FgBlue) Cyan = color.New(color.FgCyan) Magenta = color.New(color.FgMagenta) Bold = color.New(color.Bold) Dim = color.New(color.Faint) )
============================================================ Colors ============================================================
Combined styles
Functions ¶
func BlackdotDir ¶
func BlackdotDir() string
BlackdotDir returns the resolved blackdot directory path. NOTE: Returns "" if called before Cobra initialization completes. blackdotDir is populated by initConfig(), which is registered via cobra.OnInitialize and runs before any command's RunE function. Do not call BlackdotDir() from package init() or during import.
func ConfigDir ¶
func ConfigDir() string
ConfigDir returns the config directory (~/.config/blackdot)
func Debug ¶
func Debug(format string, a ...interface{})
Debug prints a debug message (only when verbose flag is set)
func PrintDeps ¶
func PrintDeps(deps string)
PrintDeps prints dependencies in dim text with tree prefix
func PrintFeature ¶
PrintFeature prints a feature with status icon and description
func PrintHeader ¶
func PrintHeader(title string)
PrintHeader prints a bold section header with double-line border
func PrintHint ¶
func PrintHint(format string, a ...interface{})
PrintHint prints a dim hint message
func PrintSubheader ¶
func PrintSubheader(title string)
PrintSubheader prints a category subheader with single-line border
func SetVersionInfo ¶
func SetVersionInfo(version, commit, date string)
SetVersionInfo sets version information from build flags
func StatusColor ¶
StatusColor returns the appropriate color for enabled/disabled state
func StatusIcon ¶
StatusIcon returns the appropriate icon for enabled/disabled state
Types ¶
type DevcontainerConfig ¶
type DevcontainerConfig struct {
Name string `json:"name"`
Image string `json:"image,omitempty"`
DockerComposeFile string `json:"dockerComposeFile,omitempty"`
Service string `json:"service,omitempty"`
Features map[string]map[string]string `json:"features"`
PostStartCommand string `json:"postStartCommand"`
Customizations *DevcontainerCustomizations `json:"customizations,omitempty"`
RemoteUser string `json:"remoteUser,omitempty"`
Mounts []string `json:"mounts,omitempty"`
ContainerEnv map[string]string `json:"containerEnv,omitempty"`
WorkspaceFolder string `json:"workspaceFolder,omitempty"`
}
DevcontainerConfig represents the generated devcontainer.json
type DevcontainerCustomizations ¶
type DevcontainerCustomizations struct {
VSCode *VSCodeCustomizations `json:"vscode,omitempty"`
}
type DevcontainerImage ¶
type DevcontainerImage struct {
Name string
Image string
Description string
Extensions []string // VS Code extensions to recommend
}
DevcontainerImage represents a base image option
type DevcontainerPreset ¶
DevcontainerPreset represents a blackdot preset option
type DevcontainerService ¶
type DevcontainerService struct {
Name string
Image string
Description string
Ports []string // Exposed ports
Environment map[string]string // Environment variables
Volumes []string // Volume mounts
EnvVars map[string]string // Environment variables to set in app container
Healthcheck string // Healthcheck command
ConflictsWith []string // Services this conflicts with (share same env vars)
}
DevcontainerService represents a supporting service (database, cache, etc.)
type DriftFileState ¶
DriftFileState represents state for a single file
type DriftState ¶
type DriftState struct {
Timestamp string `json:"timestamp"`
Hostname string `json:"hostname"`
Files map[string]DriftFileState `json:"files"`
}
DriftState represents the cached vault state
type HookEntry ¶
type HookEntry struct {
Name string `json:"name"`
Command string `json:"command,omitempty"`
Script string `json:"script,omitempty"`
Function string `json:"function,omitempty"`
Enabled *bool `json:"enabled,omitempty"`
FailOk bool `json:"fail_ok,omitempty"`
}
HookEntry represents a single hook configuration
type HookSettings ¶
type HookSettings struct {
FailFast bool `json:"fail_fast"`
Verbose bool `json:"verbose"`
Timeout int `json:"timeout"`
}
HookSettings represents hook system settings
type HooksConfig ¶
type HooksConfig struct {
Hooks map[string][]HookEntry `json:"hooks"`
Settings HookSettings `json:"settings"`
}
HooksConfig represents the hooks.json configuration
type MetricEntry ¶
type MetricEntry struct {
Timestamp string `json:"timestamp"`
HealthScore int `json:"health_score"`
Errors int `json:"errors"`
Warnings int `json:"warnings"`
Fixed int `json:"fixed"`
GitBranch string `json:"git_branch"`
GitCommit string `json:"git_commit"`
Hostname string `json:"hostname"`
OS string `json:"os"`
}
MetricEntry represents a single health check metric
type PackagesConfig ¶
type PackagesConfig struct {
Tier string `json:"tier,omitempty"`
}
type PathsConfig ¶
type PathsConfig struct {
WorkspaceTarget string `json:"workspace_target,omitempty"`
}
type SetupConfig ¶
type SetupConfig struct {
Version int `json:"version"`
Setup SetupState `json:"setup"`
Vault VaultConfig `json:"vault,omitempty"`
Paths PathsConfig `json:"paths,omitempty"`
Packages PackagesConfig `json:"packages,omitempty"`
Features map[string]bool `json:"features,omitempty"`
Extra map[string]interface{} `json:"-"`
}
SetupConfig holds config for setup
type SetupState ¶
type SyncDirection ¶
type SyncDirection string
SyncDirection represents the direction of sync
const ( SyncInSync SyncDirection = "in_sync" SyncPush SyncDirection = "push" SyncPull SyncDirection = "pull" SyncConflict SyncDirection = "conflict" )
type VSCodeCustomizations ¶
type VSCodeCustomizations struct {
Extensions []string `json:"extensions,omitempty"`
}
type VaultConfig ¶
Source Files
¶
- backup.go
- completion.go
- config.go
- devcontainer.go
- diff.go
- doctor.go
- drift.go
- encrypt.go
- features.go
- hook.go
- import_chezmoi.go
- lint.go
- macos.go
- metrics.go
- misc.go
- output.go
- packages.go
- rollback.go
- root.go
- setup.go
- shell_init.go
- status.go
- style.go
- sync.go
- template.go
- tools.go
- tools_aws.go
- tools_cdk.go
- tools_claude.go
- tools_docker.go
- tools_go.go
- tools_python.go
- tools_rust.go
- tools_ssh.go
- uninstall.go
- vault.go
- version.go