cli

package
v1.0.84 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2026 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Overview

Package cli provides the Lift CLI command implementations.

Package cli provides the Lift CLI command implementations.

Package cli provides the Lift CLI command implementations.

Package cli provides the Lift CLI command implementations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckCDK added in v1.0.82

func CheckCDK(lookPath LookPathFunc) error

CheckCDK verifies that the "cdk" binary is available. It returns an actionable error if CDK is not found.

func CheckGo added in v1.0.82

func CheckGo(lookPath LookPathFunc) error

CheckGo verifies that the "go" binary is available. It returns an actionable error if Go is not found.

func CheckNode added in v1.0.82

func CheckNode(lookPath LookPathFunc) error

CheckNode verifies that the "node" binary is available. It returns an actionable error if Node.js is not found. Note: This is optional; CDK has Node.js as a dependency.

func CheckPrereqs added in v1.0.82

func CheckPrereqs(lookPath LookPathFunc, binaries ...string) error

CheckPrereqs validates multiple prerequisites and returns the first error found.

func DefaultLookPath added in v1.0.82

func DefaultLookPath(name string) (string, error)

DefaultLookPath wraps exec.LookPath with the LookPathFunc signature.

func IsPrereqError added in v1.0.82

func IsPrereqError(err error) bool

IsPrereqError checks if the error is a PrereqError.

Types

type AddCommand added in v1.0.82

type AddCommand struct{}

AddCommand implements the "lift add" command for incremental scaffolding. Currently supports: lift add function <name>

func (*AddCommand) Description added in v1.0.82

func (c *AddCommand) Description() string

func (*AddCommand) Execute added in v1.0.82

func (c *AddCommand) Execute(ctx context.Context, args []string) error

Execute runs the add command

func (*AddCommand) Name added in v1.0.82

func (c *AddCommand) Name() string

func (*AddCommand) Usage added in v1.0.82

func (c *AddCommand) Usage() string

type AttributeSpec added in v1.0.37

type AttributeSpec struct {
	Name     string `json:"name"`
	Type     string `json:"type"`
	Required bool   `json:"required"`
}

AttributeSpec defines an attribute specification

type BenchmarkCommand

type BenchmarkCommand struct{}

BenchmarkCommand runs performance benchmarks

func (*BenchmarkCommand) Description

func (c *BenchmarkCommand) Description() string

func (*BenchmarkCommand) Execute

func (c *BenchmarkCommand) Execute(_ context.Context, args []string) error

func (*BenchmarkCommand) Name

func (c *BenchmarkCommand) Name() string

func (*BenchmarkCommand) Usage

func (c *BenchmarkCommand) Usage() string

type BenchmarkConfig added in v1.0.37

type BenchmarkConfig struct {
	TableName   string
	OutputDir   string
	Region      string
	Operations  []string
	Concurrency int
	Duration    time.Duration
	ItemSize    int
	Warmup      time.Duration
}

BenchmarkConfig holds benchmarking configuration

type BenchmarkEnvironment added in v1.0.37

type BenchmarkEnvironment struct {
	Region           string `json:"region"`
	Runtime          string `json:"runtime"`
	Architecture     string `json:"architecture"`
	MemorySize       string `json:"memory_size"`
	TableBillingMode string `json:"table_billing_mode"`
	TimestampUTC     string `json:"timestamp_utc"`
}

BenchmarkEnvironment captures environment information

type BenchmarkResults added in v1.0.37

type BenchmarkResults struct {
	StartTime        time.Time                   `json:"start_time"`
	EndTime          time.Time                   `json:"end_time"`
	OperationResults map[string]*OperationResult `json:"operation_results"`
	Environment      BenchmarkEnvironment        `json:"environment"`
	TableName        string                      `json:"table_name"`
	Duration         time.Duration               `json:"duration"`
	Concurrency      int                         `json:"concurrency"`
	ColdStartTime    time.Duration               `json:"cold_start_time"`
	WarmupTime       time.Duration               `json:"warmup_time"`
}

BenchmarkResults holds benchmark results

type BuildCommand added in v1.0.37

type BuildCommand struct {
	// contains filtered or unexported fields
}

BuildCommand builds Lambda functions defined in lift.yaml. It reads the functions map from configuration and produces the configured output files (e.g. dist/<fn>/bootstrap) for each function.

