Skip to content

CLI Reference

The effect-analyze CLI analyzes Effect TypeScript files and produces diagrams, metrics, lint findings, health reports, and prioritized improvement plans.

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

Run deterministic source-level lints. See Source Linter for the full rule list and workflow.

FlagDescription
--lint-sourceRun deterministic source lints on a file or directory
--sarifEmit SARIF 2.1.0 output
--scorecardEmit a per-file lint scorecard
--baseline <file>Compare findings against a baseline session/JSON file
--fail-on-newExit non-zero when new findings exist vs baseline
--require-suppression-reasonRequire a reason after effect-lint-disable-next-line comments
--fail-on-stale-suppressionsExit non-zero when suppression comments are stale
--bundle-output <dir>Write deterministic artifact bundle (diagnostics, SARIF, summary, rules, session)
--profile <name>Rule profile: strict, ci, migration, docs

Project-wide analyzers that surface structural issues. See Health Analyzers.

FlagDescription
--error-channelGeneric errors, unhandled types, missing catchTag handlers
--service-healthUnsatisfied services, dead services, layer inefficiencies
--performanceSequential-could-parallel, unbounded concurrency, N+1, large gen blocks, missing batching, unbounded retries, forEach without concurrency
--couplingPer-file fan-in / fan-out metrics, hub detection, annotation-aware suppression
--coupling-transitiveWith --coupling: walk re-exports so importers of a barrel also count toward the barrel’s source modules
--coupling-priority <map>Override agent-report priorities per coupling issue type (e.g. critical-fanin=P0)
--tsconfig <path>Read compilerOptions.paths / baseUrl for path-alias resolution (used by --coupling and project-mode commands)

All four health analyzers support --format json for scripting and --output <path> to write to a file. See the Coupling Analyzer reference for the full coupling option surface.

Inspect the surface and dependency shape of an Effect app. See App-Shape Analyzers.

FlagDescription
--entry-pointsDetect NodeRuntime / BunRuntime / Layer.launch / runFork entry points (single file)
--config-leaksFlag Config.redacted / Config.secret values that flow into logs or console sinks (single file)
--cli-commandsExtract @effect/cli Command/Args/Options/Prompt structure (single file)
--service-cyclesDetect cycles in the project-wide service dependency graph (directory)

Prioritized, agent-ready improvement plans with optional auto-fixing. See Improve Mode.

FlagDescription
--agent-reportGenerate a prioritized improvement backlog (JSON + Markdown) optimized for coding agents
--improveApply automated fixes for fixable lint issues
--improve-dry-runPreview fixes without applying (default for --improve)
--improve-max-fixes <n>Limit number of fixes to apply
--improve-rule <rule>Only apply fixes for this rule (repeatable)
--improve-exclude-rule <rule>Exclude fixes for this rule (repeatable)
--improve-min-priority <P>Minimum priority level to include: P0, P1, P2, P3

Inspect and search the deterministic rule registry (source lints, effect-lints, strict diagnostics).

FlagDescription
--list-rulesPrint the full rule registry as a docs table
--index-rulesPrint searchable rule index entries
--search-rules <query>Search rules by code, title, description, or example
--explain-rule <code>Show one rule in detail (description, docs URL, Bad/Good examples)
FlagDescription
--testWrite a {programName}.test.ts stub next to each source file
--test-runner <runner>Test runner: vitest (default), jest, mocha
--test-overwriteOverwrite existing test files instead of skipping
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
--max-files <n>Analyze at most n files (cursor-window mode for huge repos)unlimited
--cursor <n>Start from nth file in sorted file list (resumable window)0

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 heuristic diagram readability metrics for each program
--quality-eslint <path>Ingest ESLint JSON for optional quality hints
FlagDescription
--export <name>Export name of the HttpApi (with --format openapi-runtime)

For reproducible CI runs, the analyzer can export and re-import a full session envelope (inputs, options, results metadata).

FlagDescription
--export-session <file>Export CLI session envelope
--import-session <file>Import and print a previously exported envelope

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

Source lints with SARIF output for code-scanning

Section titled “Source lints with SARIF output for code-scanning”
Terminal window
effect-analyze src/ --lint-source --sarif -o findings.sarif
Terminal window
effect-analyze src/ --lint-source --baseline ./.cache/effect-lint-baseline.json --fail-on-new
Terminal window
effect-analyze --explain-rule runSync-on-async
Terminal window
effect-analyze src/ --agent-report -o backlog.md
Terminal window
effect-analyze src/ --improve --improve-dry-run
effect-analyze src/ --improve --improve-min-priority P1 --improve-max-fixes 20
Terminal window
effect-analyze src/ --error-channel --service-health --performance --format json

Detect entry points and config leaks in an app

Section titled “Detect entry points and config leaks in an app”
Terminal window
effect-analyze src/main.ts --entry-points
effect-analyze src/main.ts --config-leaks
Terminal window
effect-analyze src/ --service-cycles --format json
Terminal window
effect-analyze main:src/transfer.ts feature:src/transfer.ts --diff
Terminal window
effect-analyze src/transfer.ts --watch --cache
Terminal window
effect-analyze src/transfer.ts --format explain
Terminal window
effect-analyze src/ --test --test-runner vitest
Terminal window
effect-analyze src/api.ts --format openapi-runtime --export MyApi -o openapi.json