Since .NET 5.0, dotnet fsi ships with dependency manager plugins support that can be called like so:
#r "myextension: my extension parameters"The initial RFC for this feature overviews how it is designed.
The current implementation follows pattern that can be deducted by refering to implementation in DependencyProvider.fs; due to the system working without having a staticically linked dependency, it uses a late binding approach leveraging runtime reflection to identify if an extension conforms to patterns understood by the specifics of the compiler implementation.
#r "nuget:" nuget
Reference nuget packages, ships by default with dotnet fsi.
#r "nuget: Newtonsoft.Json"
// Optionally, specify a version explicitly
// #r "nuget: Newtonsoft.Json,11.0.1"
open Newtonsoft.Json
let o = {| X = 2; Y = "Hello" |}
printfn "%s" (JsonConvert.SerializeObject o)#r "paket:" paket
Reference dependencies (nuget, git, gist, github) through Paket package manager.
Learn how to use Paket FSI integration.
#r "paket: nuget FSharp.Data"
open FSharp.Data
type MyCsv = CsvProvider<"""
X,Y
2,Hello
4,World
""">
for r in MyCsv.GetSample().Rows do
printfn "%i = %s" r.X r.Y