A lightweight F# library for executing CLI commands using computation expression syntax with no external dependencies.
Fli is an F# library that allows developers to execute CLI commands and shell scripts directly from F# code using a computation expression syntax. It simplifies process invocation, output handling, and error management, turning command-line interactions into type-safe, composable operations. It solves the problem of awkwardly integrating shell commands into F# applications by providing a fluent, idiomatic API.
F# developers who need to automate CLI tasks, run build scripts, or integrate external tools into their applications. It's particularly useful for those writing build automation, deployment scripts, or tools that wrap command-line utilities.
Developers choose Fli because it offers a clean, functional approach to CLI execution that feels native to F#, with no external dependencies. Its computation expression syntax makes commands readable and maintainable, while features like output redirection and error assertions cater to real-world scripting needs.
Execute CLI commands from your F# code in F# style!
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
The computation expression builder (`cli { ... }`) allows CLI commands to be written in a natural, readable style that integrates seamlessly with F# code, as shown in examples like git commit workflows.
Output can be redirected to files, streams, StringBuilder, or custom functions, enabling versatile logging and data capture, demonstrated in the README with file streams and custom log functions.
As a pure .NET library, Fli adds minimal overhead and avoids dependency conflicts, making it easy to integrate into existing F# projects without additional package management.
Supports detailed configuration including working directories, environment variables, window styles, and timeouts, enabling precise control over CLI executions as outlined in the builder operations table.
Full credential support with domain and password is Windows-only, reducing functionality on Linux or macOS, as noted in the README's credential section with alternatives like Username.
Executing files without assigned programs can throw System.NullReferenceException, as mentioned in the file opening example, which might lead to unhandled exceptions in production code.
Requires familiarity with F# computation expressions, which could be a barrier for developers new to functional programming or those accustomed to imperative .NET languages.