ForgeLSForgeLS

CLI reference

fls lsp and fls check commands, flags, and exit codes

The fls binary is the ForgeLS entrypoint: an LSP server plus a check linter. Every invocation is one of two subcommands.

fls lsp [--log-level LEVEL]
fls check [PATH...] [--write] [--json]

fls lsp

Runs the LSP server on stdio with Solidity wired in.

FlagValuesMeaning
--log-level LEVELtrace, debug, info, warn, errorLog verbosity. The flag wins over forgels.toml.

Point a generic LSP client at fls lsp with language id solidity for .sol files.

fls check

Lints Solidity files without an editor.

FlagMeaning
[PATH...]Files or dirs to lint. Empty scans the working directory recursively for *.sol.
--writeApply safe fixes in place. Only safe applicability applies.
--jsonEmit the engine JSON report as-is, with 0-based ranges, fix, fixed, and summary.

Output is sorted and deduped. Import resolution uses the working directory or the config root.

Exit codes

CodeMeaning
0Clean or warnings only.
1Any error diagnostic.
2Operational failure: unreadable file, bad write, or unknown rule.

Config

check loads forgels.toml next to the working directory, like the server. A missing file means defaults. Broken TOML means defaults plus a stderr warning. Unknown rule IDs fail with exit 2. Bad levels fall back with a warning.

Limits

  • Single-file analysis: dep-aware rules run without tracked deps.
  • V1 is Solidity only. Noir stays out to keep the binary small.