The CLI is for local development and testing. For production deployments, use the CDK integration or the library API.
The simplesteps CLI is provided by @simplesteps/core.
simplesteps compile <file-or-tsconfig> [options]
| Flag | Description | Default |
|---|---|---|
-o, --output <dir> |
Write .asl.json files to this directory |
stdout |
--query-language <jsonata|jsonpath> |
ASL query language | jsonata |
--indent <N> |
JSON indentation spaces | 2 |
-v, --verbose |
Verbose output | off |
-h, --help |
Show help |
# Compile a single file, print ASL to stdout
npx simplesteps compile src/workflow.ts
# Compile to a directory
npx simplesteps compile src/workflow.ts -o dist/
# Compile an entire project
npx simplesteps compile tsconfig.json -o dist/
# Custom indentation
npx simplesteps compile src/workflow.ts --indent 4
# Compile with JSONPath instead of JSONata (default)
npx simplesteps compile src/workflow.ts --query-language jsonpathThe CLI auto-detects whether the input is a tsconfig or a source file based on the filename. Files starting with tsconfig are treated as project configs; everything else is treated as a source file.
When using -o, each state machine produces a separate file:
output/
myWorkflow.asl.json
anotherWorkflow.asl.json
The filename is derived from the variable name assigned to Steps.createFunction().
When multiple state machines exist and no -o is specified, each is printed to stdout with a --- name --- separator.
Workflow files typically use declare const placeholders for resource ARNs and names (see Getting Started). The CLI does not provide a mechanism to supply bindings for these variables.
When compiling with the CLI, any declare const variables without bindings are left as literal placeholder strings in the ASL output (e.g., "validateOrderArn" appears as-is in the Resource field). This makes the CLI useful for reviewing the structure of generated state machines, but the output is not directly deployable without replacing the placeholders.
To supply real values for declare const variables, use the CDK integration (via bindings) or the library API (via substitutions).
The following compile options are available via the library API but not the CLI:
sourceMap— Add sourcefile:lineto ASLCommentfields for debuggingversion— Set the ASLVersionfieldtimeoutSeconds— Set global state machine execution timeout
| Code | Meaning |
|---|---|
0 |
Success |
1 |
Compilation errors or no state machines found |