Reference manual

Objects page

Command-line interface

StaticalPrismCmd.exe is Prism for AL's command-line tool. You use it to run reports in a script or a build pipeline, to show and install a license, to inspect and clear the package cache, to open a workspace in Prism for AL, and to run the MCP server for AI agents without a Prism window.

The Prism for AL MSIX package registers StaticalPrismCmd.exe as an execution alias, so it runs from any command prompt or script, whatever PATH holds, and always runs the installed version.

CommandWhat it does
reportAnalyzes a workspace and saves a report: solution metrics, object dependencies, unreferenced objects, OnPrem usages or parse errors.
licenseShows the license status.
license installInstalls a license key, or removes the installed one, and shows the resulting status.
package-cacheLists and clears the package cache. Needs no workspace.
openOpens a workspace in Prism for AL, starting Prism for AL when it is not running.
mcp-server-httpRuns an MCP server over HTTP for a workspace. Alias mcp-server.
mcp-server-stdioRuns an MCP server over standard input and output, for an agent that starts the server itself.

The reports and the MCP server need a license or a trial license. Without one, Prism for AL runs with limited features: report lists no reports, and the MCP server commands stop with exit code -32.

Help and workspaces

Put -h after the tool for a list of commands and the exit codes, or after a command for that command's help:

StaticalPrismCmd.exe -h
StaticalPrismCmd.exe report -h
StaticalPrismCmd.exe report onprem-usages -h
OptionEffect
-h, --help, -?Shows help for the tool or for the command it follows.
--versionPrints the version of the tool.

The tool prints the Prism logo, the license profile and its version first. It leaves them out when it runs an MCP server and when package-cache writes JSON, so that output stays clean for the program that reads it.

The report, open and MCP server commands take a workspace argument, in any of these forms:

  • A folder that holds AL source and an app.json, or several such modules.
  • A Visual Studio Code workspace file (.code-workspace).
  • An AL package file (.app).

A path that does not exist stops the command with Workspace not found and exit code 1. An option goes after the command it belongs to.

Report command

report builds the workspace symbol index, prints any parse errors it found, and saves one report. The report goes after report, and the workspace after the report:

StaticalPrismCmd.exe report <report> <workspace> [options]

Every report takes these options:

OptionDefaultEffect
--output-file, -o The report's name and a time stamp, in the current folder The file to save the report to. The tool prints its full path when it is done.
--strict, -s Off Fails the run when a file does not parse (exit code -20) or when the code graph has translation errors (exit code -21), after printing the errors. Without it, the tool prints the parse errors and saves the report anyway.
--log-file, -lf No log Writes a log to this file. It starts a new file at about 5 MB and keeps the last 6 files.
--log-level, -ll Information The lowest level written to the log: Verbose, Debug, Information, Warning, Error or Fatal.

In a build pipeline, add --strict so that a workspace that does not parse fails the build, and --log-file so that a failed run leaves a log to read. The same reports run from the Reports page in a workspace window.

Solution metrics report

solution-metrics saves an Excel workbook (.xlsx) with object counts by type for each app, and a list of every object.

StaticalPrismCmd.exe report solution-metrics "C:\workspace\LearnPrism" -o "C:\reports\learn\solution-metrics.xlsx"

Object dependencies report

object-dependencies saves a tab-separated file of the objects each object depends on, with the kind of dependency.

StaticalPrismCmd.exe report object-dependencies "C:\workspace\LearnPrism" -o "C:\reports\learn\object-dependencies.csv"

Unreferenced objects report

unreferenced-objects saves a tab-separated list of the objects that no other object references.

StaticalPrismCmd.exe report unreferenced-objects "C:\workspace\LearnPrism" -o "C:\reports\learn\unreferenced-objects.csv"

OnPrem usages report

onprem-usages builds a full Code graph and saves a tab-separated list of the code that uses procedures and objects scoped to OnPrem. It takes longer than the other reports, because of the code graph.

StaticalPrismCmd.exe report onprem-usages "C:\workspace\LearnPrism" -o "C:\reports\learn\onprem-usages.csv" --log-file "C:\reports\learn\onprem-usages.log" --strict

Only one code graph builds at a time on a machine. When another one holds the graph folder, the report stops with “Graph server temporary directory is already in use. Please try again, …”; run it again a moment later.

