-
Notifications
You must be signed in to change notification settings - Fork 0
Client CLI Guide
Hugo edited this page Mar 15, 2026
·
1 revision
This page explains how to run CoreTrace from the terminal with the current implementation behavior.
cd /Users/hugopayet/Desktop/CLaude/coretrace
mkdir -p build && cd build
cmake .. -DPARSER_TYPE=CLI11 -DUSE_THREAD_SANITIZER=OFF -DUSE_ADDRESS_SANITIZER=OFF
make -j4
./ctrace --help./ctrace --input ../tests/buffer_overflow.cc --static --verbose./ctrace --input ../tests/buffer_overflow.cc --invoke tscancode,flawfinder./ctrace --tool-config ../config/tool-config.json --static./ctrace --ipc serve --serve-host 127.0.0.1 --serve-port 8080 --shutdown-token mytoken-
--static: run the static tool group. -
--dyn: run the dynamic tool group. -
--invoke <csv>: run specific tools.- CLI-recognized values in parser logic:
flawfinder,ikos,cppcheck,tscancode,ctrace_stack_analyzer.
- CLI-recognized values in parser logic:
-
--input <csv>: direct file list. -
--compile-commands <path>: used for file auto-resolution when no--inputis provided. -
--include-compdb-deps: when auto-loading from compile commands, include entries under_depspaths.
--analysis-profile <fast|full>--smt <on|off>--smt-backend <name>--smt-secondary-backend <name>--smt-mode <single|portfolio|cross-check|dual-consensus>--smt-timeout-ms <n>--smt-budget-nodes <n>--smt-rules <csv>--resource-model <path>--escape-model <path>--buffer-model <path>--stack-limit <bytes>--demangle
-
--verbose: enables debug-level logger output. -
--quiet: set in global config; consumed by stack analyzer args. -
--sarif-format: enables SARIF behavior in supported tools. --report-file <path>-
--async: enables parallel scheduling through the internal thread pool. --ipc <standardIO|socket|serve>--ipc-path <path>--serve-host <host>--serve-port <port>--shutdown-token <token>--shutdown-timeout-ms <ms>
CoreTrace can preload analysis settings from a JSON file.
Example:
./ctrace --tool-config ../config/tool-config.json --statictool-config currently supports:
- root
invoke(string or array) - root
input(string or array) -
stack_analyzersection (ortools.ctrace_stack_analyzer) for:-
compile_commands,resource_model,escape_model,buffer_model -
demangle,timing,include_compdb_deps,quiet stack_limit-
analysis-profile/analysis_profile -
smt,smt-backend/smt_backend,smt-secondary-backend/smt_secondary_backend,smt-mode/smt_mode -
smt-timeout-ms/smt_timeout_ms -
smt-budget-nodes/smt_budget_nodes -
smt-rules/smt_rules entry_points
-
CoreTrace resolves inputs in this order:
- Start from
--inputfile entries. - If no
--inputand--compile-commandsis set:- if path is a directory, append
compile_commands.json - if resulting file exists, use it as an input manifest
- if path is a directory, append
- For
.jsoninputs, parse and expand:- array of strings
- array of objects with
file,src_file, orpath(optionaldirectorybase) - object with
files,sources, orcompile_commandsarrays - object with single
file,src_file, orpath
- Resolve relative paths against manifest directory (or per-entry
directorywhen provided). - Normalize paths and deduplicate.
- If the input is an auto-discovered compile commands manifest and
--include-compdb-depsis not set, entries containing_depspath segment are filtered out.
If resolution yields no source files, analysis exits with an error.
./ctrace --ipc serve --serve-host 127.0.0.1 --serve-port 8080 --shutdown-token mytoken --shutdown-timeout-ms 5000In server mode, analysis requests are handled over HTTP (/api). See Client HTTP API Reference.
- Help text mentions
--output-file, but parser registers--output;--output-fileis rejected by CLI parser. -
--outputis parsed but currently not applied to analysis behavior. - Help text does not list
--serve-hostand--serve-port, even though they are supported. - CLI
--invokesilently ignores unknown tool names (only known names are inserted by parser logic). -
cppcheckimplementation uses a hardcoded executable path (/opt/homebrew/bin/cppcheck) and itsname()currently returns"ikos". - Static tool availability and execution paths are environment-dependent (
flawfinder,tscancode,ikos,cppcheckmust be installed/resolvable as expected by the current process launch paths).