The Olympix CLI is a tool that performs code analysis, unit and mutation tests generation on projects written in Solidity. By using this feature, Solidity developers can find potentially dangerous vulnerabilities in their smart contracts.
You can download the latest version of the CLI tool using the links below:
analyze
: Perform code analysis.generate-unit-tests
: Generate unit tests.generate-mutation-tests
: Generate mutation tests.login
: Request access and log in to your account.help
: Get help and usage information.show-vulnerabilities
: Show the vulnerability types that the analyzer aims to find.version
: Show cli version.-w | --workspace-path
: Defines the root project directory path. It is important to know the project context to provide more accurate vulnerabilities analysis. The default is the current directory.
-p | --path
: Defines the Solidity project directory path to be analyzed. It can be used multiple times to include each project analysis directory. The default is the 'contracts' and 'src' directories if they exist, otherwise it is the same directory path of workspace.
-f | --output-format
: Defines result output format. The supported currently formats are:
tree
, json
, sarif
and email
. The default is tree.
-o | --output-path
: Defines result output directory path (Enabled only for json
and sarif
formats). The default is showing result to terminal.
--no-<vulnerability id>
: Defines the vulnerabilities that may be ignored. It can be used multiple times to ignore each vulnerability type. The default ignores nothing.
-w | --workspace-path
: Defines the root project directory path. The default is the current directory.
-ca | --confirm-all
: Confirm as 'yes' for all the questions.
-w | --workspace-path
: Defines the root project directory path. The default is the current directory.
--p | --path
: Defines the Solidity file path to run the mutation tests. It can be used multiple times to include each file.
To use the CLI, open your terminal and enter one of the following commands:
.\olympix.exe login [-e | --email <user email>]
.\olympix.exe analyze [-w | --workspace-path <workspace directory>] [-p | --path <directory path>] [-f | --output-format <output format>] [-o | --output-path <output directory path>] [--no-<vulnerability id>]
.\olympix.exe generate-unit-tests [-w | --workspace-path <workspace directory>] [-ca | --confirm-all]
.\olympix.exe generate-mutation-tests [-w | --workspace-path <workspace directory>] [-p | --path <directory path>]
analyze
command with project workspace directory path, specifically analyzing files in the 'smart_contracts' and 'sample_contracts' directories, and writing result to directory output path in json format:
.\olympix.exe analyze -w C:\project -p C:\project\smart_contracts -p C:\project\sample_contracts -f json -o C:\project\result
analyze
command with the project workspace directory path, specifically analyzing files in the 'src' and 'contracts' directories by default (if these directories do not exist, it will get all the Solidity files of the workspace directory), ignoring
uninitialized state variable
and default visibility
vulnerabilities, and showing
result to the terminal:
.\olympix.exe analyze -w C:\project --no-uninitialized-state-variable --no-default-visibility
generate-unit-tests
command with project workspace directory path:
.\olympix.exe generate-unit-tests -w C:\project
generate-mutation-tests
command with project workspace directory path, specifically for 'contracts\Sample.sol', 'contracts\Example.sol' and 'contracts\Contract.sol' Solidity files:
.\olympix.exe generate-mutation-tests -w C:\project -p contracts\Sample.sol -p contracts\Example.sol -p contracts\Contract.sol
If you have any question, feedback, or need help, feel free to contact us at contact@olympix.ai