cli_tools library

Classes

Analytics
Interface for analytics services.
BetterCommand
BetterCommandRunner
A custom implementation of CommandRunner with additional features.
BetterCommandRunnerAnalyticsEvents
Constants for the command runner analytics events.
BetterCommandRunnerFlags
Constants for the command runner flags.
BoxLogType
Box style console formatting. If title is set the box will have a title row.
LocalStorageManager
An abstract class that provides methods for storing, fetching and removing json files from local storage.
Logger
Serverpods internal logger interface. All logging output should go through this interface. The purpose is to simplify implementing and switching out concrete logger implementations.
LogType
MixPanelAnalytics
Analytics service for MixPanel.
PackageVersion
A class that provides methods to fetch, store and validate the latest package version with reasonable caching.
PackageVersionConstants
Constants for the package version.
PackageVersionData
A class that holds the package version and the validity time that can be stored and retrieved from a local storage.
PubApiClient
A client for the pub.dev API.
RawLogType
Does not apply any formatting to the log before logging. Assumes log is formatted with end line symbol.
StdOutLogger
Logger that logs using the Stdout library. Errors and Warnings are printed on stderr and other messages are logged on stdout.
TextLogType
Abstract style console formatting. Enables more precise settings for log message.
VoidLogger
Logger that logs no output.

Enums

AnsiStyle
Standard ANSI escape code for customizing terminal text output.
CommandRunnerLogLevel
An enum for the command runner log levels.
ExitCodeType
LogLevel
TextLogStyle

Properties

ansiSupported bool
Returns true if the terminal supports ANSI escape codes.
no setter

Typedefs

OnAnalyticsEvent = void Function(String event)
A function type for tracking events.
OnBeforeRunCommand = Future<void> Function(BetterCommandRunner runner)
A function type for executing code before running a command.
PassMessage = void Function(String message)
A function type for passing log messages.
SetLogLevel = void Function({String? commandName, required CommandRunnerLogLevel parsedLogLevel})
A function type for setting the log level. The logLevel is the log level to set. The commandName is the name of the command if custom rules for log levels are needed.

Exceptions / Errors

CreateException
An exception that is thrown when an error occurs during file creation.
DeleteException
An exception that is thrown when an error occurs during file deletion.
DeserializationException
An exception that is thrown when an error occurs during deserialization.
ExitException
An exception that can be thrown to exit the command with a specific exit
ReadException
An exception that is thrown when an error occurs during file reading.
SerializationException
An exception that is thrown when an error occurs during serialization.
UnsupportedPlatformException
An exception that is thrown when the platform is not supported.
VersionFetchException
An exception that is thrown when an error occurs during fetching the latest version.
VersionParseException
An exception that is thrown when an error occurs during parsing the version.
WriteException
An exception that is thrown when an error occurs during file writing.