Skip to content

CLI reference

Terminal window
deduce <verb> <spec.fiqh> [flags]

The brand is Deducible; the binary you run is deduce (you deduce a contract’s compliance).

Verb Purpose
parse Parse a spec and print its AST.
check Run the fiqh invariant engine; report consistency. No files emitted.
build check, then emit codegen artifacts on success.
nl Draft a .fiqh from a natural-language prompt (via an LLM), then re-check it through the same formal gate.
lsp Start the stdio JSON-RPC language server (editor diagnostics).
fuzz [N] Run the property/fuzz harness for N iterations (default 100k).
Flag Values Notes
--rules <name> aaoifi, dsn-mui, hanafi, maliki, shafii, hanbali Select the authority’s rule module. Governs check and build.
--target <t> solidity, manifest, zk, all What build emits. Default all.
--root <dir> path Project root for resolving outputs.
Terminal window
# Check the same spec under two schools (a live khilāf)
deduce check specs/musharakah_mutanaqisah.fiqh --rules hanafi # consistent
deduce check specs/musharakah_mutanaqisah.fiqh --rules maliki # refused: profit_tracks_capital
# Emit only the portable manifest (no Solidity)
deduce build specs/ijarah_imbt.fiqh --root . --target manifest
# Draft from English, then it must still pass the gate
deduce nl prompts/home_finance.txt

Because --rules governs build, a spec a chosen authority refuses will not generate a contract. The authority decides whether code is emitted, not only whether it checks.

deduce nl is deliberately not a shortcut around compliance. The model drafts a candidate .fiqh; that draft is then fed through the same check every hand-written spec faces. A draft that invents a forbidden term is refused exactly as a human’s would be. The LLM proposes, the engine disposes.

  • Language server. deduce lsp powers a VS Code extension with precise, cited diagnostics inline.
  • FFI / Wasm. A C-ABI surface (fiqh_check_json) builds to libfiqhc_ffi.so for JVM, .NET, and C integration, and to deducible.wasm for in-browser validation (the Playground runs the real engine this way).
  • Invariant gateway. A small HTTP service serves manifests and answers POST /enforce { target, terms } with allow or deny plus cited violations, and POST /authorize for contract terms and every party’s capacity. Useful as SupTech that issues no fatwa. See Integration & APIs.