rps library

Run Project Scripts — a script runner for Dart and Flutter projects.

Classes

BorderCharacters
Characters used to draw box borders in the console.
CommandExecuted
An execution event representing a concrete command to run.
CommandReferenced
An execution event representing a reference to another script (via rps).
Console
A StringSink wrapper that adds bordered output and ANSI utilities.
Context
Represents a node in the script resolution tree.
ExecutionEvent
Base class for all script execution events.
HookExecuted
An execution event representing a hook ($before / $after) being triggered.
PositionalArgument
A positional argument placeholder parsed from a command string.
Pubspec
A ScriptsSource that reads scripts from pubspec.yaml.
RpsYaml
A script source implementation that loads scripts from the rps.yaml file.
RunCommand
The run command that executes a script defined in pubspec.yaml.
ScriptsParser
Parses and resolves scripts from a ScriptsSource.
ScriptsSource
Interface for providing scripts data to the parser.

Enums

Alignment
Text alignment within a fixed-width column.

Functions

blue(String text) → String
Wraps text in blue ANSI escape codes.
bold(String text) → String
Wraps text in bold ANSI escape codes.
boldBlue(String text) → String
Returns bold blue text.
boldGreen(String text) → String
Returns bold green text.
boldRed(String text) → String
Returns bold red text.
execute(String command, {bool verbose = false, Interpreter? interpreter, StringSink? out}) → Future<int>
Executes a shell command via the platform-specific native library.
gray(String text) → String
Wraps text in gray ANSI escape codes.
green(String text) → String
Wraps text in green ANSI escape codes.
lightBlue(String text) → String
Wraps text in light blue ANSI escape codes.
red(String text) → String
Wraps text in red ANSI escape codes.
removeAnsiEscapeSequences(String input) → String
Strips ANSI escape sequences from input.
violet(String text) → String
Wraps text in violet ANSI escape codes.
white(String text) → String
Wraps text in white ANSI escape codes.
yellow(String text) → String
Wraps text in yellow ANSI escape codes.

Typedefs

Execute = int Function(Pointer<Utf8> command, Pointer<Utf8>? interpreter)
Dart-side FFI signature for the execute function.
ExecuteFunction = Future<int> Function(String command)
Callback type for functions that execute a shell command.
ExecuteNative = Int32 Function(Pointer<Utf8> command, Pointer<Utf8>? interpreter)
Native FFI signature for the execute function.

Exceptions / Errors

RpsException
General-purpose exception for rps errors.
ScriptParserException
Exception thrown when the script parser encounters an error.