console

package
v1.7.1 Latest Latest
Warning

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

Go to latest
Published: May 21, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const StatusEvaluating = sdk.Status(10)

Variables

This section is empty.

Functions

func FormatHistoryEntry

func FormatHistoryEntry(entry replEntry) string

FormatHistoryEntry formats a single history entry for display (exported for tests).

func New

func New(svc sdk.Service) sdk.Plugin

New creates a new REPL plugin.

Types

type Plugin

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

Plugin implements the terraform console REPL feature.

func (*Plugin) Activate

func (p *Plugin) Activate() tea.Cmd

Activate is called when the user navigates to this plugin.

func (*Plugin) BinaryPath

func (p *Plugin) BinaryPath() string

func (*Plugin) CapturesKeys

func (p *Plugin) CapturesKeys() bool

CapturesKeys implements sdk.KeyCapturer.

func (*Plugin) Configure

func (p *Plugin) Configure(cfg map[string]interface{}) error

Configure applies plugin-specific options from config.

func (*Plugin) Description

func (p *Plugin) Description() string

func (*Plugin) Dir

func (p *Plugin) Dir() string

func (*Plugin) ErrMsg

func (p *Plugin) ErrMsg() string

func (*Plugin) Evaluate

func (p *Plugin) Evaluate(expr string) tea.Cmd

Evaluate exposes the evaluate method for testing (returns the tea.Cmd).

func (*Plugin) HandleChdirChanged

func (p *Plugin) HandleChdirChanged(evt sdk.ChdirChangedEvent) tea.Cmd

HandleChdirChanged implements sdk.ChdirHandler.

func (*Plugin) Hints

func (p *Plugin) Hints() []sdk.KeyHint

Hints returns context-sensitive key hints for the status bar.

func (*Plugin) History

func (p *Plugin) History() []replEntry

func (*Plugin) HistoryEntry

func (p *Plugin) HistoryEntry(i int) (expr, result, errStr string)

HistoryEntry returns the entry at the given index for testing.

func (*Plugin) HistoryIdx

func (p *Plugin) HistoryIdx() int

func (*Plugin) HistoryLen

func (p *Plugin) HistoryLen() int

HistoryLen returns the number of history entries.

func (*Plugin) ID

func (p *Plugin) ID() string

func (*Plugin) Init

func (p *Plugin) Init(ctx *sdk.Context) tea.Cmd

Init initializes the plugin with shared context.

func (*Plugin) Input

func (p *Plugin) Input() string

func (*Plugin) Name

func (p *Plugin) Name() string

func (*Plugin) PastInputs

func (p *Plugin) PastInputs() []string

func (*Plugin) Ready

func (p *Plugin) Ready() bool

func (*Plugin) SetBinaryPath

func (p *Plugin) SetBinaryPath(path string)

SetBinaryPath allows tests to override the binary path.

func (*Plugin) Status

func (p *Plugin) Status() sdk.Status

func (*Plugin) Update

func (p *Plugin) Update(msg tea.Msg) (sdk.Plugin, tea.Cmd)

Update processes messages and returns the updated plugin.

func (*Plugin) View

func (p *Plugin) View(width, height int) string

View renders the REPL plugin UI.

type ReplResultMsg

type ReplResultMsg struct {
	Expr   string
	Output string
	Err    error
}

ReplResultMsg is sent when an expression evaluation completes.

Jump to

Keyboard shortcuts

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