Skip to content
Fallow home
All docs pages

Docs home

fallow config

fallow config prints the resolved configuration and the path of the config file that fallow loaded.

Print the resolved configuration as JSON, and the path of the config file that fallow loaded.

For how fallow finds and merges config files, read Configuration overview.

Synopsis

fallow config [OPTIONS]

Options

Output

OptionDescription
--pathPrint only the config file path (one line, no JSON)
--resolvedPrint each decision of a run and its cause as JSON: for each analysis whether it runs and its production mode, and the run settings, each with the flag, environment variable, config key or default that gave it. Environment variables show by name only

Run

OptionDescription
--for <COMMAND>The command whose rules --resolved applies. Without it, the rules of the bare fallow run apply. Values: combined, audit, dead-code, dupes, health.
--only <ONLY>With --resolved: run only these analyses, as --only of the bare run or of fallow audit does. Values: dead-code (alias check), dupes, health, architecture.
--skip <SKIP>With --resolved: skip these analyses, as --skip of the bare run or of fallow audit does. Values: dead-code (alias check), dupes, health, architecture.
--production-dead-codeWith --resolved: run dead-code analysis in production mode
--production-healthWith --resolved: run health analysis in production mode
--production-dupesWith --resolved: run duplication analysis in production mode

The global options are in these groups: Project, Output, Scope, Baselines, Gates, Duplication, Type-aware, Performance.

Fallow looks for .fallowrc.json, .fallowrc.jsonc, fallow.toml and .fallow.toml, in that order, from the project root up to the workspace root. The first match wins, and fallow resolves extends. With the global option --config, fallow loads that file and does not search. The output is JSON for each --format. Add --pretty to indent it.

Output

fallow config | jq '.boundaries.zones[0]'
{
  "name": "services",
  "patterns": [
    "src/services/**"
  ]
}

The JSON holds each config key with its resolved value, also the defaults. Fallow prints loaded config: <absolute path> on stderr, so stdout holds only the JSON. Without a config file, the stderr line is no config file found, using defaults. With --path, the output is one line with the absolute path of the config file.

Show the settings of a run

fallow config --resolved shows what a run will do and why. For each analysis, the output shows whether it runs and its production mode. It also shows the run settings, such as the thread count, the cache directory, the type-aware setting and the base ref of an audit. Each value has a source: a flag, an environment variable, a config key with its file, or a default.

fallow config --resolved --for audit --base main
{
  "schema_version": 1,
  "kind": "resolved-run",
  "command": "audit",
  "config_file": { "value": ".fallowrc.json", "source": { "kind": "derived", "from": "discovery" }, "scope": "global" },
  "analyses": {
    "dead_code": {
      "selection": { "value": "run", "source": { "kind": "default", "rule": "runs-by-default" }, "scope": "analysis" },
      "production": { "value": true, "source": { "kind": "config-file", "file": ".fallowrc.json", "key": "production" }, "scope": "global" }
    },
    ...
  },
  "settings": {
    "threads": { "value": 10, "source": { "kind": "default", "rule": "available-parallelism" }, "scope": "global" },
    "type_aware": { "value": false, "source": { "kind": "default", "rule": "type-aware-off" }, "scope": "global" },
    "audit_base": { "value": "main", "source": { "kind": "given", "origin": { "kind": "flag", "name": "--base" } }, "scope": "global" },
    ...
  },
  "env": { "read": [], "ignored": [] },
  "fell_back": false
}
  • The JSON goes to stdout for each output format. docs/output-schema.json in the fallow repository describes it as the ResolvedRunView definition.
  • settings.audit_base is the base that --base or FALLOW_AUDIT_BASE names. It is null when the audit detects the base. It has a value only with --for audit.
  • settings.type_aware is null when FALLOW_TYPE_AWARE or FALLOW_TYPE_AWARE_REQUIRE has a value that the run cannot use.
  • The output names each environment variable and never shows its value. A variable with a value that fallow cannot read is in env.ignored. The human format also prints a note for it on stderr.
  • --only and --skip apply to --for combined and --for audit only. With another --for command, they exit with code 2.
  • A config that does not resolve exits with code 2 and a structured error.

fallow config without --resolved does not change.

Exit codes

CodeMeaning
0Fallow printed the config, or the defaults when the project has no config file.
2A config file does not parse, or the file that --config names does not exist.
3With --path: the project has no config file.

See Exit codes.

Examples

# Print the resolved config
fallow config --pretty

# Show which config file applies in a workspace package
cd packages/app && fallow config --path

# Print the duplication settings that apply
fallow config | jq '.duplicates'

# Print the config of another file
fallow --config ./configs/fallow.json config