Command-line Client (asp-cli)

asp-cli drives the Analysis Server Protocol from the shell. It reads commands (one per line) and maintains a session: the active connection, the selected workspace and the configured environment persist between commands, so a full analysis is expressed as a short command script.

Commands

Command

Description

Usage

connect

Connect to a server

connect <address>

disconnect

Disconnect from a server

disconnect

list

List workspaces on the server

list

workspace_create

Create a workspace

workspace_create

workspace_set

Select the active workspace

workspace_set <id>

workspace_add_file

Add a file to the active workspace

workspace_add_file <path>

workspace_destroy

Destroy a workspace

workspace_destroy <id>

env

Configure the analysis environment

env <property> <value>

analysis_start

Start an analysis

analysis_start

analysis_set

Select the active analysis

analysis_set <id>

analysis_wait

Wait for the analysis to finish

analysis_wait

analysis_result

Fetch and print the analysis result

analysis_result

analysis_stop

Stop a running analysis

analysis_stop

quiet

Suppress further informational output

quiet

The connect address accepts the same forms as the C API: an nng URL (tcp://host:port) or a plain host:port IP address. env configures the compiler, language, CPU and target OS used for the workspace (mirroring asp_env_set_compiler(), asp_env_set_language(), asp_env_set_cpu() and asp_env_set_runtime_os()).

Example session

connect tcp://127.0.0.1:5500
workspace_create
env compiler gcc
env language c
workspace_add_file analyzed.c
analysis_start
analysis_wait
analysis_result
disconnect

Each command maps onto the corresponding connection call documented in the Connection API section of the API reference.