Skip to content

CLI Reference

The effect-analyze CLI analyzes Effect TypeScript files and produces diagrams, metrics, and reports.

Terminal window
effect-analyze [path] [options]

When path is a file, the analyzer processes that file. When it is a directory, it processes all TypeScript files within it. Multiple paths can be provided for diff mode.

FlagDescriptionDefault
-f, --format <format>Output format (see All Formats)auto
-o, --output <file>Write output to a file instead of stdoutstdout
--prettyPretty-print output (overrides --compact)on
--compactCompact output (no indentation)off
--no-colorDisable colored terminal outputcolor on
--quietSuppress verbose status messagesoff
--tsconfig <path>Path to a custom tsconfig.jsonauto-detected
--include-trivialInclude trivial programs (schemas, thin wrappers) that are excluded by defaultoff
--no-metadataExclude analysis metadata from JSON outputoff
-h, --helpPrint help and exit-
FlagDescriptionDefault
--direction <dir>Mermaid flow direction: TB, LR, BT, RLTB
--style-guideApply style-guide heuristics for cleaner, more readable diagramsoff
--no-style-guideExplicitly disable style-guide mode-
FlagDescription
--diffCompare two program versions (see Semantic Diff)
--regressionFlag removed steps as regressions (use with --diff)
--watchRe-analyze when the file changes
--cacheCache analysis results in watch mode to skip unchanged files
--coverage-auditRun a project-wide coverage audit (see Coverage Audit)
--migrationAlias for --format migration
FlagDescriptionDefault
--colocateWrite .effect-analysis.md next to each source fileoff
--no-colocatePrint a summary to stdout instead of writing files-
--colocate-suffix <suffix>Custom suffix for colocated fileseffect-analysis
--service-mapShow a deduplicated service registry across the projecton
--no-service-mapDisable the project-wide service map-
--no-colocate-enhancedUse standard Mermaid instead of enhanced format for colocated files-

These flags are used with --coverage-audit:

FlagDescription
--show-suspicious-zerosShow files with no Effect programs that look suspicious
--show-top-unknownShow files with the highest unknown node rates
--show-top-unknown-reasonsInclude reasons for unknown nodes
--show-by-folderAggregate results by folder
--json-summaryOutput audit results as JSON
--per-file-timingInclude per-file timing data
--min-meaningful-nodes <n>Minimum node count to consider a file meaningful
--known-effect-internals-root <path>Treat local paths as Effect-like
--exclude-from-suspicious-zero <pattern>Exclude patterns from suspicious-zero reporting
FlagDescription
--qualityCompute diagram quality metrics for each program
--quality-eslint <path>Load diagram quality hints from an ESLint JSON file
FlagDescription
--export <name>Export name of the HttpApi (with --format openapi-runtime)

auto mermaid mermaid-railway mermaid-paths mermaid-enhanced mermaid-services mermaid-errors mermaid-decisions mermaid-causes mermaid-concurrency mermaid-timeline mermaid-layers mermaid-retry mermaid-testability mermaid-dataflow

json stats explain summary matrix showcase

api-docs openapi-paths openapi-runtime

migration

Terminal window
effect-analyze src/transfer.ts

Generate a railway diagram and save to file

Section titled “Generate a railway diagram and save to file”
Terminal window
effect-analyze src/transfer.ts -f mermaid-railway -o transfer.md
Terminal window
effect-analyze src/ --colocate
Terminal window
effect-analyze src/ --coverage-audit --json-summary
Terminal window
effect-analyze src/transfer.ts --diff
Terminal window
effect-analyze main:src/transfer.ts feature:src/transfer.ts --diff
Terminal window
effect-analyze HEAD:src/transfer.ts src/transfer.ts --diff --regression
Terminal window
effect-analyze src/transfer.ts --watch --cache
Terminal window
effect-analyze src/ --format migration
Terminal window
effect-analyze src/transfer.ts --format stats
Terminal window
effect-analyze src/transfer.ts --format explain
Terminal window
effect-analyze src/transfer.ts --format mermaid --direction LR --style-guide
Terminal window
effect-analyze src/ --service-map
Terminal window
effect-analyze src/api.ts --format openapi-runtime --export MyApi -o openapi.json