Parse errors report

parse-errors saves a text file (.txt) of the files that failed to parse, with each error.

StaticalPrismCmd.exe report parse-errors "C:\workspace\LearnPrism" -o "C:\reports\learn\parse-errors.txt"

License command

license shows the license status of Prism for AL on this machine. It takes no arguments or options and always exits with 0.

StaticalPrismCmd.exe license

It prints one line per fact:

LineShows
ProfileThe license profile Prism for AL runs with.
StatusUnlicensed (followed by a Reason line), Licensed or Invalid.
Licensed to, Company, EmailWhom the license is for. Only with an installed key.
Expires, Trial, ExpiredThe expiry date (yyyy-MM-dd), and yes or no for a trial license and for an expired key. Only with an installed key.
Not valid on this machineyes when the key belongs to another machine. Only then.
License hash, Fallback reasonA fingerprint of the installed key and, for a key that is not valid, the reason. Prism for AL then runs with limited features.
Machine codeThe code that identifies this machine to a license.
License fileThe license file the tool read.

License install command

license install saves a license key, checks it, and prints the resulting status as license does. It saves the key where the Activate license window does, and a running Prism for AL picks it up without a restart.

Argument or optionEffect
keyThe license key itself. Leave it out when you use --key-file or --stdin.
--key-fileReads the key from this file. An empty file removes the installed license.
--stdinReads the key from standard input.

Give the key exactly once: as the argument, with --key-file or with --stdin. In a script, use one of the two options, so the key does not appear on a command line.

StaticalPrismCmd.exe license install --key-file "C:\keys\prism-for-al.txt"
Exit codeMeaning
0The key is installed and valid, or the license was removed (the output starts with License removed.).
-33The key was rejected. Standard error says why: “License key rejected: …”, “License key has expired (…).”, “License key is not valid on this machine (machine code: …).” or “License key is not valid.”
-1No key or more than one source was given, the key file could not be read, standard input was empty, the key could not be saved, or the license could not be removed. Standard error says which.

The License file line names the file the key went to. When Prism for AL does not see a key you installed, compare that line with the license file Prism for AL reads.

Package cache command

package-cache inspects and clears the package cache that Prism for AL, its MCP servers and StaticalPrismCmd.exe share. It needs no workspace and no license, so it works when a license has lapsed and the disk is full. The Package cache page shows the same cache in Prism for AL.

StaticalPrismCmd.exe package-cache list
StaticalPrismCmd.exe package-cache clear --publisher Microsoft --dry-run

package-cache list shows a table of the cached packages: Publisher, Name, Version, Size, State (ready, extracting, failed, stopped or initial) and Pins, the number of holders using the package, with (peer) for those in other processes. A last line gives the count, the total size and the cache folder. package-cache clear deletes the selected packages that nothing is using, and prints an outcome per package and a summary.

OptionCommandsEffect
--packagelist, clearSelects a package by its cache key. Repeat it for several packages.
--publisherlist, clearSelects by publisher.
--namelist, clearSelects by package name.
--versionlist, clearSelects by version.
--module-idlist, clearSelects by module id (a GUID).
--pinnedlistLists only the packages in use.
--verboselistAdds a Held by column naming what uses each package; JSON output also gets each package's cache key.
--allclearSelects every cached package. Required to clear the whole cache, and not together with a selector.
--dry-runclearReports what would be deleted, and deletes nothing.
--yes, -yclearDeletes without asking. Required when no one can answer the question, as in a script or a pipeline.
--formatlist, cleartext (the default) or json. With json, standard output carries the JSON document and nothing else.
--output-file, -olistAlso writes the listing as JSON to this file.
--package-cache-path, -clist, clearWorks on the cache in this folder instead of your shared Prism for AL cache.

Selectors match exactly, ignoring case, and several selectors narrow the selection together. clear needs a selector or --all, so a mistyped selector never empties the cache. Before it deletes, it asks “Delete N package(s) from the cache?”; without a console to ask on, it stops with “Refusing to delete N package(s) without confirmation. Re-run with --yes.”

