Header menu logo FSharp.Formatting

Command line

To use F# Formatting tools via the command line, you can use the fsdocs dotnet tool.

dotnet tool install fsdocs-tool
dotnet fsdocs [command] [options]

The build command

This command processes a docs directory and generates API docs for projects in the solution according to the rules of API doc generation. The input accepted is described in content.

fsdocs build

The command line options accepted are:

Command Line Option



Input directory of content (default: docs)


Project files to build API docs for outputs, defaults to all packable projects


Output Directory (default 'output' for 'build' and 'tmp/watch' for 'watch')


Disable generation of API docs


Disable project cracking


Evaluate F# fragments in scripts


Save images referenced in docs


Don't add line numbers, default is to add line number.


Additional substitution parameters for templates


The tool will also generate documentation for non-public members


Do not copy default content styles, javascript or use default templates


Clean the output directory


Display this help screen


Display version information


Provide properties to dotnet msbuild, e.g. --properties Configuration=Release Version=3.4


Additional arguments passed down as otherflags to the F# compiler when the API is being generated.
Note that these arguments are trimmed, this is to overcome a limitation in the command line argument processing.
A typical use-case would be to pass an addition assembly reference.
Example --fscoptions " -r:MyAssembly.dll"


Fail if docs are missing or can't be generated

The following command line options are also accepted but it is instead recommended you use settings in your .fsproj project files:

Command Line Option



Source folder at time of component build (<FsDocsSourceFolder>)


Source repository for github links (<FsDocsSourceRepository>)


Assume comments in F# code are markdown (<UsesMarkdownComments>)

The command will report on any .fsproj files that it finds, telling you if it decides to skip a particular file and why.

For example, a project will be skipped if:

The watch command

This command does the same as fsdocs build but in "watch" mode, waiting for changes. Only the files in the input directory (e.g. docs) are watched. A browser will be launched automatically (unless --nolaunch is specified).

You will need to ensure that the input directory exists, and contains at least index.md, otherwise the browser will report an error (e.g. "Problem loading...", "Connection was reset").

fsdocs watch

Restarting may be necesssary on changes to project files. The same parameters are accepted, plus these:

Command Line Option



Do not serve content when watching.


Do not launch a browser window.


URL extension to launch http://localhost:/%s.


Port to serve content for http://localhost serving.

Searchable docs

When using the command-line tool a Fuse search index is automatically generated in index.json. A search box is included in the default template via an HTML Dialog element.
To add search to your own _template.html:

<button id="search-btn">Open search dialog</button>
    <input type="search" placeholder="Search docs" />
    <div class="results">
        <p class="empty">Type something to start searching.</p>
<script type="module" src="{`{root}}content/fsdocs-search.js"></script>

Type something to start searching.