cli

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2026 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Version = "dev"
	Commit  = unknownValue
	BuiltAt = unknownValue
)
View Source
var ErrCompletionEmpty = errors.New("completion: nothing to complete")

ErrCompletionEmpty is reserved for future dynamic completions that may return nothing. Kept for API stability.

View Source
var SupportedShells = []string{"bash", "zsh", "pwsh", "powershell"}

SupportedShells lists the shells for which completion scripts exist.

Functions

func Completion

func Completion(shell string, w io.Writer) error

Completion writes a completion script for the named shell to w.

func EnsureHarness

func EnsureHarness(reqs []require.Requirement, flowPath ...string) (string, error)

EnsureHarness builds or reuses a runner binary linked with exactly the external modules declared by reqs.

func ExecHarness

func ExecHarness(bin string, args []string) int

func Print

func Print(w interface{ Write([]byte) (int, error) })

Print writes a multi-line build summary to w.

func PrintCommandHelp

func PrintCommandHelp(w io.Writer, command string) bool

func PrintTopHelp

func PrintTopHelp(w io.Writer)

func Run

func Run(args []string) int

Run is the central CLI dispatcher.

func RunEmbedded

func RunEmbedded(ctx context.Context, source string, args []string) int

func RunEmbeddedWithBundles

func RunEmbeddedWithBundles(ctx context.Context, source string, args []string, bundles []core.Bundle) int

func RunPath

func RunPath(ctx context.Context, args []string) int

func RunWithBundles

func RunWithBundles(args []string, bundles []core.Bundle) int

func SelfBuild

func SelfBuild(ctx context.Context) error

SelfBuild rebuilds the running nexssflow binary in place, injecting VCS metadata from the source directory. It replaces the manual `go install` step for developers who want consistent version output.

func SourceRequires

func SourceRequires(path string) ([]require.Requirement, error)

Types

type ASTNode added in v0.14.0

type ASTNode struct {
	Kind string `json:"kind"`

	Name string         `json:"name,omitempty"`
	Args map[string]any `json:"args,omitempty"`

	Raw       string `json:"raw,omitempty"`
	Condition string `json:"condition,omitempty"`
	Message   string `json:"message,omitempty"`
	Until     string `json:"until,omitempty"`

	L        *ASTNode   `json:"l,omitempty"`
	R        *ASTNode   `json:"r,omitempty"`
	Cond     *ASTNode   `json:"cond,omitempty"`
	Then     *ASTNode   `json:"then,omitempty"`
	Else     *ASTNode   `json:"else,omitempty"`
	Body     *ASTNode   `json:"body,omitempty"`
	Branches []*ASTNode `json:"branches,omitempty"`
}

ASTNode is the machine-readable form of one AST node. Fields are populated selectively based on Kind:

Atom          — Name, Args
Pipe          — L, R
Parallel      — Branches
Fallback      — L, R
Conditional   — Cond, Then, Else
Projection    — Raw
Loop          — Body, Until
Assert        — Condition, Message

A consumer that switches on Kind only reads the fields the Kind documents. Unknown kinds carry only Kind, which is the extension point: a future AST node type adds a new Kind string and its own fields without breaking existing consumers.

type ASTPipeline added in v0.14.0

type ASTPipeline struct {
	Name string   `json:"name"`
	Body *ASTNode `json:"body"`
}

ASTPipeline is one named pipeline definition.

type ASTReport added in v0.14.0

type ASTReport struct {
	Path      string        `json:"path"`
	TopLevel  *ASTNode      `json:"top_level,omitempty"`
	Pipelines []ASTPipeline `json:"pipelines,omitempty"`
}

ASTReport is the top-level JSON envelope. TopLevel is omitted when the file contains only @pipeline definitions.

type LintIssue

type LintIssue struct {
	File    string `json:"file"`
	Line    int    `json:"line,omitempty"`
	Kind    string `json:"kind"`
	Message string `json:"message"`
}

LintIssue is one problem found in a .nflow source. The shape is stable — the CLI prints it as JSON so tooling and editors can consume it. File is always a real path (never a synthetic label).

type Step

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

Step is one in-flight build step. Exactly one terminal method should be called; further calls are ignored.

func (*Step) Done

func (s *Step) Done()

Done finishes the step with no suffix.

func (*Step) DoneTimed

func (s *Step) DoneTimed()

DoneTimed finishes the step and appends the elapsed wall clock.

func (*Step) Fail

func (s *Step) Fail(err error)

Fail finishes the step with a red error marker.

type StepLogger

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

StepLogger prints numbered build steps. In an interactive terminal it animates a spinner while a step is running. When stdout is redirected to a file or a pipe, the spinner is disabled so CI logs stay clean.

func NewStepLogger

func NewStepLogger(w io.Writer, total int) *StepLogger

NewStepLogger returns a logger that will print at most total steps.

func (*StepLogger) Start

func (l *StepLogger) Start(label, detail string) *Step

Start begins a step. In a TTY it launches the spinner goroutine.

Directories

Path Synopsis
Package selftest runs the Nexss Flow self-test suite: a feature-by- feature check of every registered bundle, run in-process against the binary's own compiler and runtime.
Package selftest runs the Nexss Flow self-test suite: a feature-by- feature check of every registered bundle, run in-process against the binary's own compiler and runtime.

Jump to

Keyboard shortcuts

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