Package
ConsoleKit
💻 APIs for creating interactive CLI tools.
Overview
ConsoleKit provides utilities for interacting with a console in a Swift application. It provides:
Utilities for sending text (including styles and colors, when supported) to a terminal.
Utilities for reading input from a terminal.
Topics
Terminal
ConsoleProtocol for powering styled Console I/O.TerminalGeneric console that uses a mixture of Swift and C standard libraries to fulfill protocol requirements.ConsoleColorSupported colors for creating aConsoleStyleforConsoleText.ConsoleStyleRepresentation of a style for outputting to a Console in different colors with differing attributes. A few suggested default styles are provided.ConsoleClearSupported methods for clearing theConsole.ConsoleTextA collection ofConsoleTextFragments. Represents stylized text that can be outputted to aConsole.ConsoleTextFragment+(_:_:)Appends aConsoleTextto anotherConsoleText.+=(_:_:)Appends aConsoleTextto anotherConsoleTextin-place.StringProtocol
Activity
ActivityIndicatorAn instance of aActivityIndicatorTypethat can be started, failed, and succeeded.ActivityIndicatorTypeActivityIndicatorTypes are responsible for drawing / rendering the currentActivityIndicatorStateto theConsole.ActivityIndicatorStatePossible states to draw / render andActivityIndicatorType.ActivityBarAnActivityIndicatorTypethat renders an activity bar on a single line.LoadingBarLoading-style implementation ofActivityBar.ProgressBarProgress-style implementation ofActivityBar.CustomActivityAn activity indicator with customizable frames and success and failure messages.
Structures
AnySendableHashableASendableversion of the standard library’sAnyHashabletype.