commands

package
v0.77.0 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2026 License: MIT Imports: 4 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)
app.AddCommand(
    commands.State(domain, stateConfig),
    commands.EVM(domain),
    commands.JD(domain),
)

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

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

app.AddCommand(state.NewCommand(state.Config{
    Logger:    lggr,
    Domain:    domain,
    ViewState: myViewState,
    Deps:      &state.Deps{...},  // inject mocks for testing
}))

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) State

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

State creates the state command group for managing environment state.

Usage:

cmds := commands.New(lggr)
rootCmd.AddCommand(cmds.State(domain, commands.StateConfig{
    ViewState: myViewStateFunc,
}))

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 state provides CLI commands for state management operations.
Package state provides CLI commands for state management operations.

Jump to

Keyboard shortcuts

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