gocfl / ocfl / extensions
In this part of the workshop, we will familiarize ourselves with the basic operation and configuration options of the gocfl tool. We assume that the installation has been successfully completed.
To ensure you are working with the expected version, use:
gocfl --version
If the command is not found, ensure that your GOBIN directory (typically $HOME/go/bin or %USERPROFILE%\go\bin) is included in your PATH environment variable.
A line with the desired version should appear here. e.g., gocfl version v2.0.6-beta45 (0001-01-01T00:00:00Z) go2.26.2
gocfl features a mechanism for automatic detection of installed tools (such as ImageMagick, Ghostscript, ffmpeg, and Tika).
--autoconfigThe global flag --autoconfig can be used with any gocfl command. It instructs the program to search for installed software on the system and automatically adjust the internal configuration for the current call. In particular, the submodules Indexer (NNNN-indexer) and Thumbnail Generation (NNNN-thumbnail) are preconfigured according to the tools found.
gocfl --autoconfig [command] ...
initconfig commandTo avoid having to specify --autoconfig with every call, the automatically detected (and optionally customized) configuration can be permanently saved:
gocfl --autoconfig initconfig
This command creates a standard configuration in $HOME/gocfl, which is required for the following steps in the workshop. The results of the automatic tool detection are written into the configuration file.
Paths and the scope of the configuration can optionally be customized using parameters:
--toml: Path to the TOML configuration file.--extension-folder: Directory for extension templates.--script-folder: Directory for extension scripts.--fullconfig: Writes the complete configuration including all default values to the file. Without this parameter, only the detected adjustments and deviations are saved.Example for a complete configuration:
gocfl --autoconfig initconfig --fullconfig
Example with customized paths:
gocfl --autoconfig initconfig --toml ./myconfig.toml --extension-folder ./extensions --script-folder ./scripts
gocfl follows a typical command-line pattern with subcommands. The general syntax is:
gocfl [global flags] <command> [command flags] <arguments>
Important global flags include:
-v, --verbose: Increases the detail of the output.-l, --log: Enables writing logs to a file.The tool offers a comprehensive built-in help. This is the best way to explore the available options:
Shows all available main commands (e.g., init, add, update, extract, validate):
gocfl --help
Each subcommand has its own help page explaining specific flags and arguments:
gocfl init --help
gocfl add --help
gocfl offers flexible configuration options to support both simple ad-hoc calls and complex workflows.
For recurring settings, a configuration file (in TOML format) can be used. By default, gocfl searches for its configuration in the directory $HOME/gocfl.
The path $HOME corresponds to:
%USERPROFILE% (usually C:\Users\Username)/Users/Username/home/UsernameA specific file can be specified with the global --config flag:
gocfl --config myconfig.toml [command]
The configuration file is used not only for storing simple default values (like S3 connections or log levels) but is especially essential for complex submodule settings. Many of these deep configurations are intentionally not available as command-line parameters to keep the command line clear.
Examples of such submodules are:
For a detailed overview of the individual sections and possibilities of the configuration file, see the page Detailed Configuration (gocfl.toml).
If no path is specified, gocfl uses internal default values (embedded config).
If settings are defined in multiple places, the following priority applies:
GOCFL_S3_ENDPOINT).| Back to Installation | Back to Table of Contents | Next Topic: Initializing a Storage Root |