Synopsis
fcli tool fcli register -p=<pathOption> [-v=<requestedVersion>] [[-h] [--env-prefix=<prefix>] [--log-file=<logFile>] [--log-level=<logLevel>] [--log-mask=<level>] [--debug]] [[-o=<type+args>] [--style*=<style>,…]… ] [--to-file=<outputFile>_]]
Description
This command registers an existing tool installation (whether installed through fcli or externally), allowing fcli to reference this tool installation in CI/CD integrations and other contexts.
PATH SEARCH BEHAVIOR: When a single path is provided (no path separator), fcli uses that exact installation without searching other locations. This ensures that when using environment variables like *_HOME, the specific installation is registered. An error is thrown if the tool is not found at that path or if the version doesn’t match the requested version.
When multiple paths are provided (separated by ':' on Unix or ';' on Windows), fcli first checks if a matching version is already registered. If found, that existing installation is re-registered (updating its timestamp to make it the default). Only if no matching registered installation exists will fcli search the provided paths in order.
Examples: --path /opt/fcli/bin --path $FCLI_HOME --path $PATH --path $FCLI_HOME:$PATH
Options
- -p, --path=<pathOption>
-
One or more paths to search for the tool binary, separated by the platform path separator (e.g., ':' on Unix, ';' on Windows, like PATH environment variable). Each path entry can point to tool executable, tool bin directory, or tool installation directory. See command description for details on single vs. multiple path behavior.
- -v, --version=<requestedVersion>
-
Required version or alias. The detected version must match the latest version for the specified alias. For example, if '2' is an alias for version 2.12.3 in tool definitions, the detected version must be exactly 2.12.3. Use '2.1' for 2.1.x latest, or exact version like '2.1.0'. Both 'v' prefix and plain numbers are supported. Default value: any
Output options (also see documentation link below)
- -o, --output=<type+args>
-
Select output type (csv, table, expr, json, xml, yaml) and optional type arguments.
- --store=<var>[:<prop>]
-
Store JSON results in an fcli variable for later reference.
- *--style*=<style>,…
-
Select output style: header, no-header, pretty, no-pretty, flat, no-flat, array, single, border, no-border, md-border, wrap, no-wrap, fast-output, no-fast-output.
- --to-file=<outputFile>
-
Write output to the specified file.
Generic fcli options (also see documentation link below)
- --debug
-
Enable collection of debug logs.
- --env-prefix=<prefix>
-
Prefix for resolving default option values. Default value: FCLI_DEFAULT.
- -h, --help
-
Use 'fcli [command] -h' to display help for fcli (sub-)commands.
- --log-file=<logFile>
-
Write log output to file. Default: ./fcli.log if logging is enabled.
- --log-level=<logLevel>
-
Set logging level: TRACE, DEBUG, INFO, WARN, ERROR, NONE.
- --log-mask=<level>
-
Log mask level: high, medium, low, none. Default: medium. Masking is done on a best-effort basis; no guarantee that all sensitive data will be masked.