func (*BuildCommand) Description added in v1.0.37

func (c *BuildCommand) Description() string

func (*BuildCommand) Execute added in v1.0.37

func (c *BuildCommand) Execute(ctx context.Context, args []string) error

Execute builds all Lambda functions defined in lift.yaml. It supports running from project root or any subdirectory.

func (*BuildCommand) Name added in v1.0.37

func (c *BuildCommand) Name() string

func (*BuildCommand) Usage added in v1.0.37

func (c *BuildCommand) Usage() string

type CDKDeployCommand added in v1.0.37

type CDKDeployCommand struct{}

CDKDeployCommand deploys the CDK stack

func (*CDKDeployCommand) Description added in v1.0.37

func (c *CDKDeployCommand) Description() string

func (*CDKDeployCommand) Execute added in v1.0.37

func (c *CDKDeployCommand) Execute(ctx context.Context, args []string) error

func (*CDKDeployCommand) Name added in v1.0.37

func (c *CDKDeployCommand) Name() string

func (*CDKDeployCommand) Usage added in v1.0.37

func (c *CDKDeployCommand) Usage() string

type CDKDestroyCommand added in v1.0.37

type CDKDestroyCommand struct{}

CDKDestroyCommand destroys the CDK stack

func (*CDKDestroyCommand) Description added in v1.0.37

func (c *CDKDestroyCommand) Description() string

func (*CDKDestroyCommand) Execute added in v1.0.37

func (c *CDKDestroyCommand) Execute(ctx context.Context, args []string) error

func (*CDKDestroyCommand) Name added in v1.0.37

func (c *CDKDestroyCommand) Name() string

func (*CDKDestroyCommand) Usage added in v1.0.37

func (c *CDKDestroyCommand) Usage() string

type CDKDiffCommand added in v1.0.37

type CDKDiffCommand struct{}

CDKDiffCommand shows differences between deployed stack and local code

func (*CDKDiffCommand) Description added in v1.0.37

func (c *CDKDiffCommand) Description() string

func (*CDKDiffCommand) Execute added in v1.0.37

func (c *CDKDiffCommand) Execute(ctx context.Context, args []string) error

func (*CDKDiffCommand) Name added in v1.0.37

func (c *CDKDiffCommand) Name() string

func (*CDKDiffCommand) Usage added in v1.0.37

func (c *CDKDiffCommand) Usage() string

type CDKInitCommand added in v1.0.37

type CDKInitCommand struct{}

CDKInitCommand creates a new CDK app for a Lift project

func (*CDKInitCommand) Description added in v1.0.37

func (c *CDKInitCommand) Description() string

func (*CDKInitCommand) Execute added in v1.0.37

func (c *CDKInitCommand) Execute(_ context.Context, args []string) error

func (*CDKInitCommand) Name added in v1.0.37

func (c *CDKInitCommand) Name() string

func (*CDKInitCommand) Usage added in v1.0.37

func (c *CDKInitCommand) Usage() string

type CDKSynthCommand added in v1.0.37

type CDKSynthCommand struct{}

CDKSynthCommand synthesizes the CDK stack

func (*CDKSynthCommand) Description added in v1.0.37

func (c *CDKSynthCommand) Description() string

func (*CDKSynthCommand) Execute added in v1.0.37

func (c *CDKSynthCommand) Execute(ctx context.Context, args []string) error

func (*CDKSynthCommand) Name added in v1.0.37

func (c *CDKSynthCommand) Name() string

func (*CDKSynthCommand) Usage added in v1.0.37

func (c *CDKSynthCommand) Usage() string

type CLI

type CLI struct {
	// contains filtered or unexported fields
}

CLI represents the main CLI application

func NewCLI

func NewCLI(version string) *CLI

NewCLI creates a new CLI instance

func (*CLI) Execute

func (c *CLI) Execute(ctx context.Context, args []string) error

Execute runs the CLI with the given arguments

func (*CLI) ListCommands

func (c *CLI) ListCommands() map[string]Command

ListCommands returns all available commands

func (*CLI) RegisterCommand

func (c *CLI) RegisterCommand(cmd Command)

RegisterCommand registers a new command

type Command

type Command interface {
	Name() string
	Description() string
	Usage() string
	Execute(ctx context.Context, args []string) error
}

Command represents a CLI command

type DeployCommand

