cli_tools library

Classes

Analytics
Interface for analytics services.
BetterCommand<O extends OptionDefinition, T>
An extension of Command with additional features.
BetterCommandRunner<O extends OptionDefinition, T>
An extension 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.
CommandDocumentationGenerator
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
MessageOutput
A proxy for user-provided functions for passing specific log messages.
MixPanelAnalytics
Analytics service for MixPanel.
Option
Object that represents an option in a select prompt.
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.flutter-io.cn 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.
CompletionTool
LogLevel
StandardGlobalOption<V extends Object>
TextLogStyle

Properties

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

Functions

confirm(String message, {bool? defaultValue, required Logger logger}) Future<bool>
Prompts the user to confirm an action. Returns true if the user confirms, false otherwise. If defaultValue is provided, the user can skip the prompt by pressing Enter.
input(String message, {String? defaultValue, required Logger logger}) Future<String>
Prompts the user for input. If defaultValue is provided, the user can skip the prompt by pressing Enter.
multiselect(String prompt, {required List<Option> options, required Logger logger}) Future<List<Option>>
Prompts the user to select multiple options from a list of options. If no options are selected the returned list will be empty.
select(String prompt, {required List<Option> options, required Logger logger}) Future<Option>
Prompts the user to select an option from a list of options.

Typedefs

CompletionScript = ({String script, CompletionTool tool})
OnAnalyticsEvent = void Function(String event)
A function type for tracking events.
OnBeforeRunCommand = Future<void> Function(BetterCommandRunner<OptionDefinition, dynamic> runner)
A function type for executing code before running a command.
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 code.
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.