FsHotWatch.FileCommand
0.3.0-alpha.1
dotnet add package FsHotWatch.FileCommand --version 0.3.0-alpha.1
NuGet\Install-Package FsHotWatch.FileCommand -Version 0.3.0-alpha.1
<PackageReference Include="FsHotWatch.FileCommand" Version="0.3.0-alpha.1" />
<PackageVersion Include="FsHotWatch.FileCommand" Version="0.3.0-alpha.1" />
<PackageReference Include="FsHotWatch.FileCommand" />
paket add FsHotWatch.FileCommand --version 0.3.0-alpha.1
#r "nuget: FsHotWatch.FileCommand, 0.3.0-alpha.1"
#:package FsHotWatch.FileCommand@0.3.0-alpha.1
#addin nuget:?package=FsHotWatch.FileCommand&version=0.3.0-alpha.1&prerelease
#tool nuget:?package=FsHotWatch.FileCommand&version=0.3.0-alpha.1&prerelease
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
- You save a file
- FileCommandPlugin checks if the file matches its pattern
- If it matches, it runs the configured command
- 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 | Versions 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. |
-
net10.0
- FSharp.Core (>= 10.1.201)
- FsHotWatch (>= 0.3.0-alpha.1)
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 |