Skip to content

CLI reference

Everything ships in one package:

bash
npm install --save-dev @suss/cli
suss init [<directory>] [--plain]
suss extract [-p <tsconfig> | --dir <directory>] [--lang typescript|python|ruby] [-f <pack>[=<config.json>] ...] [-o <output.json>] [--files <f1> <f2> ...] [--gaps strict|permissive|silent]
suss inspect [<summaries.json> | --dir <directory>]
suss inspect --diff <before.json> <after.json>
suss inspect --flow "<METHOD> <url>" [<summaries.json> | --dir <directory>] [--entry <name>] [--scope <document>] [--json]
suss check [--dir <directory>] [--intent <intent-dir>] [--all] [--json] [-o <output>]
suss check <provider.json> <consumer.json> [--all] [--json] [-o <output>]
suss check [--dir <directory>] --at <file[:line] | boundary | summary-id> [--json]
suss ask "<question>" [--dir <directory> | <summaries.json>] [--all] [--json]
suss contract --from <source> <spec> [-o <output.json>]
suss corroborate --experimental [-p <tsconfig> | --dir <directory>] [-f <pack> ...] [-o <output.json>]
suss infer stub <package> [-p <tsconfig> | --dir <directory>] [-o <file | ->]
suss infer intent --from <summaries.json | directory> [-o <directory> | --into <directory>]
suss infer prd --from <intent-directory> [-o <directory> | --into <directory>]
suss --version

In a synopsis, <...> marks a required value and [...] an optional one.

Commands

CommandReadsWrites
suss initpackage.json, schemas and deploy templates on diskThe commands to run, and suss.json if you accept it
suss extractTypeScript, Python or Ruby source, through the packs you nameSummary JSON
suss contractOne of ten declared sources: an OpenAPI document, a deploy template, a database schema, and so onSummary JSON, the same structure extract writes
suss checkSummary files, and optionally a folder of intent docsFindings, as text or JSON
suss inspectA summary file, a folder of them, or two of themText for a person, or JSON under --diff and --flow
suss askSummary files, and the source for a why questionOne answer, as text or JSON
suss corroborate (experimental)Source, through the express or fastify packsSummaries annotated with what execution said
suss inferObserved calls, summaries, or curated intent docsA YAML draft for you to finish

extract, inspect and check run with no arguments at all. Each one reads suss.json, or picks the packs init would pick when there is no file, and prints the commands it ran to stderr.

The summary JSON is the artifact every other command works from. inspect renders it and check compares two of them, so anything either one reports is also there in the JSON for you to read yourself. Two commands compute an answer that isn't in any file. inspect --flow walks the routing a set of summaries declares, and suss ask takes a question about one boundary and works out the answer from the summaries.

Top-level flags

FlagWhat it does
-h, --helpPrint the usage above and exit 0. Running suss with no command, or any command with --help, prints the same thing.
-v, --versionPrint the installed version and exit 0.

Environment variables

An interactive run ends with one line on stderr when a newer suss is on the registry. You never get that line when the output is piped, and two variables turn it off everywhere.

VariableEffect
NO_COLORSet it to anything and output is plain text with no ANSI colour.
TERM=dumbThe same. Colour is also off whenever stdout is not a TTY, so a piped or redirected run is plain without you asking.
CISet it to anything and the update notice is off. suss init detects CI separately and prints its commands rather than prompting, the same as --plain.
SUSS_NO_UPDATE_NOTICESet it to anything and the update notice is off.

Where output goes

StreamWhat arrives there
stdoutSummary JSON from extract and contract, the report from inspect, check and ask, and the JSON those write under --json
stderr"Wrote N summaries to PATH", extraction warnings, the commands a no-argument run chose, error messages

A run without -o puts nothing but JSON on stdout, so suss extract ... | jq works. -o PATH moves that JSON into the file; extract and contract then write one acknowledgement line to stderr.

Exit codes lists what every command returns to the shell.

Released under the Apache-2.0 License.