Command Line Interface
You can download the SAFE CLI from the Download SAFE CLI page.
The CLI setup will generate 2 files which allows SAFE to run in your CI/CD:
- A fingerprint file that uniquely identifies the project without containing any sensitive information. To generate a correct fingerprint file, please makes sure to compile your codebase. Please send this file to safe@erlang-solutions.com to help generate the License for the project.
- A config.json which is generated in you repository under the
.safefolder. Please make sure to commit it.
The CLI operates entirely offline and never transmits any data from the machine on which it runs.
safe setup Command
You should first compile your codebase with the debug_info flag.
In case of a Rebar3 or Mix project (Elixir), this option is enabled by default.
If you have a mix project please compile it in your target environemtn (prod, dev..) and run the following command:
./safe setup --name NAME
--root ROOT
--path _build/prod/lib
--app APP1
--app APP2
For Rebar:
./safe setup --name NAME
--root ROOT
--path _build/default/lib
--app APP1
--app APP2
Usage
safe setup --name NAME --root ROOT --app APP
[--app APP ...] [--path PATH ...]
[--config-output CONFIG_OUTPUT]
[--fingerprint-output FINGERPRINT_OUTPUT]
Arguments
Required:
-
--name NAME
The name of your project. Used as an identifier in SAFE config. -
--root ROOT
The root directory of your project. Can be absolute or relative. -
--app APP(repeatable)
At least one Erlang app name to analyze.
Use multiple--appflags to include more apps.
Optional:
-
--path PATH(repeatable)
Additional directories to search for apps.
Defaults to.if not specified.
Must be relative to the path given in--root. Useful for_build,apps/, or custom lib folders. -
--config-output CONFIG_OUTPUT
Custom path for the generatedconfig.json.
If not set, defaults to<ROOT>/.safe/config.json.
Relative paths are resolved from--root. -
--fingerprint-output FINGERPRINT_OUTPUT
Where to writefingerprint.json.
Defaults tofingerprint.jsonin the current working directory.
Relative paths are resolved from the working directory.
Examples
Multiple apps, including a _build path:
safe setup --name myproject --root ~/my_project --app foo --app bar --path _build/dev/lib
Custom config output path:
safe setup --name myproject --root ~/my_project --app foo --config-output ./myconfig.json
Absolute config path:
safe setup --name myproject --root ~/my_project --app foo --config-output /tmp/config.json
Generate fingerprint file in desktop:
safe setup --name myproject --root ~/my_project --app foo --fingerprint-output ~/Desktop/fingerprint.json
- You must provide at least one
--appor the command will fail. --pathhelps in finding your compiled application (e.g._build/dev/lib,apps/, etc).
Once the setup is complete and you have generated a fingerprint file, please send it via email to safe@erlang-solutions.com. In your message, specify whether you would like to proceed with a monthly or yearly license.