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.
Install
Section titled “Install”npm install -g @midlyr/cliAuthenticate. Either run the browser-based login flow, which writes credentials to ~/.config/midlyr/credentials.json:
midlyr loginOr set an API key in the environment:
export MIDLYR_API_KEY="ml_..."Common Commands
Section titled “Common Commands”midlyr browse-document --query "provisional credit"midlyr describe-document cmdoc_01HXZ3K4M7QR9VP2N8WYJF5GTBmidlyr read-document-content cmdoc_01HXZ3K4M7QR9VP2N8WYJF5GTB --offset 0 --limit 40000midlyr query-document --query "provisional credit timing" --authority cfpb --limit 5midlyr 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.