type DeployCommand struct{}

DeployCommand deploys the application

func (*DeployCommand) Description

func (c *DeployCommand) Description() string

func (*DeployCommand) Execute

func (c *DeployCommand) Execute(_ context.Context, args []string) error

func (*DeployCommand) Name

func (c *DeployCommand) Name() string

func (*DeployCommand) Usage

func (c *DeployCommand) Usage() string

type DevCommand

type DevCommand struct{}

DevCommand starts the development server

func (*DevCommand) Description

func (c *DevCommand) Description() string

func (*DevCommand) Execute

func (c *DevCommand) Execute(ctx context.Context, args []string) error

func (*DevCommand) Name

func (c *DevCommand) Name() string

func (*DevCommand) Usage

func (c *DevCommand) Usage() string

type DownCommand added in v1.0.82

type DownCommand struct {
	// contains filtered or unexported fields
}

DownCommand implements the "lift down" command for destroying deployments

func (*DownCommand) Description added in v1.0.82

func (c *DownCommand) Description() string

func (*DownCommand) Execute added in v1.0.82

func (c *DownCommand) Execute(ctx context.Context, args []string) error

Execute runs the down command. It: 1. Finds the project root by walking up for lift.yaml 2. Parses the configuration 3. Destroys stacks in reverse deploy order using CDK 4. Removes the state file on success (clears domain lock)

func (*DownCommand) Name added in v1.0.82

func (c *DownCommand) Name() string

func (*DownCommand) Usage added in v1.0.82

func (c *DownCommand) Usage() string

type DynamORMBenchmarkCommand added in v1.0.37

type DynamORMBenchmarkCommand struct{}

DynamORMBenchmarkCommand handles performance benchmarking for DynamORM operations

func (*DynamORMBenchmarkCommand) Description added in v1.0.37

func (c *DynamORMBenchmarkCommand) Description() string

func (*DynamORMBenchmarkCommand) Execute added in v1.0.37

func (c *DynamORMBenchmarkCommand) Execute(_ context.Context, args []string) error

func (*DynamORMBenchmarkCommand) Name added in v1.0.37

func (c *DynamORMBenchmarkCommand) Name() string

func (*DynamORMBenchmarkCommand) Usage added in v1.0.37

func (c *DynamORMBenchmarkCommand) Usage() string

type DynamORMMigrateCommand added in v1.0.37

type DynamORMMigrateCommand struct {
	// contains filtered or unexported fields
}

DynamORMMigrateCommand handles migration from existing DynamoDB tables to DynamORM

func (*DynamORMMigrateCommand) Description added in v1.0.37

func (c *DynamORMMigrateCommand) Description() string

func (*DynamORMMigrateCommand) Execute added in v1.0.37

func (c *DynamORMMigrateCommand) Execute(ctx context.Context, args []string) error

func (*DynamORMMigrateCommand) Name added in v1.0.37

func (c *DynamORMMigrateCommand) Name() string

DynamORMMigrateCommand methods

func (*DynamORMMigrateCommand) Usage added in v1.0.37

func (c *DynamORMMigrateCommand) Usage() string

type DynamORMScaffoldCommand added in v1.0.37

type DynamORMScaffoldCommand struct{}

DynamORMScaffoldCommand scaffolds DynamORM models, CDK constructs, and examples

func (*DynamORMScaffoldCommand) Description added in v1.0.37

func (c *DynamORMScaffoldCommand) Description() string

func (*DynamORMScaffoldCommand) Execute added in v1.0.37

func (c *DynamORMScaffoldCommand) Execute(_ context.Context, args []string) error

func (*DynamORMScaffoldCommand) Name added in v1.0.37

func (c *DynamORMScaffoldCommand) Name() string

func (*DynamORMScaffoldCommand) Usage added in v1.0.37

func (c *DynamORMScaffoldCommand) Usage() string

type GSIAnalysis added in v1.0.37

type GSIAnalysis struct {
	SortKey        *AttributeSpec           `json:"sort_key,omitempty"`
	IndexName      string                   `json:"index_name"`
	ProjectionType string                   `json:"projection_type"`
	PartitionKey   AttributeSpec            `json:"partition_key"`
	KeySchema      []types.KeySchemaElement `json:"key_schema"`
	ItemCount      int64                    `json:"item_count"`
}