OutcomeMeaning
removedThe package was deleted.
wouldRemove--dry-run only: the package would be deleted.
skippedPinnedA workspace is using the package; the line names what holds it.
skippedExtractingThe package is being extracted.
notFoundAnother process removed the package first.
failedThe package could not be deleted.
Exit codeMeaning
0Done, including a dry run and a selection that matched nothing (“No packages matched the selection.”).
-40clear removed some of the selected packages, but skipped others that are in use or being extracted.
-41clear was not confirmed.
-1A package could not be deleted, or the cache could not be read.

Open command

open opens a workspace in Prism for AL. When Prism for AL is running, the tool uses that instance; otherwise it starts Prism for AL and waits for it. A workspace that is already open is not opened again.

StaticalPrismCmd.exe open "C:\workspace\LearnPrism"
Argument or optionEffect
workspaceThe workspace to open.
--file, -fAn AL file in the workspace: Prism for AL goes to the object in it.
--offset, -sA character position in that file: Prism for AL goes to the declaration there.
--prism-exe, -xThe StaticalPrism.exe to start when Prism for AL is not running. By default, the installed one.

When the tool cannot reach Prism for AL, it prints “Unable to connect to Prism For AL GUI process.” and exits with -1.

MCP server commands

mcp-server-http runs an MCP server over HTTP, at http://localhost:<port>, for a workspace without a Prism window. mcp-server-stdio runs one that talks over its standard input and output: you do not run it yourself, but put it in an agent's MCP configuration, and the agent starts it. How to choose between them and connect a client is in Start the server.

StaticalPrismCmd.exe mcp-server-http "C:\workspace\LearnPrism" --port-search 47821..47920
StaticalPrismCmd.exe mcp-server-stdio "C:\workspace\LearnPrism"
OptionDefaultEffect
--port, -p47821mcp-server-http only. The port to listen on, from 1 to 65535. Not together with --port-search.
--port-search Not used mcp-server-http only. Takes the first free port in a range: N..M, N.. (up to 65535) or a single port N, such as 47821..47920. The server prints the port it selected. Not together with --port.
--log-file, -lf mcp-server.log (HTTP) or mcp-server-stdio.log (stdio) in %LOCALAPPDATA%\Statical\PrismAL The log file. It starts a new file at about 5 MB and keeps the last 6 files.
--log-level, -llInformationThe lowest level written to the log, as for the reports.
--package-cache-path, -cYour shared Prism for AL cacheThe package cache folder to use.
--no-validate-input-schemas Off Stops checking tool arguments against their schema. Use it only for a client that sends fields a tool does not declare; without the check, a call whose parameters match nothing runs with every parameter at its default.

The server starts at once and builds the symbol index and the code graph in the background; a tool that needs them rejects calls until they are ready. The HTTP server prints “MCP server is running on http://localhost:47821”; press Ctrl+C to stop it. The stdio server writes its messages to standard error, never to standard output, and stops when its standard input closes.

Exit codeMeaning
0The server stopped normally.
-30mcp-server-http: the port is in use, or no port in the --port-search range is free. The message names the program that holds a port when Prism for AL can tell: “Port 47821 is unavailable (…). Held by … (pid …).”
-31mcp-server-http: standard input and output are both redirected, which means an MCP client tried to start the HTTP server as a stdio server. The message explains how to use mcp-server-stdio instead.
-32The license does not include the MCP server. Run StaticalPrismCmd.exe license for the status.
-10The workspace is not a folder, a .code-workspace file or an .app file.
-1An invalid option value, such as both port options, or a server that failed to start.

Exit codes

Every command ends with one of these exit codes, which StaticalPrismCmd.exe -h also lists:

CodeMeaningCommands
0OK.All
1The command line could not be parsed: an unknown command or option, a missing argument, or a workspace that does not exist.All
-1An error. Standard error says what went wrong.All but license
-10Unrecognized workspace type.report, MCP server commands
-11Unsupported workspace type. Listed in the help; no command returns it.None
-20A file did not parse, with --strict.report
-21The code graph has translation errors, with --strict.report
-30The MCP server's port is unavailable.mcp-server-http
-31Redirected standard input and output, which the HTTP server does not support.mcp-server-http
-32The license does not include the feature.MCP server commands
-33The license key was rejected: invalid, expired, or not valid on this machine.license install
-40The clear removed some, but not all, of the selected packages.package-cache clear
-41The clear was not confirmed.package-cache clear