cli

package
v1.5.2 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2026 License: GPL-3.0 Imports: 49 Imported by: 0

Documentation

Overview

Package cli provides the Cobra command tree and dependency injection wiring for the AE-ADK CLI. This file defines the Dependencies struct (Composition Root) that wires all domain modules together.

Index

Constants

This section is empty.

Variables

View Source
var GithubIssueParser github.IssueParser

GithubIssueParser is the issue parser used by github subcommands. Set during dependency injection; tests replace it with a mock.

View Source
var GithubSpecLinkerFactory = func(projectRoot string) (github.SpecLinker, error) {
	return github.NewSpecLinker(projectRoot)
}

GithubSpecLinkerFactory creates a SpecLinker for the given project root. Tests replace this with a factory that returns a mock.

View Source
var StatuslineCmd = &cobra.Command{
	Use:    "statusline",
	Short:  "Render statusline for Claude Code",
	Long:   "Generate a compact statusline string for display in Claude Code's status bar.",
	Hidden: true,
	RunE:   runStatusline,
}

StatuslineCmd is the statusline command.

Functions

func Execute

func Execute() error

@MX:ANCHOR: [AUTO] Execute is the main entry point for the ae CLI @MX:REASON: [AUTO] fan_in=3, called from cmd/ae/main.go, root_test.go, integration_test.go Execute initializes dependencies and runs the root command.

func GitInstallHint

func GitInstallHint() string

GitInstallHint returns OS-specific git installation instructions.

func InitDependencies

func InitDependencies()

@MX:ANCHOR: [AUTO] InitDependencies is the Composition Root that wires all domain modules @MX:REASON: [AUTO] fan_in=5, called from root.go, deps_test.go, integration_test.go, hook_e2e_test.go, deps.go InitDependencies creates and wires all domain dependencies. It should be called once during application startup. Dependencies that require a project root (Config, Git) are initialized lazily on first use or when the project root is available.

func PrintBanner

func PrintBanner(version string)

PrintBanner displays the AE ASCII art banner with version information. The banner uses AE's adaptive brand color (#C45A3C light, #DA7756 dark) and includes the provided version string. If version is empty, it displays "unknown".

func PrintWelcomeMessage

func PrintWelcomeMessage()

PrintWelcomeMessage displays a friendly welcome message for new users. It provides basic usage instructions and reminds users they can exit anytime with Ctrl+C.

func SetDeps

func SetDeps(d *Dependencies)

SetDeps replaces the global dependencies (used for testing).

Types

type BackupMetadata

type BackupMetadata struct {
	Timestamp           string   `json:"timestamp"`
	Description         string   `json:"description"`
	BackedUpItems       []string `json:"backed_up_items"`
	ExcludedItems       []string `json:"excluded_items"`
	ExcludedDirs        []string `json:"excluded_dirs"`
	ProjectRoot         string   `json:"project_root"`
	BackupType          string   `json:"backup_type"`
	TemplateDefaultsDir string   `json:"template_defaults_dir,omitempty"`
}

BackupMetadata represents the structure of backup_metadata.json

type CheckStatus

type CheckStatus string

CheckStatus represents the result of a single diagnostic check.

const (
	// CheckOK indicates the check passed.
	CheckOK CheckStatus = "ok"
	// CheckWarn indicates a non-fatal issue.
	CheckWarn CheckStatus = "warn"
	// CheckFail indicates a critical failure.
	CheckFail CheckStatus = "fail"
)

type Dependencies

type Dependencies struct {
	Config         *config.ConfigManager
	Git            git.Repository
	GitBranch      git.BranchManager
	GitWorktree    git.WorktreeManager
	GitOpsManager  *ops.GitManager
	HookRegistry   hook.Registry
	HookProtocol   hook.Protocol
	UpdateChecker  update.Checker
	UpdateOrch     update.Orchestrator
	LoopController *loop.LoopController
	Logger         *slog.Logger
}

Dependencies holds all domain-level services used by CLI commands. This is the Composition Root: the only place where concrete types are instantiated and wired together. All CLI commands access dependencies through interfaces only.

func GetDeps

func GetDeps() *Dependencies

GetDeps returns the current Dependencies instance. Returns nil if InitDependencies has not been called.

func (*Dependencies) EnsureGit

func (d *Dependencies) EnsureGit(projectRoot string) error

EnsureGit lazily initializes Git-related dependencies. It should be called before using Git, GitBranch, or GitWorktree. Thread-safe: subsequent calls are no-ops if Git is already initialized.

func (*Dependencies) EnsureUpdate

func (d *Dependencies) EnsureUpdate() error

EnsureUpdate lazily initializes Update-related dependencies. It should be called before using UpdateChecker or UpdateOrch. Thread-safe: subsequent calls are no-ops if UpdateChecker is already initialized.

type DiagnosticCheck

type DiagnosticCheck struct {
	Name    string      `json:"name"`
	Status  CheckStatus `json:"status"`
	Message string      `json:"message"`
	Detail  string      `json:"detail,omitempty"`
}

DiagnosticCheck holds the result of a single health check.

Directories

Path Synopsis
Package wizard provides an interactive Bubble Tea-based wizard for AE project initialization.
Package wizard provides an interactive Bubble Tea-based wizard for AE project initialization.
Package worktree provides Git worktree management subcommands.
Package worktree provides Git worktree management subcommands.

Jump to

Keyboard shortcuts

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