GSIAnalysis contains GSI analysis

type GSIConfig added in v1.0.37

type GSIConfig struct {
	IndexName    string
	PartitionKey string
	SortKey      string
}

GSIConfig holds GSI configuration

type HealthCommand

type HealthCommand struct{}

HealthCommand checks function health

func (*HealthCommand) Description

func (c *HealthCommand) Description() string

func (*HealthCommand) Execute

func (c *HealthCommand) Execute(_ context.Context, args []string) error

func (*HealthCommand) Name

func (c *HealthCommand) Name() string

func (*HealthCommand) Usage

func (c *HealthCommand) Usage() string

type HelpCommand

type HelpCommand struct {
	// contains filtered or unexported fields
}

HelpCommand displays help information

func (*HelpCommand) Description

func (c *HelpCommand) Description() string

func (*HelpCommand) Execute

func (c *HelpCommand) Execute(_ context.Context, args []string) error

func (*HelpCommand) Name

func (c *HelpCommand) Name() string

func (*HelpCommand) Usage

func (c *HelpCommand) Usage() string

type LSIAnalysis added in v1.0.37

type LSIAnalysis struct {
	IndexName      string        `json:"index_name"`
	ProjectionType string        `json:"projection_type"`
	SortKey        AttributeSpec `json:"sort_key"`
	ItemCount      int64         `json:"item_count"`
}

LSIAnalysis contains LSI analysis

type LogsCommand

type LogsCommand struct{}

LogsCommand streams function logs

func (*LogsCommand) Description

func (c *LogsCommand) Description() string

func (*LogsCommand) Execute

func (c *LogsCommand) Execute(ctx context.Context, args []string) error

func (*LogsCommand) Name

func (c *LogsCommand) Name() string

func (*LogsCommand) Usage

func (c *LogsCommand) Usage() string

type LookPathFunc added in v1.0.82

type LookPathFunc func(name string) (string, error)

LookPathFunc is a function type that checks if a binary is found in PATH. This enables dependency injection for testing.

type MetricsCommand

type MetricsCommand struct{}

MetricsCommand displays function metrics

func (*MetricsCommand) Description

func (c *MetricsCommand) Description() string

func (*MetricsCommand) Execute

func (c *MetricsCommand) Execute(_ context.Context, args []string) error

func (*MetricsCommand) Name

func (c *MetricsCommand) Name() string

func (*MetricsCommand) Usage

func (c *MetricsCommand) Usage() string

type MigrationConfig added in v1.0.37

type MigrationConfig struct {
	TableName     string `json:"table_name"`
	Region        string `json:"region"`
	OutputDir     string `json:"output_dir"`
	ModelName     string `json:"model_name"`
	AnalyzeOnly   bool   `json:"analyze_only"`
	MultiTenant   bool   `json:"multi_tenant"`
	GenerateTests bool   `json:"generate_tests"`
}

MigrationConfig holds migration configuration

type NewCommandV2 added in v1.0.82

type NewCommandV2 struct{}

NewCommandV2 implements the "lift new" command for Milestone 2+. It scaffolds a new Lift project using embedded templates.

func (*NewCommandV2) Description added in v1.0.82

func (c *NewCommandV2) Description() string

func (*NewCommandV2) Execute added in v1.0.82

func (c *NewCommandV2) Execute(_ context.Context, args []string) error

Execute runs the new command with the provided arguments.

func (*NewCommandV2) Name added in v1.0.82

func (c *NewCommandV2) Name() string

func (*NewCommandV2) Usage added in v1.0.82

func (c *NewCommandV2) Usage() string

type OperationResult added in v1.0.37

type OperationResult struct {
	Operation       string          `json:"operation"`
	Latencies       []time.Duration `json:"-"`
	TotalRequests   int64           `json:"total_requests"`
	SuccessRequests int64           `json:"success_requests"`
	FailedRequests  int64           `json:"failed_requests"`
	AvgLatency      time.Duration   `json:"avg_latency"`
	MinLatency      time.Duration   `json:"min_latency"`
	MaxLatency      time.Duration   `json:"max_latency"`
	P95Latency      time.Duration   `json:"p95_latency"`
	P99Latency      time.Duration   `json:"p99_latency"`
	Throughput      float64         `json:"throughput"`
	ErrorRate       float64         `json:"error_rate"`
}

