Start up and Configuration/tr

Overview
This page shows the different ways to start FreeCAD and the most important configuration features.

Starting FreeCAD from the Command line
FreeCAD can be started normally by double-clicking on its desktop icon or selecting it from the start menu, but it can also be started directly from the command line. This allows you to change some of the default startup options.

Using command line options without a command line shell

 * On Ubuntu you can create a desktop icon and edit its properties. Add the command line options separated by spaces behind the program name in the "Command" field.
 * On Windows create a shortcut and edit the properties. Add the command line options separated by spaces to "Target" field.

Command line options
The command line options are subject to frequent changes.Therefore, it is a good idea to check the current options by typing:

FreeCAD --help

From the response you can read the possible parameters:

Usage: FreeCAD [options] File1 File2 ... Allowed options: Generic options: -v [ --version ]         Prints version string -h [ --help ]            Prints help message -c [ --console ]         Starts in console mode --response-file arg      Can be specified with '@name', too --dump-config            Dumps configuration --get-config arg         Prints the value of the requested configuration key Configuration: -l [ --write-log ]       Writes a log file to: /home/username/.FreeCAD/FreeCAD.log --log-file arg           Unlike --write-log this allows logging to an                               arbitrary file -u [ --user-cfg ] arg    User config file to load/save user settings -s [ --system-cfg ] arg  System config file to load/save system settings -t [ --run-test ] arg    Test case - or 0 for all -M [ --module-path ] arg Additional module paths -P [ --python-path ] arg Additional python paths --single-instance        Allow to run a single instance of the application

In the following table, selected options are described in more detail:

Options can written in two forms: and.

Response and config files
FreeCAD can read some of these options from a config file. This file must be in the bin path and must be named. Be aware that options specified in the command line override the config file!

Some operating systems have a very low limit of characters on the command line. The common way to work around those limitations is using response files. A response file is just a configuration file which uses the same syntax as the command line. If the command line specifies a response file, it's loaded and parsed in addition to the command line:

FreeCAD @ResponseFile.txt

or: FreeCAD --response-file=ResponseFile.txt

or: FreeCAD --response-file ResponseFile.txt

Hidden options
There are a couple of options not visible to the user. These options are e.g. the X-Window parameters parsed by the Windows system:
 * -display - Sets the X display (default is $DISPLAY).
 * -geometry - Sets the client geometry of the first window that is shown.
 * -fn or -font - Defines the application font. The font should be specified using an X logical font description.
 * -bg or -background - Sets the default background color and an application palette (light and dark shades are calculated).
 * -fg or -foreground - Sets the default foreground color.
 * -btn or -button - Sets the default button color.
 * -name - Sets the application name.
 * -title - Sets the application title.
 * -visual - Forces the application to use a TrueColor visual on an 8-bit display.
 * -ncols - Limits the number of colors allocated in the color cube on an 8-bit display, if the application is using the QApplication::ManyColor color   specification. If count is 216 then a 6x6x6 color cube is used (i.e. 6 levels of red, 6 of green, and 6 of blue); for other values, a cube approximately proportional to a 2x3x1 cube is used.
 * -cmap - Causes the application to install a private color map on an 8-bit display.

Running FreeCAD without GUI (headless)
FreeCAD is usually built with two executables: a GUI-capable one called or, and a headless one, called  or. FreeCAD can be used in console mode using the switch (which is the default behavior of ):

FreeCAD --console

In console mode, no graphical user interface will be displayed, and you will be presented with a Python interpreter prompt:. From that prompt, you have the same functionality as the Python interpreter that runs inside the FreeCAD GUI, and access to all modules and plugins of FreeCAD, except the FreeCADGui module. Be aware that modules that depend on FreeCADGui might also be unavailable.

To read more about console or headless mode, refer to Headless FreeCAD.

Running modules, macros and scripts
See Macro at Startup on how to set up a macro to automatically run at FreeCAD startup.

