gg library

Classes

Gg
The parent command for Gg operations.
GgConsoleCallbacks
Everything gg needs to talk to the user's terminal.
GgDirectoryEntry
One entry of a directory listing.
GgFileSystemCallbacks
Everything gg needs to read and write files.
GgHost
The one place where gg's access to the outside world is configured.
GgHostDirectory
A dart:io Directory served by GgFileSystemCallbacks.
GgHostFile
A dart:io File served by GgFileSystemCallbacks.
GgHostFileStat
A minimal FileStat carrying just the entity type.
GgHostIo
A GgHost that answers every callback with dart:io.
GgHostIoOverrides
Serves dart:io's file system and console APIs from GgFileSystemCallbacks and GgConsoleCallbacks.
GgHostIoSink
An IOSink forwarding everything written to it to a callback.
A dart:io Link served by GgFileSystemCallbacks.
GgHostStdin
A Stdin reading through a GgConsoleCallbacks callback.
GgHostStdout
A Stdout writing through a GgConsoleCallbacks callback.
GgPlatformCallbacks
Everything gg needs to know about the machine and process it runs in.
GgProcessCallbacks
Everything gg needs to run other programs.
GgProcessOutcome
The result of running a process to completion.
GgPromptCallbacks
The interactive prompts gg asks its questions with.
GgPrompts
Asks the user a question on the terminal.
GgStartedProcess
A program that was started and is still running.
ProjectDetector
Detects whether the current directory belongs to a gg workspace or a single project (a Dart/TypeScript project or a plain git repository).

Enums

GgEntityType
What a path points to.
ProjectMode
The mode of the project that gg is invoked in.

Constants

ggVersion → const String
The version of the gg package.
modeIndependentCommandPaths → const Set<String>
Command paths (<command> <subcommand>) that create or bootstrap a workspace and therefore must run outside of one as well.
modeIndependentCommands → const Set<String>
Top-level subcommand names that run independently of the detected project mode and are therefore never guarded.

Functions

checkArgsForProjectMode(List<String> args, ProjectMode detectMode()) List<String>
Checks whether args may run in the detected project mode.
ggProcessResultFrom(GgProcessOutcome outcome) ProcessResult
Turns a GgProcessOutcome into a dart:io ProcessResult.
runGg({required List<String> args, required GgLog ggLog, ProjectMode detectMode()?}) Future<int>
Runs the gg command line with args and returns the exit code.

Exceptions / Errors

GgExitException
Thrown instead of terminating the process when gg calls exit(code) while a GgHost is installed.
GgHostUnsupportedError
Thrown when gg asks the host for something the embedder does not implement.