OperationResult holds results for a specific operation

type PrereqError added in v1.0.82

type PrereqError struct {
	Binary  string
	Message string
}

PrereqError represents a missing prerequisite with actionable remediation.

func (*PrereqError) Error added in v1.0.82

func (e *PrereqError) Error() string

type ScaffoldConfig added in v1.0.37

type ScaffoldConfig struct {
	ModelName     string
	TableName     string
	GSIs          []GSIConfig
	MultiTenant   bool
	EnableTTL     bool
	EnableStreams bool
}

ScaffoldConfig holds the configuration for scaffolding

type StreamSpec added in v1.0.37

type StreamSpec struct {
	ViewType  string `json:"view_type"`
	StreamArn string `json:"stream_arn"`
	Enabled   bool   `json:"enabled"`
}

StreamSpec defines stream specification

type TTLSpec added in v1.0.37

type TTLSpec struct {
	AttributeName string `json:"attribute_name"`
	Enabled       bool   `json:"enabled"`
}

TTLSpec defines TTL specification

type TableAnalysis added in v1.0.37

type TableAnalysis struct {
	CreatedAt              time.Time                `json:"created_at"`
	SortKey                *AttributeSpec           `json:"sort_key,omitempty"`
	TimeToLiveSpec         *TTLSpec                 `json:"time_to_live,omitempty"`
	StreamSpec             *StreamSpec              `json:"stream,omitempty"`
	Attributes             map[string]AttributeSpec `json:"attributes"`
	RecommendedModel       string                   `json:"recommended_model"`
	TableName              string                   `json:"table_name"`
	BillingMode            string                   `json:"billing_mode"`
	MigrationComplexity    string                   `json:"migration_complexity"`
	PartitionKey           AttributeSpec            `json:"partition_key"`
	LocalSecondaryIndexes  []LSIAnalysis            `json:"local_secondary_indexes,omitempty"`
	SampleItems            []map[string]interface{} `json:"sample_items,omitempty"`
	Warnings               []string                 `json:"warnings,omitempty"`
	GlobalSecondaryIndexes []GSIAnalysis            `json:"global_secondary_indexes,omitempty"`
	TableSizeBytes         int64                    `json:"table_size_bytes"`
	ItemCount              int64                    `json:"item_count"`
	MultiTenantCandidate   bool                     `json:"multi_tenant_candidate"`
}

TableAnalysis contains the analysis results of a DynamoDB table

type TemplateData added in v1.0.82

type TemplateData struct {
	AppName    string
	ModuleName string
	BaseDomain string
	EnableData bool
}

TemplateData contains the data passed to templates during rendering.

type TestCommand

type TestCommand struct{}

TestCommand runs tests

func (*TestCommand) Description

func (c *TestCommand) Description() string

func (*TestCommand) Execute

func (c *TestCommand) Execute(_ context.Context, args []string) error

func (*TestCommand) Name

func (c *TestCommand) Name() string

func (*TestCommand) Usage

func (c *TestCommand) Usage() string

type UpCommand added in v1.0.82

type UpCommand struct {
	// contains filtered or unexported fields
}

UpCommand implements the "lift up" command for building and deploying

func (*UpCommand) Description added in v1.0.82

func (c *UpCommand) Description() string

func (*UpCommand) Execute added in v1.0.82

func (c *UpCommand) Execute(ctx context.Context, args []string) error

Execute runs the up command. It: 1. Finds the project root by walking up for lift.yaml 2. Parses the configuration 3. Resolves domains for the requested stage 4. Checks domain lock (prevents domain drift) 5. Builds all functions 6. Deploys stacks in order using CDK 7. Writes the state file on success

func (*UpCommand) Name added in v1.0.82

func (c *UpCommand) Name() string

func (*UpCommand) Usage added in v1.0.82

func (c *UpCommand) Usage() string

type VersionCommand

type VersionCommand struct {
	// contains filtered or unexported fields
}

VersionCommand displays version information

func (*VersionCommand) Description

func (c *VersionCommand) Description() string

func (*VersionCommand) Execute

func (c *VersionCommand) Execute(_ context.Context, _ []string) error

func (*VersionCommand) Name

func (c *VersionCommand) Name() string

func (*VersionCommand) Usage

func (c *VersionCommand) Usage() string

Jump to

Keyboard shortcuts

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