Environment variables
FreeCAD supports the following environment variables, which can be used to configure directories: If the specified path does not exist, the setting is ignored!

The above environment variables are meant to be used to realize a portable FreeCAD environment. For an example how environment variables can be used from the command line on Linux refer to the notes for Linux users on the downloads page.

FreeCAD uses Qt, which does honor the environmental variable. Thus, setting can be used to specify the base directory of Qt-related configuration files.

FreeCad itself does not honor the environmental variable (because it determines the user's home directory from a lower-level system API). Use for this pupose.

The default temporary directory is. The environmental variable can be used to override the default. (Editor: precedence?).

Libraries
Some libraries need to call system environment variables. Sometimes when there is a problem with a FreeCAD installation, it is because some environment variable is absent or incorrect. Therefore, some important variables get duplicated in the Config and saved in the log file.

Python


 * PYTHONPATH
 * PYTHONHOME
 * TCL_LIBRARY
 * TCLLIBPATH

OpenCascade


 * CSF_MDTVFontDirectory
 * CSF_MDTVTexturesDirectory
 * CSF_UnitsDefinition
 * CSF_UnitsLexicon
 * CSF_StandardDefaults
 * CSF_PluginDefaults
 * CSF_LANGUAGE
 * CSF_SHMessage
 * CSF_XCAFDefaults
 * CSF_GraphicShr
 * CSF_IGESDefaults
 * CSF_STEPDefaults

Configuration set
On every startup FreeCAD examines its surrounding and the command line parameters. It builds up a configuration set which holds the essence of the runtime information. This information is later used to determine the place where to save user data or log files. It is also very important for postmortem analyzes. Therefore it is saved in the log file.

User related information
Note: For Linux distributions, an additional configuration file that relates to Qt may exist at path.

Build related information
The table below shows the available information about the Build version. Most of it comes from the Subversion repository. This stuff is needed to exactly rebuild a version!

Branding related
These Config entries are related to the branding mechanism of FreeCAD. See Branding for more details.

Querying the configuration
From FreeCAD's Python console

Entries of the configuration set can be queried with the config var name (see tables above) from the Python console. For example: >>> FreeCAD.ConfigGet("ExeVersion") '0.19' If the name is not found, an empty string is returned.

From command line

Use the option to query a single name. Not all names are supported. For example: FreeCAD --get-config ExeVersion

Use the option to get a list of names and their values. Not all names are supported.

From FreeCAD console

Start FreeCAD in console mode with and query with Python code. For example: $ FreeCAD --console [FreeCAD Console mode ] >>> FreeCAD.ConfigGet("ExeVersion") '0.19' >>> exit

For Linux (bash shell) you can modify the following command line to suit your needs: $ FreeCAD --console <<EOF print( "FREECAD_USER_HOME: " + ( "not set" if ( os.environ.get('FREECAD_USER_HOME') is None ) else os.environ.get('FREECAD_USER_HOME') ) ) print( "UserHomePath: " + FreeCAD.ConfigGet("UserHomePath") ) exit EOF

Linux: Creating an additional start option
The following assumes that your desktop is configured such that you can launch FreeCAD from it. Depending on your Linux distribution and desktop environment, you may have to adapt the following steps:
 * 1) Copy the freedesktop entry file for FreeCAD from  to.
 * 2) Change the name from  to something else (e.g. ).
 * 3) Open the file with a text editor and change how FreeCAD is invoked by modifying the line starting with.
 * 4) As a result, an additional entry in your start menu/application launcher is available. This way, you can have multiple FreeCAD entries with various launch options.

Starting FreeCAD from a portable USB medium
Windows

Put the FreeCAD executable,, on the USB medium. Create a batch file,, and put it into the same directory as. Inside the batch file write:

Or with (see):

With the batch in the root of the USB medium:

Now double-click the batch file to start FreeCAD. (see)