Command

A type that represents a command, run locally or remotely.

Command.swift:5Command.md
protocol Command : Hashable, Identifiable, Sendable
Browse conforming types

Overview

Conform to the Command protocol to provide the logic for the Formic engine to invoke a command effecting a remote host or service.

The engine calls run(host:logger:) to invoke the command, providing a Host instance that presents the host to the logic for executing the command. The engine may provide a Logger instance, to allow the command to log messages, typically to the console when invoked from a command-line interface. Log output at debug or trace log levels within your command. Throw errors to indicate unavoidable error conditions, and report failure conditions by including the relevant information into CommandOutput that you return from this method.

Inspecting Commands

Invoking Commands