FsHotWatch.FileCommand 0.3.0-alpha.1

This is a prerelease version of FsHotWatch.FileCommand.
dotnet add package FsHotWatch.FileCommand --version 0.3.0-alpha.1
                    
NuGet\Install-Package FsHotWatch.FileCommand -Version 0.3.0-alpha.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="FsHotWatch.FileCommand" Version="0.3.0-alpha.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="FsHotWatch.FileCommand" Version="0.3.0-alpha.1" />
                    
Directory.Packages.props
<PackageReference Include="FsHotWatch.FileCommand" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add FsHotWatch.FileCommand --version 0.3.0-alpha.1
                    
#r "nuget: FsHotWatch.FileCommand, 0.3.0-alpha.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package FsHotWatch.FileCommand@0.3.0-alpha.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=FsHotWatch.FileCommand&version=0.3.0-alpha.1&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=FsHotWatch.FileCommand&version=0.3.0-alpha.1&prerelease
                    
Install as a Cake Tool

FsHotWatch.FileCommand

Plugin that runs a custom command when files matching a pattern change. Register multiple instances for different file patterns.

Why

Sometimes you want to run a specific command when certain files change -- type-check your .fsx scripts, validate SQL migrations, regenerate code from .proto files, etc. FileCommand lets you do this without writing a full plugin.

How it works

  1. You save a file
  2. FileCommandPlugin checks if the file matches its pattern
  3. If it matches, it runs the configured command
  4. Success/failure is reported to the error ledger

Configuration

In .fs-hot-watch.json:

{
  "fileCommands": [
    {
      "pattern": "*.fsx",
      "command": "dotnet",
      "args": "fsi --typecheck-only"
    },
    {
      "pattern": "*.sql",
      "command": "sqlfluff",
      "args": "lint"
    }
  ]
}
Field Type Default Description
pattern string "*.fsx" File extension pattern to match (e.g. "*.fsx", "*.sql").
command string "echo" Command to run when a matching file changes.
args string "" Arguments to the command.

Each entry in the array creates a separate plugin instance. You can have as many file commands as you want.

CLI

# Check the status of a file command (named by pattern)
fs-hot-watch file-cmd-*.fsx-status

Programmatic usage

From the FullPipelineExample:

// Type-check .fsx scripts when they change
daemon.RegisterHandler(
    FileCommandPlugin.create
        "scripts"                           // plugin name
        (fun f -> f.EndsWith(".fsx"))       // file filter predicate
        "dotnet"                            // command
        "fsi --typecheck-only build.fsx"    // args
        None                                // getCommitId for caching
)

Install

dotnet add package FsHotWatch.FileCommand
Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  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.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.3.0-alpha.1 35 4/8/2026
0.1.0-alpha.1 43 4/3/2026