Skip to content

CLI Overview

The MidLyr CLI is the fastest way to test API calls, script compliance workflows, and debug agent integrations outside of an application runtime.

Use the CLI when you need to:

  • Browse the regulatory library.
  • Inspect a document’s metadata.
  • Read a document’s full text body.
  • Submit a compliance-screening analysis job.
Terminal window
npm install -g @midlyr/cli

Authenticate. Either run the browser-based login flow, which writes credentials to ~/.config/midlyr/credentials.json:

Terminal window
midlyr login

Or set an API key in the environment:

Terminal window
export MIDLYR_API_KEY="ml_..."
Terminal window
midlyr browse-document --query "provisional credit"
midlyr describe-document cmdoc_01HXZ3K4M7QR9VP2N8WYJF5GTB
midlyr read-document-content cmdoc_01HXZ3K4M7QR9VP2N8WYJF5GTB --offset 0 --limit 40000
midlyr query-document --query "provisional credit timing" --authority cfpb --limit 5
midlyr screen-analysis \
--scenario dispute \
--text "we can't provide a provisional dispute credit until the investigation is completed"

screen-analysis polls the resulting job until it succeeds or fails and prints the terminal result; pass --no-wait to return the pending job immediately.

query-document is a vector-search retrieval primitive — it returns the top relevant regulation chunks for a natural-language query. No LLM is invoked; compose with your own model for retrieval-augmented generation.