Skip to main content

OpenCaseLaw research CLI

ocl checks Swiss case citations against the open OpenCaseLaw corpus (over a million published decisions of the Federal Supreme Court and the cantonal courts, federal and cantonal statutes) and keeps the evidence behind a memo. Dependency-free Python 3.10+; JSON when piped, readable text at a terminal.

pipx install opencaselaw-cli        # or: uv tool install opencaselaw-cli

Two jobs

Check the citations in a draft, written the way lawyers write them:

ocl citations resolve 'BGE 136 III 513 E. 2.3' 'BGer 4A_747/2012 vom 5. April 2013' \
    'Obergericht ZH LA210005 vom 15. Juni 2021' 'BGE 999 III 1'

Each reference comes back resolved, pinpoint_unavailable, discrepancy (the decision exists but the date or docket written next to it is wrong), missing, ambiguous or unrecognized, with the service's own citation strings and the verbatim text of the cited Erwägung. The rule behind it: the decision the service proposes must carry the label the author wrote; nothing is ever substituted, and no citation string is built by the client.

Check the quotations against the served text (exact, near with the differing spans, or not_found):

ocl quotes check 'BGE 136 III 513 E. 2.3' --quote "le contrat de travail conclu pour une durée indéterminée"

Keep the evidence behind a memo:

ocl bundle create 'Rachekündigung Art. 336 OR' --max-results 10 --passage 2 --law OR:336 --out evidence
ocl bundle verify evidence

A bundle folder holds the selected decisions (JSON and plain text), the named Erwägungen and statute articles, a plain-language INDEX.md, and a manifest.json with every request, timestamp, source link and SHA-256.

Also: ocl decisions search, ocl decisions get, ocl decisions passage, ocl laws get, ocl citations list, ocl cite. ocl <command> --help has examples for each.

For agents

The package ships an agent skill (skills/citation-check/SKILL.md): extract the citations from a draft, run ocl citations resolve --format jsonl, read the statuses, quote passages verbatim, report what did not resolve. Exit codes carry the verdict: 0 everything resolved; 2 invalid input; 3 transport or server failure; 4 something did not resolve or is not in the corpus.

Scope

Existence, identity and wording only. The tool never says that a decision supports a proposition, is still good law, or fits the facts. Results come from a hosted corpus that is rebuilt nightly, not from an offline snapshot; keep the returned source links and pagination metadata with your work.

Guide: https://opencaselaw.ch/research-cli.md · Site: https://opencaselaw.ch/cli/ · Changelog: CHANGELOG.md. Commands contact https://mcp.opencaselaw.ch by default; --base-url accepts another origin. Defaults can live in ~/.config/ocl/config or OCL_* variables; ocl completion zsh|bash|fish prints a completion script. The client spaces requests by at least 200 ms, retries at most twice by default and respects Retry-After up to 30 seconds.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

opencaselaw_cli-0.4.0.tar.gz (79.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

opencaselaw_cli-0.4.0-py3-none-any.whl (56.2 kB view details)

Uploaded Python 3

File details

Details for the file opencaselaw_cli-0.4.0.tar.gz.

File metadata

  • Download URL: opencaselaw_cli-0.4.0.tar.gz
  • Upload date:
  • Size: 79.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for opencaselaw_cli-0.4.0.tar.gz
Algorithm Hash digest
SHA256 f1a824ee19f919f33744c8efe83e28ebe13692895a9c2def8f376af88c1324e8
MD5 5322fec0c01a2e61b032d7daa0d5ad56
BLAKE2b-256 4be767fe11bee3777c7129f8109ac6e44cc27016b6f92a19c2a8140351d18d10

See more details on using hashes here.

Provenance

The following attestation bundles were made for opencaselaw_cli-0.4.0.tar.gz:

Publisher: release-cli.yml on jonashertner/opencaselaw

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file opencaselaw_cli-0.4.0-py3-none-any.whl.

File metadata

File hashes

Hashes for opencaselaw_cli-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1a1d446b43a2276870809b7a029865de20f51e2f3950fdbfdbfa8db26fcbcc6a
MD5 fbb6d92f2f9681d8b010bb7e2efeb92f
BLAKE2b-256 6e2d1579f1b843e5f9255411e0beeba29ae442c2a511e13825c78cacb2f10b2c

See more details on using hashes here.

Provenance

The following attestation bundles were made for opencaselaw_cli-0.4.0-py3-none-any.whl:

Publisher: release-cli.yml on jonashertner/opencaselaw

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.9.1

2 files

0.9.0

2 files

0.8.0

2 files

0.7.0

2 files

0.6.0

2 files

0.5.1

2 files

0.5.0

2 files

This release

0.4.0 This release

2 files

0.3.1

2 files

0.3.0

2 files

0.2.1

2 files

0.2.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page