Verify.Cli 1.0.392

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet tool install --global Verify.Cli --version 1.0.392
                    
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest
                    
if you are setting up this repo
dotnet tool install --local Verify.Cli --version 1.0.392
                    
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=Verify.Cli&version=1.0.392
                    
nuke :add-package Verify.Cli --version 1.0.392
                    

Verify.Cli

.NET NuGet Status

A command-line tool that uses the Verify library for regular files (without requiring you to create a unit test project).

Installation

Install as .NET global tool

dotnet tool install -g Verify.Cli

Once installed, invoke directly via the verify command.

Usage

If you run this tool interactively, then you'll get a similar experience that you would using VerifyTests in a .NET unit test project. Verify.Cli will utilise any existing compatible file diff tool to display the diff.

verify --file <path to file to verify> [--verified-dir <directory>]

The first time you use Verify.Cli, it will output the contents of the file.

Options

  • --file or -f: The file to verify (required)
  • --verified-dir or -d: Directory to store/look for .verified files (optional)
  • --scrub-inline-datetime: Format for inline date times to scrub, e.g., 'yyyy-MM-ddTHH:mm:ss.fffZ' (optional)
  • --scrub-inline-pattern: Regex pattern to match inline strings for scrubbing, e.g., '"/astro/[^"]+"|(?<prefix>")/_astro/[^"]+(?<suffix>")' (optional)

Examples

Basic usage:

verify --file C:\tmp\example.txt

With custom verified files directory:

verify --file C:\tmp\example.txt --verified-dir C:\MyVerifiedFiles

This will look for the verified file at C:\MyVerifiedFiles\example.txt.verified.txt instead of the default location next to the source file.

With date time scrubbing:

verify --file C:\tmp\log.txt --scrub-inline-datetime "yyyy-MM-ddTHH:mm:ss.fffZ"

This will scrub inline date times matching the specified format from the file content before verification.

With pattern scrubbing:

verify --file C:\tmp\output.html --scrub-inline-pattern "\"/astro/[^\"]+\""

This will scrub inline strings matching the regex pattern (e.g., dynamic asset paths like "/astro/chunk-123.js") from the file content before verification.

With pattern scrubbing using named groups to preserve parts:

verify --file C:\tmp\output.html --scrub-inline-pattern "(?<prefix>\")/_astro/[^\"]+(?<suffix>\")"

This will replace the dynamic part while preserving the prefix and suffix (e.g., "/_astro/chunk-123.js" becomes the preserved prefix and suffix).

You can combine options:

verify --file C:\tmp\log.txt --verified-dir C:\MyVerifiedFiles --scrub-inline-datetime "yyyy-MM-dd HH:mm:ss" --scrub-inline-pattern "id=\"[^\"]+\""

When the files match, the tool exits with code 0 and produces no output.

Unhandled exception: VerifyException: Directory: C:\tmp
New:
  - Received: example.txt.received.txt
    Verified: example.txt.verified.txt

FileContent:

New:

Received: example.txt.received.txt
This is
a text file.

Your diff tool of choice (if found by the Verify's DiffEngine library) can then be used to compare to the verified file (if it exists), or create it (if the first time).

If the verified file matches the received file, then there is no output (and the exit code is zero).

If the received file is different from the verified file, then a diff will be shown in the console, a non-zero exit code will be returned, and if in an interactive environment with a supported diff tool, then that tool will be launched.

Unhandled exception: VerifyException: Directory: C:\tmp
NotEqual:
  - Received: example.txt.received.txt
    Verified: example.txt.verified.txt

FileContent:

NotEqual:

Received: example.txt.received.txt
This is
an updated text file.

Verified: example.txt.verified.txt
This is
a text file.

Example with Beyond Compare launched:

Screenshot of using Beyond Compare to see differences in files

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last Updated
1.0.411 235 8/10/2025
1.0.401 123 7/27/2025
1.0.396 89 7/27/2025
1.0.394 96 7/27/2025
1.0.392 240 7/26/2025
1.0.380 190 7/20/2025
1.0.374 193 7/20/2025
1.0.372 190 7/20/2025
1.0.334 98 3/22/2025
1.0.328 85 3/22/2025
1.0.298 116 1/12/2025
1.0.296 108 1/12/2025