cli library
Local 127.0.0.1 review sync HTTP server, multi-framework source-line
locator, and embeddable CLI commands for coding-agent feedback workflows.
Classes
- ReviewClearCommand
-
Removes resolved (or
--all) review comments from the store without creating a review directory in a clean workspace. - ReviewCommand
-
Reusable
reviewcommand (Command<int>) that can be mounted inside any hostCommandRunner(for example,dart run dash_site review ...). - ReviewComment
- A single visual review comment anchored to a rendered page and source file.
- ReviewCommentsCliRunner
-
Standalone
review_commentsCLICommandRunnerexposingserve,list,prompt,resolve, andclear. - ReviewCommentStore
-
Manages atomic persistence of
<reviewDirectoryName>/comments.jsonand<reviewDirectoryName>/feedback.mdinside a repository root. - ReviewExecutionContext
-
Shared execution context for review CLI commands, supporting both top-level
review_comments <cmd>execution and embedded<host> review <cmd>subcommands. - ReviewListCommand
- Lists open, resolved, or all local visual review comments.
- ReviewLocalServer
-
Local HTTP server bound strictly to
127.0.0.1that syncs browser visual review highlights and comments with<reviewDirectoryName>/comments.jsonand<reviewDirectoryName>/feedback.md. - ReviewProjectConfig
-
Project-level configuration for
review_comments_clistorage, prompts, and source file resolution. - ReviewPromptCommand
- Prints a structured coding-agent prompt containing open visual review comments.
- ReviewResolveCommand
-
Marks one or more review comments (or
--all) resolved and updatesfeedback.md. - ReviewServeCommand
-
CLI subcommand that starts ReviewLocalServer standalone or wraps a child
dev server command (
review_comments serve -- flutter run -d chrome). - ReviewSiteConfig
- Site-specific directory configuration for multi-site workspaces.
Constants
-
defaultAutoSourceRoots
→ const List<
String> - Candidate source directories auto-discovered when ReviewProjectConfig.sourceRoots is not explicitly set.
- defaultCliResolveCommand → const String
-
Default CLI resolve command shown in generated
feedback.mdinstructions. - defaultReviewConfigFileName → const String
- Default configuration file name checked in a repository root.
- defaultReviewDirectoryName → const String
- Default repository-relative directory storing local visual review files.
- defaultReviewServerPort → const int
-
Default loopback port tried first by
ReviewLocalServer.
Functions
-
buildWrappedDevCommandArgs(
List< String> rawCommand, {required int serverPort, String? site}) → ({List<String> arguments, String executable}) -
Builds child process executable and argument list for
review_comments serve -- <cmd...>, automatically injecting--dart-define=REVIEW_COMMENTS_MODE=localand--dart-define=REVIEW_COMMENTS_SERVER_PORT=<port>when wrappingflutterorjasprdev/build commands. -
computeCommentCounts(
Iterable< ReviewComment> comments) → Map<String, int> -
Computes open, resolved, and total counts for
comments. -
extractCodeSnippet(
List< String> rawLines, int startLine, int endLine) → String -
Extracts up to a 3-line (or capped multi-line) snippet surrounding
1-based
startLine..endLine. -
locateHighlightInRepo(
{required String repoRoot, String site = '', String? sourceFile, int? startLine, int? endLine, String? selectedText, String? elementText, String? headingAnchor, String? selector, String? pageUrl, ReviewProjectConfig? config}) → SourceLocationResult -
Resolves a highlighted text quote, Flutter widget inspector location,
element text, heading anchor, or
flutter:<WidgetClass>selector back to its repository-relative source file and 1-based line range. -
normalizeReviewPageUrl(
String rawUrl) → String -
Normalizes a page URL path so
/ui/layout/,/ui/layout, and/ui/layout/index.htmlcompare equal when filtering comments. -
normalizeSourcePathInput(
String repoRoot, String? rawPath, {String? canonicalRoot}) → String? -
Normalizes a raw
sourceFilepath—includingfile://URIs insiderepoRoot,package:<pkg>/<path>URIs,org-dartlang-app:///URIs, or repository-relative paths—into a clean POSIX path strictly confined withinrepoRoot. -
runReviewCommentsCli(
List< String> arguments) → Future<Never> -
Runs the
review_commentscommand-line interface and exits with the resulting status code. -
sanitizeRepoRelativePath(
String repoRoot, String? rawPath, {String? canonicalRoot}) → String? -
Canonicalizes
rawPathrelative torepoRootand verifies it stays strictly insiderepoRoot(including resolving symlinks along its path).
Typedefs
- ReviewStore = ReviewCommentStore
-
Alias for ReviewCommentStore for compatibility with callers such as
dash_site. - SourceLocationResult = ({String? codeSnippet, int? endLine, String resolvedFile, int? startLine})
- Resolved repository file path, 1-based line range, and surrounding snippet for a highlighted selection, widget, or element on a rendered page.