commands

package
v0.80.1 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package commands provides modular CLI command packages for domain CLIs.

There are two ways to use commands from this package:

1. Via the Commands factory (recommended for most use cases):

commands := commands.New(lggr)
stateCmd, err := commands.State(domain, stateConfig)
if err != nil {
    return err
}
app.AddCommand(stateCmd)

2. Via direct package imports (for advanced DI/testing):

import "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/commands/state"

cmd, err := state.NewCommand(state.Config{
    Logger:    lggr,
    Domain:    domain,
    ViewState: myViewState,
    Deps:      state.Deps{...},  // inject mocks for testing
})
if err != nil {
    return err
}
app.AddCommand(cmd)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Commands

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

Commands provides a factory for creating CLI commands with shared configuration. This allows setting the logger once and reusing it across all commands.

func New

func New(lggr logger.Logger) *Commands

New creates a new Commands factory with the given logger. The logger will be shared across all commands created by this factory.

func (*Commands) AddressBook added in v0.80.1

func (c *Commands) AddressBook(dom domain.Domain) (*cobra.Command, error)

AddressBook creates the address-book command group.

func (*Commands) Datastore added in v0.80.0

func (c *Commands) Datastore(dom domain.Domain) (*cobra.Command, error)

Datastore creates the datastore command group.

func (*Commands) MCMS added in v0.80.1

func (c *Commands) MCMS(dom domain.Domain, cfg MCMSConfig) (*cobra.Command, error)

MCMS creates the mcms command group for proposal analysis and conversion.

func (*Commands) State

func (c *Commands) State(dom domain.Domain, cfg StateConfig) (*cobra.Command, error)

State creates the state command group for managing environment state.

type MCMSConfig added in v0.80.1

type MCMSConfig struct {
	// ProposalContextProvider creates proposal context for analysis.
	// This is domain-specific and must be provided by the user.
	ProposalContextProvider analyzer.ProposalContextProvider
}

MCMSConfig holds configuration for MCMS commands.

type StateConfig

type StateConfig struct {
	// ViewState is the function that generates state from an environment.
	// This is domain-specific and must be provided by the user.
	ViewState state.ViewStateFunc
}

StateConfig holds configuration for state commands.

Directories

Path Synopsis
Package addressbook provides CLI commands for address book management operations.
Package addressbook provides CLI commands for address book management operations.
Package datastore provides CLI commands for datastore management operations.
Package datastore provides CLI commands for datastore management operations.
Package flags provides reusable flag helpers for CLI commands.
Package flags provides reusable flag helpers for CLI commands.
Package state provides CLI commands for state management operations.
Package state provides CLI commands for state management operations.
Package text provides text formatting utilities for CLI commands.
Package text provides text formatting utilities for CLI commands.

Jump to

Keyboard shortcuts

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