F# Interactive Options

This topic describes the command-line options supported by F# Interactive, fsi.exe. F# Interactive accepts many of the same command line options as the F# compiler, but also accepts some additional options.

Using F# Interactive for Scripting

F# Interactive, fsi.exe, can be launched interactively, or it can be launched from the command line to run a script. The command line syntax is

fsi.exe [options] [script-file [arguments] ]

The file extension for F# script files is fsx.

Table of F# Interactive Options

The following table summarizes the options supported by F# Interactive. You can set these options on the command-line or through the Visual Studio IDE. To set these options in the Visual Studio IDE, open the Tools menu, select Options..., then expand the F# Tools node and select F# Interactive.

Where lists appear in F# Interactive option arguments, list elements are separated by semicolons (;).

Option

Description

--

Used to instruct F# Interactive to treat remaining arguments as command line arguments to the F# program or script, which you can access in code by using the list fsi.CommandLineArgs.

--checked[+|-]

Same as the fsc.exe compiler option. For more information, see Compiler Options (F#).

--codepage:<int>

Same as the fsc.exe compiler option. For more information, see Compiler Options (F#).

--crossoptimize[+|-]

Enable or disable cross-module optimizations.

--debug[+|-]

--debug:[full|pdbonly]

-g[+|-]

-g:[full|pdbonly]

Same as the fsc.exe compiler option. For more information, see Compiler Options (F#).

--define:<string>

Same as the fsc.exe compiler option. For more information, see Compiler Options (F#).

--exec

Instructs F# interactive to exit after loading the files or running the script file given on the command line.

--fullpaths

Same as the fsc.exe compiler option. For more information, see Compiler Options (F#).

--gui[+|-]

Enables or disables the Windows Forms event loop. The default is enabled.

--help

-?

Used to display the command line syntax and a brief description of each option.

--lib:<folder-list>

-I:<folder-list>

Same as the fsc.exe compiler option. For more information, see Compiler Options (F#).

--load:<filename>

Compiles the given source code at startup and loads the compiled F# constructs into the session. If the target source contains scripting directives such as #use or #load, then you must use --use or #use instead of --load or #load.

--mlcompatibility

Same as the fsc.exe compiler option. For more information, see Compiler Options (F#).

--noframework

Same as the fsc.exe compiler option. For more information, see Compiler Options (F#)

--nologo

Same as the fsc.exe compiler option. For more information, see Compiler Options (F#).

--nowarn:<warning-list>

Same as the fsc.exe compiler option. For more information, see Compiler Options (F#).

--optimize[+|-]

Same as the fsc.exe compiler option. For more information, see Compiler Options (F#).

--quiet

Suppress F# Interactive's output to the stdout stream.

--readline[+|-]

Enable or disable tab completion in interactive mode.

--reference:<filename>

-r:<filename>

Same as the fsc.exe compiler option. For more information, see Compiler Options (F#).

--tailcalls[+|-]

Enable or disable the use of the tail IL instruction, which causes the stack frame to be reused for tail recursive functions. This option is enabled by default.

--use:<filename>

Tells the interpreter to use the given file on startup as initial input.

--utf8output

Same as the fsc.exe compiler option. For more information, see Compiler Options (F#).

--warn:<warning-level>

Same as the fsc.exe compiler option. For more information, see Compiler Options (F#).

--warnaserror[+|-]

Same as the fsc.exe compiler option. For more information, see Compiler Options (F#).

--warnaserror[+|-]:<int-list>

Same as the fsc.exe compiler option. For more information, see Compiler Options (F#).

Title

Description

Compiler Options (F#)

Describes command line options available for the F# compiler, fsc.exe.